From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 989A241A26 for ; Fri, 20 May 2022 12:07:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B015868B25D; Fri, 20 May 2022 15:07:34 +0300 (EEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2028.outbound.protection.outlook.com [40.92.19.28]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 03F7D68B235 for ; Fri, 20 May 2022 15:07:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8utkQaLBNoFz4gUm+sfCH/1JJgQdwC7O50pYtuKNmInm3pc/2bzmTxa+9H308r5EqCK0QotfcDjCl+xHTyAYQrvgsw9ZMOgl5AZswfapXL/QD6qKbr+1Dcb96k4Fj5v/kAKmKH5JxvvJaHjo62UJau18CKDqF3UenrMf5ze168R9S6JTtW4thw+GQT1d/N/4iAOLs9GbeO98VdXzScNDxRiLzQL+HKaUhyJmgfZV9vOWNvY7ACpnYvKiF0sFCVevCY8um6cTQaxh9F8tJ+oZAs3Qx+HoaaZ1Y0PnU0lFA9QVXPHZjxOBBs+O7LEi5uLzUX4HU4DYodRBakwgboibQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bql3WznHpx1YhwceIQIZbuHmtWUKwB7M8EaZp29MZGc=; b=PrFZB4BgmkyqtqEDUgQPBT20Smm6W9BwCUIY1edN4Iks4QPWqTgfmOi4YDxI3bOThVwUsgEns0SJ/QXKTvi9zNA92GcbD4fiJGKZy0Fi4vPU0MMudr+yENlt57V5UrzQvF6Oi07Sztqe6wlg9/lcpmQX53AfJvnjZb3xvw+Vz3MSNzx+8+3e0xZ2EqBfMc6Qf2kBqgfhNs0mEERXr78Bx9j9j28bUfFCiV7efM9m0ajHFo6JpfZSp+Ap4mRG6eNN+8+0KwCsQtBQXO4AbaAH8SilKA448tssKqt9Z7+0zjH0+6ostAZi/1CDwjhnqvi+yKvAIDKjYJNAlaB8LOyneA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bql3WznHpx1YhwceIQIZbuHmtWUKwB7M8EaZp29MZGc=; b=G5GrFhlsSg+/KJZA9xk9dcnnH+Y36tIQmzKfodLGmrq0TreZ6tYURuKVVBlOEqN9eC9uuyH+uX/Ea/2CVk8zu3tNsXxEXBR4tbaCkceINb5c2b1ogSPb1jOKBEh593Hm2cRs+CmIPXUuUcIV/oYW7YkydFnsT18hBPboRJ8wUeu2Xw1xhKXmsHYWBLV3FmShz3DZ9VVoylxPUOVdLuEu5R0UTJHK6ctbi00xZTz3MerLnkW1aLwnw6sLfrSBJmFi6cufIZ5UtC6sHUPEYNqNpWp6J7Qoe7sT1gpfajDVUCgU+ouu0IoIWXyJLg3aN50ZWP5cOS+lalYrtGHrhpTbew== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by IA1P223MB0497.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:3eb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Fri, 20 May 2022 12:07:25 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::c536:493f:7cda:53dc]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::c536:493f:7cda:53dc%3]) with mapi id 15.20.5273.017; Fri, 20 May 2022 12:07:25 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH] avcodec/libx264: don't define X264_API_IMPORTS when compiling static Thread-Index: AQHYa9MhZAmI4J2BGkWRTzy53N4oQq0njh8AgAACJPCAABQsgIAAAfvw Date: Fri, 20 May 2022 12:07:25 +0000 Message-ID: References: <23cc0bf5-9cef-5b8d-7e4d-440776cd2e5f@rothenpieler.org> <9d414f9e-0a17-b490-e54c-7ecace981af3@rothenpieler.org> In-Reply-To: <9d414f9e-0a17-b490-e54c-7ecace981af3@rothenpieler.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [5yZeyMmEt1C20YghNtlRfIyheqOrEMAt] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b6928209-55fd-4037-62af-08da3a594d61 x-ms-traffictypediagnostic: IA1P223MB0497:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cSZ0FLiwtk2aMcTz3a3K+7putPC+8bgpQkLPCgHlfJyEMq38dS3xEuT931KdrfptcmqR5DhLbv37j9ezVNmoDcS2FAKjxblbDWb0JXMH/wsOnLL1Fpqi98goPiAdKuhw9m7mogg1aZllQykuObo5rfNAwlbNnhKY+vcVgW7qpQZkwVRhHqeYBr3XiK9XHfZpUBBXq9AJXXDx9nnh/qdPw3iCx3Z/TkgO64OWI3AxQA+4NrOhl5lN6pz9RZXCVAc/38lrUTz2N93Xg3BpN4wMMPBLA49i86SH53mlhyDf9Hv9XtB2KcuiRCO9EUXHJcKOBIZv0NyxsdKgPPCxbfPLjdQxae8x+5mR7r82M5ii5hCEOft4Y6pIE9j9G7oFXVKV95vko7XLYpowigXydWeZARhAs9ivECF43tShfGEvQjSnyjTQya+tH3ZPzQkkoJZpHVtARG57sjKF4xccH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JxQVRCaGZBdTRkczV1N2VQWnRpQWVmcjJ6OVdORU5kbHMybTNB?= =?utf-8?B?bGZ2aWsxMk0rQy9acCtYQllnTTdGU291a2tPWEtHaW1PRng0dm1xZWQ5d0c2?= =?utf-8?B?K0JNMVN3c2xieHd6bTNVNTZYR1A4QWRrK0oxOW5NMENsWGxtR21KYk5rUnRR?= =?utf-8?B?WVBvMFErc013L09ReWJYdVdpaUcyMDdjWEE1cUJnSWJpQStwVGd4ZTlNenVV?= =?utf-8?B?OXJhRFp5MTJ0OUpiUGhxUDNxaE1ySnVZUHQwU01LeGwyeDVMaXNRM0pHRlhK?= =?utf-8?B?VXR2L1djc0pEYzR0Y1FjM1ZmOVQ2dXR6NEREZGFTSzc2Rzk2Q1kxM3FhQ3ZF?= =?utf-8?Q?kyxYJokyQJk=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b6928209-55fd-4037-62af-08da3a594d61 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2022 12:07:25.0762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1P223MB0497 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libx264: don't define X264_API_IMPORTS when compiling static X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > -----Original Message----- > From: ffmpeg-devel On Behalf Of Timo > Rothenpieler > Sent: Friday, May 20, 2022 1:38 PM > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libx264: don't define > X264_API_IMPORTS when compiling static > > On 20/05/2022 12:39, Soft Works wrote: > > > > > >> -----Original Message----- > >> From: ffmpeg-devel On Behalf Of > Timo > >> Rothenpieler > >> Sent: Friday, May 20, 2022 12:18 PM > >> To: ffmpeg-devel@ffmpeg.org > >> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libx264: don't define > >> X264_API_IMPORTS when compiling static > >> > >> On 20/05/2022 00:52, softworkz wrote: > >>> From: softworkz > >>> > >>> The definition of X264_API_IMPORTS is required for shared linking > >>> (when MSVC is used) but it must not be defined in case of static > >>> builds as is stated in x264.h: > >> > >> This doesn't seem right. It's about shared or static linking of > >> libx264 > >> itself, not ffmpeg. > > > > How about some custom macro like DISABLE_X264_API_IMPORTS that one > > can set when desired? > > > > In that case there wouldn't be any logical irritation. > > > > I'm still quite confused what the actual issue here is. > Countless libraries ffmpeg depends on need those kind of macros to set > the correct function import preamble. > Why does x264 need special treatment? It correctly sets the desired > flag > via its pkg-config file. The current code is #if defined(_MSC_VER) #define X264_API_IMPORTS 1 #endif Which means that this macro is always set then building with MSVC. But the macro may only be set when linking to x264.dll, not when linking statically to libx264. (pkg-config can't do anything about that) This problem was introduced by this change in libx264: https://code.videolan.org/videolan/x264/-/commit/a615f027ed172e2dd5380e736d487aa858a0c4ff#98b74dd0a8bf575bfdf90bbccf5142a555f06d4f_56_69 Previously, they had this line #define X264_API __declspec(dllimport) Which handled the situation automatically by checking whether it's linked as dll or static lib. But after that change, you are required to set this yourself (as a consumer). But ffmpeg has no proper condition to set this only when linking to x264.dll. That's why the current code is essentially wrong: #if defined(_MSC_VER) #define X264_API_IMPORTS 1 #endif And besides that, I don't think that those things belong into a code file. > Is this some "pkg-config does not exist with msvc" thing? The "official" way of building ffmpeg with MSVC is to run configure and make from MSYS2/MinGW which then only calls cl.exe and link.exe from a Visual Studio installation. In this case pkg-config is used. I'm working with regular Visual Studio projects, though. Even dependencies like libx264 are compiled in their own VS projects. There's no MSYS2, no make, no pkg-conf involved. I _think_ that just nobody has ever tried to link libx264 statically when compiling in the "official way", which is probably rarely used anyway and even more rare that somebody would bother to link with x264 and once again even more rare that the one would on top of that decide to link to libx264 statically. That's my guess why nobody has complained about this during the past 3 years. Kind regards, softworkz _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".