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 CA48C43AC2 for ; Tue, 12 Jul 2022 12:09:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8234A68B8C4; Tue, 12 Jul 2022 15:09:11 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B89F368B683 for ; Tue, 12 Jul 2022 15:09:05 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 5DEF34A957 for ; Tue, 12 Jul 2022 14:09:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1657627744; bh=5IVwnSkOwFv8V3ZwSaPKwugMtv8fjVmtmGnveU2Dryc=; h=Date:From:To:Subject:In-Reply-To:References:From; b=YygIfpbGYXOMrkI+nuomr/S35q88QecqEOHYhDV0V/NaW8HI3fn31xbRQUTOiwFSs axK0Fxt65rUQYOPsTClgPU9Sn8EcIHYoKsGx/0+vjvyklCN101syhgQN4JLF2ZbY04 zOEsMbJN8hJP7ivsVNP+DW6nFfOi6htnOO+fL6LM= Date: Tue, 12 Jul 2022 14:09:04 +0200 Message-ID: <20220712140904.GB21507@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: References: <20220629101251.13236-1-ffmpeg@haasn.xyz> <20220629101251.13236-2-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH v2 1/6] fflcms2: move to libavcodec 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: On Wed, 06 Jul 2022 16:18:21 +0200 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > We will need this helper inside libavcodec in the future, so move it > > there, leaving behind an #include to the raw source file in its old > > location in libvfilter. This approach is inspired by the handling of > > vulkan.c, and avoids us needing to expose any of it publicly (or > > semi-publicly) in e.g. libavutil, thus avoiding any ABI headaches. > > This is only correct if you work under the assumption that when building > with static libraries, all the static libraries come from the same > commit. If you e.g. allow to build with an older libavfilter and a newer > libavcodec (like with shared libs), this assumption breaks down: if the > newer version of this file exports another function, you get linker > (ODR) errors because both versions might be pulled in. > Behaviour/signature changes by any function or modifications to any of > the structs would be similarly catastrophic. > > A way out of this mess would be to version everything in the header like so: > #define FFLCMS2_VERSION 1 > > void AV_JOIN(ff_icc_context_uninit, FFLCMS2_VERSION)(FFIccContext *s); > > (of course, there should be a dedicated macro for this to reduce typing.) > > A patch that makes any of the "catastrophic" modifications described > above would need to bump the version. If one uses compatible versions, > the files would be deduplicated for static builds. > It would of course have the downside that these macros would be > everywhere where it is used, not only in fflcms2.[ch]. I suppose you could also version this API on a symbol-by-symbol basis, with v1 being the current version (and then v2 getting a 2 suffix, and so on). In that case, we don't need to do anything currently, rather the first patch to modify this API would have to worry about making sure the new symbol doesn't conflict. > > > > > It's debatable whether the actual code belongs in libavcodec or > > libavfilter, but I decided to put it into libavcodec because it > > conceptually deals with encoding and decoding ICC profiles, and will be > > used to decode embedded ICC profiles in image files. > > > > Signed-off-by: Niklas Haas > > --- > > libavcodec/Makefile | 1 + > > libavcodec/fflcms2.c | 311 ++++++++++++++++++++++++++++++++++++++++++ > > libavcodec/fflcms2.h | 87 ++++++++++++ > > libavfilter/fflcms2.c | 294 +-------------------------------------- > > libavfilter/fflcms2.h | 65 +-------- > > 5 files changed, 401 insertions(+), 357 deletions(-) > > create mode 100644 libavcodec/fflcms2.c > > create mode 100644 libavcodec/fflcms2.h > > > > _______________________________________________ > 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". _______________________________________________ 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".