[FFmpeg-devel] [PATCH v3] libx264: Set min build version to 158

Soft Works softworkz at hotmail.com
Wed May 25 12:53:51 EEST 2022



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Andreas
> Rheinhardt
> Sent: Wednesday, May 25, 2022 11:39 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v3] libx264: Set min build version to
> 158
> 
> Matt Oliver:
> > From: Matt Oliver <protogonoi at gmail.com>
> >
> > Was "[PATCH] libx264: Do not explicitly set X264_API_IMPORTS"
> >
> > Setting X264_API_IMPORTS only affects msvc builds and it breaks
> > linking to static builds (although is required for shared builds).
> > This flag is set by x264 in its pkgconfig as required since build
> > 158 (a615f027ed172e2dd5380e736d487aa858a0c4ff) from July 2019.
> > So this patch updates configure to require a newer x264 build that
> > correctly sets the imports flag.
> >
> > The requirement for 158 is applied for msvc builds only,
> > no change is made for all other cases.
> >
> > Co-authored-by: softworkz <softworkz at hotmail.com>
> > Signed-off-by: softworkz <softworkz at hotmail.com>
> > Signed-off-by: Matt Oliver <protogonoi at gmail.com>
> > ---
> >     libx264: Set min build version to 158
> >
> >     I'm submitting this patch on behalf of Matt with his permission.
> >
> >     There was agreement that the >= 158 version requirement should be
> >     applied to MSVC builds only.
> >
> >     v2: restrict the version requirement to msvc builds
> >     v3: fix unintended author change
> >
> > Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-
> ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v3
> > Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-
> ffstaging-30/softworkz/submit_x264_api_imports_matt-v3
> > Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> >
> > Range-diff vs v2:
> >
> >  1:  1696684de3 ! 1:  374130a09e libx264: Set min build version to 158
> >      @@
> >        ## Metadata ##
> >      -Author: softworkz <softworkz at hotmail.com>
> >      +Author: Matt Oliver <protogonoi at gmail.com>
> >
> >        ## Commit message ##
> >           libx264: Set min build version to 158
> >
> >
> >  configure            | 8 +++-----
> >  libavcodec/libx264.c | 4 ----
> >  2 files changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/configure b/configure
> > index f115b21064..9de9b7763a 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6656,11 +6656,9 @@ enabled libvpx            && {
> >  enabled libwebp           && {
> >      enabled libwebp_encoder      && require_pkg_config libwebp "libwebp
> >= 0.2.0" webp/encode.h WebPGetEncoderVersion
> >      enabled libwebp_anim_encoder && check_pkg_config
> libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h
> WebPAnimEncoderOptionsInit; }
> > -enabled libx264           && { check_pkg_config libx264 x264 "stdint.h
> x264.h" x264_encoder_encode ||
> > -                               { require libx264 "stdint.h x264.h"
> x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
> > -                                 warn "using libx264 without pkg-
> config"; } } &&
> > -                             require_cpp_condition libx264 x264.h
> "X264_BUILD >= 118" &&
> > -                             check_cpp_condition libx262 x264.h
> "X264_MPEG2"
> > +enabled libx264           && check_pkg_config libx264 x264 "stdint.h
> x264.h" x264_encoder_encode &&
> > +                             require_cpp_condition libx264 x264.h
> "X264_BUILD >= 158" ||
> > +                             { "$toolchain" != msvc &&
> require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }
> 
> IIRC this is equivalent to
> 
> { enabled libx264           && check_pkg_config libx264 x264 "stdint.h
> x264.h" x264_encoder_encode &&
>                              require_cpp_condition libx264 x264.h
> "X264_BUILD >= 158" } ||
>                              { "$toolchain" != msvc &&
> require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }
> 
> which is not whan you want as the ""$toolchain" != msvc &&
> require_cpp_condition libx264 x264.h "X264_BUILD >= 118";" is executed
> even if libx264 is not even enabled.


Thanks. So what I want is probably to enclose the two OR terms 
in curly braces, like this?


enabled libx264   && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
                     { require_cpp_condition libx264 x264.h "X264_BUILD >= 158" ||
                     { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }; }


sw


More information about the ffmpeg-devel mailing list