[FFmpeg-devel] [PATCH 05/13] libavcodec: Split version.h
Martin Storsjö
martin at martin.st
Fri Feb 25 22:44:32 EET 2022
On Fri, 25 Feb 2022, Andreas Rheinhardt wrote:
> Martin Storsjö:
>> On Fri, 25 Feb 2022, Michael Niedermayer wrote:
>>
>>> On Wed, Feb 23, 2022 at 04:29:43PM +0200, Martin Storsjö wrote:
>>>> This avoids including version.h in all source files, avoiding
>>>> unnecessary rebuilds when the version number is bumped. Only
>>>> version_major.h is included by the main header, which defines
>>>> availability of e.g. FF_API_* macros, and which is bumped much
>>>> less often.
>>>> ---
>>>> fftools/cmdutils.c | 1 +
>>>> fftools/ffmpeg.c | 1 +
>>>> fftools/ffprobe.c | 1 +
>>>> libavcodec/Makefile | 1 +
>>>> libavcodec/aacenc.c | 1 +
>>>> libavcodec/avcodec.c | 1 +
>>>> libavcodec/avcodec.h | 2 +-
>>>> libavcodec/codec.h | 2 +-
>>>> libavcodec/dpxenc.c | 1 +
>>>> libavcodec/j2kenc.c | 1 +
>>>> libavcodec/libvorbisenc.c | 1 +
>>>> libavcodec/mjpegenc_common.c | 1 +
>>>> libavcodec/mpeg4videoenc.c | 1 +
>>>> libavcodec/options_table.h | 2 +-
>>>> libavcodec/packet.h | 2 +-
>>>> libavcodec/pthread_frame.c | 2 +-
>>>> libavcodec/tiffenc.c | 1 +
>>>> libavcodec/vaapi_encode_h264.c | 1 +
>>>> libavcodec/version.h | 28 ++---------------
>>>> libavcodec/version_major.h | 55 ++++++++++++++++++++++++++++++++++
>>>> libavformat/movenc.c | 1 +
>>>> 21 files changed, 76 insertions(+), 31 deletions(-)
>>>> create mode 100644 libavcodec/version_major.h
>>>
>>> not sure i missed some patch but this seems not to build
>>>
>>> CC libavcodec/vc2enc.o
>>> libavcodec/vc2enc.c: In function ‘vc2_encode_frame’:
>>> libavcodec/vc2enc.c:957:48: error: ‘LIBAVCODEC_IDENT’ undeclared
>>> (first use in this function); did you mean ‘LIBAVUTIL_IDENT’?
>>> const char *aux_data = bitexact ? "Lavc" : LIBAVCODEC_IDENT;
>>> ^~~~~~~~~~~~~~~~
>>> LIBAVUTIL_IDENT
>>> libavcodec/vc2enc.c:957:48: note: each undeclared identifier is
>>> reported only once for each function it appears in
>>> ffbuild/common.mak:78: recipe for target 'libavcodec/vc2enc.o' failed
>>> make: *** [libavcodec/vc2enc.o] Error 1
>>> make: Target 'all' not remade because of errors.
>>
>> This patch requires adjustments after
>> 155cd6baa49797d57f5b42276eeed3f5408ef3f7 was pushed (it should apply and
>> build fine on a version slightly older than that), readding an include
>> of "version.h", I didn't want to spam the list with a full new round of
>> patches just because of that, but if you want to, I can send my latest
>> local revision of the patchset.
>>
>
> Sorry for this. My aim was actually to not just remove headers if it
> compiles fine without them, but to only include headers that provide
> nothing that is used. But apparently I messed it up with
> 155cd6baa49797d57f5b42276eeed3f5408ef3f7.
No worries, I guess I should have spotted it myself while reviewing that
patch...
// Martin
More information about the ffmpeg-devel
mailing list