Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] libx264: Set min build version to 158
@ 2022-05-20 23:11 Matt Oliver
  2022-05-25  9:31 ` [FFmpeg-devel] [PATCH v2] " softworkz
  0 siblings, 1 reply; 19+ messages in thread
From: Matt Oliver @ 2022-05-20 23:11 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Matt Oliver

From: Matt Oliver <protogonoi@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.

Alternatively we can detect the x264 build version in configure
and keep the fallback of manually setting the flag on older x264
builds that arent using pkgconfig (to keep the old behaviour) but
that requires some complex configure changes.

Submitted-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
---
    libx264: Set min build version to 158
    
    I'm submitting this patch on behalf of Matt with his permission.
    
    There seemed to be agreement that the 158 version limit should be
    applied to MSVC builds only. For the latter I'd need some help, because
    I can't test this and I'm not familiar enough with the configure script
    logic to make a change with sufficient confidence.
    
    Thanks, softworkz

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v1
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v1
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

 configure            | 7 ++-----
 libavcodec/libx264.c | 4 ----
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index f115b21064..d977a97397 100755
--- a/configure
+++ b/configure
@@ -6656,11 +6656,8 @@ 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"
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: 41a558fea06cc0a23b8d2d0dfb03ef6a25cf5100
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v2] libx264: Set min build version to 158
  2022-05-20 23:11 [FFmpeg-devel] [PATCH] libx264: Set min build version to 158 Matt Oliver
@ 2022-05-25  9:31 ` softworkz
  2022-05-25  9:34   ` [FFmpeg-devel] [PATCH v3] " Matt Oliver
  0 siblings, 1 reply; 19+ messages in thread
From: softworkz @ 2022-05-25  9:31 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.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@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v2
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v2
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

Range-diff vs v1:

 1:  bbe97f5e1b ! 1:  1696684de3 libx264: Set min build version to 158
     @@
       ## Metadata ##
     -Author: Matt Oliver <protogonoi@gmail.com>
     +Author: softworkz <softworkz@hotmail.com>
      
       ## Commit message ##
          libx264: Set min build version to 158
     @@ Commit message
          So this patch updates configure to require a newer x264 build that
          correctly sets the imports flag.
      
     -    Alternatively we can detect the x264 build version in configure
     -    and keep the fallback of manually setting the flag on older x264
     -    builds that arent using pkgconfig (to keep the old behaviour) but
     -    that requires some complex configure changes.
     +    The requirement for 158 is applied for msvc builds only,
     +    no change is made for all other cases.
      
     -    Submitted-by: softworkz <softworkz@hotmail.com>
     +    Co-authored-by: softworkz <softworkz@hotmail.com>
     +    Signed-off-by: softworkz <softworkz@hotmail.com>
          Signed-off-by: Matt Oliver <protogonoi@gmail.com>
      
       ## configure ##
     @@ configure: enabled libvpx            && {
      -                             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"
     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158" ||
     ++                             { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }
       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
       enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"


 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"; }
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v3] libx264: Set min build version to 158
  2022-05-25  9:31 ` [FFmpeg-devel] [PATCH v2] " softworkz
@ 2022-05-25  9:34   ` Matt Oliver
  2022-05-25  9:38     ` Andreas Rheinhardt
  2022-05-25 11:05     ` [FFmpeg-devel] [PATCH v4] " Matt Oliver
  0 siblings, 2 replies; 19+ messages in thread
From: Matt Oliver @ 2022-05-25  9:34 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Matt Oliver

From: Matt Oliver <protogonoi@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@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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@hotmail.com>
     +Author: Matt Oliver <protogonoi@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"; }
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3] libx264: Set min build version to 158
  2022-05-25  9:34   ` [FFmpeg-devel] [PATCH v3] " Matt Oliver
@ 2022-05-25  9:38     ` Andreas Rheinhardt
  2022-05-25  9:53       ` Soft Works
  2022-05-25 11:05     ` [FFmpeg-devel] [PATCH v4] " Matt Oliver
  1 sibling, 1 reply; 19+ messages in thread
From: Andreas Rheinhardt @ 2022-05-25  9:38 UTC (permalink / raw)
  To: ffmpeg-devel

Matt Oliver:
> From: Matt Oliver <protogonoi@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@hotmail.com>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: Matt Oliver <protogonoi@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@hotmail.com>
>      +Author: Matt Oliver <protogonoi@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.

>  enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                               require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>  enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 4ce3791ae8..14177b3016 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -37,10 +37,6 @@
>  #include "atsc_a53.h"
>  #include "sei.h"
>  
> -#if defined(_MSC_VER)
> -#define X264_API_IMPORTS 1
> -#endif
> -
>  #include <x264.h>
>  #include <float.h>
>  #include <math.h>
> 
> base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3] libx264: Set min build version to 158
  2022-05-25  9:38     ` Andreas Rheinhardt
@ 2022-05-25  9:53       ` Soft Works
  0 siblings, 0 replies; 19+ messages in thread
From: Soft Works @ 2022-05-25  9:53 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Andreas
> Rheinhardt
> Sent: Wednesday, May 25, 2022 11:39 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v3] libx264: Set min build version to
> 158
> 
> Matt Oliver:
> > From: Matt Oliver <protogonoi@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@hotmail.com>
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > Signed-off-by: Matt Oliver <protogonoi@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@hotmail.com>
> >      +Author: Matt Oliver <protogonoi@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
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v4] libx264: Set min build version to 158
  2022-05-25  9:34   ` [FFmpeg-devel] [PATCH v3] " Matt Oliver
  2022-05-25  9:38     ` Andreas Rheinhardt
@ 2022-05-25 11:05     ` Matt Oliver
  2022-05-25 15:15       ` Michael Niedermayer
  2022-05-26  7:28       ` [FFmpeg-devel] [PATCH v5] " Matt Oliver
  1 sibling, 2 replies; 19+ messages in thread
From: Matt Oliver @ 2022-05-25 11:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Matt Oliver, Andreas Rheinhardt

From: Matt Oliver <protogonoi@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@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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
    v4: add missing braces

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v4
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v4
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

Range-diff vs v3:

 1:  374130a09e ! 1:  0d1bee35b0 libx264: Set min build version to 158
     @@ configure: enabled libvpx            && {
      -                             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"; }
     ++                             { require_cpp_condition libx264 x264.h "X264_BUILD >= 158" ||
     ++                             { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }; }
       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
       enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"


 configure            | 8 +++-----
 libavcodec/libx264.c | 4 ----
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index f115b21064..129473c75c 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"; }; }
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4] libx264: Set min build version to 158
  2022-05-25 11:05     ` [FFmpeg-devel] [PATCH v4] " Matt Oliver
@ 2022-05-25 15:15       ` Michael Niedermayer
  2022-05-25 22:53         ` Andreas Rheinhardt
  2022-05-26  7:28       ` [FFmpeg-devel] [PATCH v5] " Matt Oliver
  1 sibling, 1 reply; 19+ messages in thread
From: Michael Niedermayer @ 2022-05-25 15:15 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 4755 bytes --]

On Wed, May 25, 2022 at 11:05:39AM +0000, Matt Oliver wrote:
> From: Matt Oliver <protogonoi@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@hotmail.com>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: Matt Oliver <protogonoi@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
>     v4: add missing braces
> 
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v4
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v4
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> 
> Range-diff vs v3:
> 
>  1:  374130a09e ! 1:  0d1bee35b0 libx264: Set min build version to 158
>      @@ configure: enabled libvpx            && {
>       -                             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"; }
>      ++                             { require_cpp_condition libx264 x264.h "X264_BUILD >= 158" ||
>      ++                             { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }; }
>        enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                                     require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>        enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> 
> 
>  configure            | 8 +++-----
>  libavcodec/libx264.c | 4 ----
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/configure b/configure
> index f115b21064..129473c75c 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"; }; }

On ubuntu LTS:

ERROR: X264_BUILD >= 158 not satisfied

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4] libx264: Set min build version to 158
  2022-05-25 15:15       ` Michael Niedermayer
@ 2022-05-25 22:53         ` Andreas Rheinhardt
  2022-05-26  7:26           ` Soft Works
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Rheinhardt @ 2022-05-25 22:53 UTC (permalink / raw)
  To: ffmpeg-devel

Michael Niedermayer:
> On Wed, May 25, 2022 at 11:05:39AM +0000, Matt Oliver wrote:
>> From: Matt Oliver <protogonoi@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@hotmail.com>
>> Signed-off-by: softworkz <softworkz@hotmail.com>
>> Signed-off-by: Matt Oliver <protogonoi@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
>>     v4: add missing braces
>>
>> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v4
>> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v4
>> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
>>
>> Range-diff vs v3:
>>
>>  1:  374130a09e ! 1:  0d1bee35b0 libx264: Set min build version to 158
>>      @@ configure: enabled libvpx            && {
>>       -                             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"; }
>>      ++                             { require_cpp_condition libx264 x264.h "X264_BUILD >= 158" ||
>>      ++                             { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }; }
>>        enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>>                                     require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>>        enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
>>
>>
>>  configure            | 8 +++-----
>>  libavcodec/libx264.c | 4 ----
>>  2 files changed, 3 insertions(+), 9 deletions(-)
>>
>> diff --git a/configure b/configure
>> index f115b21064..129473c75c 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"; }; }
> 
> On ubuntu LTS:
> 
> ERROR: X264_BUILD >= 158 not satisfied
> 
> If you think configure made a mistake, make sure you are using the latest
> version from Git.  If the latest version fails, report the problem to the
> ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
> Include the log file "ffbuild/config.log" produced by configure as this will help
> solve the problem.
> 

That is because require_cpp_condition has a "|| die "ERROR: $condition
not satisfied" at the end, so ordinary short-circuiting logic does not
apply.
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
"$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD
>= 158"; }
would avoid this and might actually work.

- Andreas
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4] libx264: Set min build version to 158
  2022-05-25 22:53         ` Andreas Rheinhardt
@ 2022-05-26  7:26           ` Soft Works
  0 siblings, 0 replies; 19+ messages in thread
From: Soft Works @ 2022-05-26  7:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Andreas
> Rheinhardt
> Sent: Thursday, May 26, 2022 12:53 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v4] libx264: Set min build version to
> 158
> 
> Michael Niedermayer:
> > On Wed, May 25, 2022 at 11:05:39AM +0000, Matt Oliver wrote:
> >> From: Matt Oliver <protogonoi@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@hotmail.com>
> >> Signed-off-by: softworkz <softworkz@hotmail.com>
> >> Signed-off-by: Matt Oliver <protogonoi@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
> >>     v4: add missing braces
> >>
> >> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-
> ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v4
> >> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-
> ffstaging-30/softworkz/submit_x264_api_imports_matt-v4
> >> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> >>
> >> Range-diff vs v3:
> >>
> >>  1:  374130a09e ! 1:  0d1bee35b0 libx264: Set min build version to 158
> >>      @@ configure: enabled libvpx            && {
> >>       -                             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"; }
> >>      ++                             { require_cpp_condition libx264
> x264.h "X264_BUILD >= 158" ||
> >>      ++                             { "$toolchain" != msvc &&
> require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; }; }
> >>        enabled libx265           && require_pkg_config libx265 x265
> x265.h x265_api_get &&
> >>                                     require_cpp_condition libx265
> x265.h "X265_BUILD >= 70"
> >>        enabled libxavs           && require libxavs "stdint.h xavs.h"
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> >>
> >>
> >>  configure            | 8 +++-----
> >>  libavcodec/libx264.c | 4 ----
> >>  2 files changed, 3 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/configure b/configure
> >> index f115b21064..129473c75c 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"; }; }
> >
> > On ubuntu LTS:
> >
> > ERROR: X264_BUILD >= 158 not satisfied
> >
> > If you think configure made a mistake, make sure you are using the
> latest
> > version from Git.  If the latest version fails, report the problem to
> the
> > ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
> > Include the log file "ffbuild/config.log" produced by configure as this
> will help
> > solve the problem.
> >
> 
> That is because require_cpp_condition has a "|| die "ERROR: $condition
> not satisfied" at the end, so ordinary short-circuiting logic does not
> apply.
> require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
> "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD
> >= 158"; }
> would avoid this and might actually work.

Cool, thanks!

@Michael - thanks for testing. It's not that I hadn't tested myself 
but I tested MinGW with existing libx264 and Ubuntu, where I don't have
libx264 installed.

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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v5] libx264: Set min build version to 158
  2022-05-25 11:05     ` [FFmpeg-devel] [PATCH v4] " Matt Oliver
  2022-05-25 15:15       ` Michael Niedermayer
@ 2022-05-26  7:28       ` Matt Oliver
  2022-05-26 10:50         ` Michael Niedermayer
  2022-05-26 12:29         ` [FFmpeg-devel] [PATCH v6] " Matt Oliver
  1 sibling, 2 replies; 19+ messages in thread
From: Matt Oliver @ 2022-05-26  7:28 UTC (permalink / raw)
  To: ffmpeg-devel
  Cc: Michael Niedermayer, softworkz, Matt Oliver, Andreas Rheinhardt

From: Matt Oliver <protogonoi@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@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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
    v4: add missing braces
    v5: fixed condition (again ;-)

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v5
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v5
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

Range-diff vs v4:

 1:  0d1bee35b0 ! 1:  8c4fe7ffc2 libx264: Set min build version to 158
     @@ configure: enabled libvpx            && {
      -                             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"; }; }
     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
     ++                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
       enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"


 configure            | 8 +++-----
 libavcodec/libx264.c | 4 ----
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index f115b21064..e46d362b04 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 >= 118" && {
+                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v5] libx264: Set min build version to 158
  2022-05-26  7:28       ` [FFmpeg-devel] [PATCH v5] " Matt Oliver
@ 2022-05-26 10:50         ` Michael Niedermayer
  2022-05-26 11:20           ` Soft Works
  2022-05-26 12:29         ` [FFmpeg-devel] [PATCH v6] " Matt Oliver
  1 sibling, 1 reply; 19+ messages in thread
From: Michael Niedermayer @ 2022-05-26 10:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 5205 bytes --]

On Thu, May 26, 2022 at 07:28:10AM +0000, Matt Oliver wrote:
> From: Matt Oliver <protogonoi@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@hotmail.com>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: Matt Oliver <protogonoi@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
>     v4: add missing braces
>     v5: fixed condition (again ;-)
> 
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v5
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v5
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> 
> Range-diff vs v4:
> 
>  1:  0d1bee35b0 ! 1:  8c4fe7ffc2 libx264: Set min build version to 158
>      @@ configure: enabled libvpx            && {
>       -                             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"; }; }
>      ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
>      ++                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
>        enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                                     require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>        enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> 
> 
>  configure            | 8 +++-----
>  libavcodec/libx264.c | 4 ----
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/configure b/configure
> index f115b21064..e46d362b04 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 >= 118" && {
> +                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
>  enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                               require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>  enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"

./configure: 6663: ./configure: : Permission denied
ERROR: X264_BUILD >= 158 not satisfied

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v5] libx264: Set min build version to 158
  2022-05-26 10:50         ` Michael Niedermayer
@ 2022-05-26 11:20           ` Soft Works
  0 siblings, 0 replies; 19+ messages in thread
From: Soft Works @ 2022-05-26 11:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Michael
> Niedermayer
> Sent: Thursday, May 26, 2022 12:51 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v5] libx264: Set min build version to
> 158
> 
> On Thu, May 26, 2022 at 07:28:10AM +0000, Matt Oliver wrote:
> > From: Matt Oliver <protogonoi@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@hotmail.com>
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > Signed-off-by: Matt Oliver <protogonoi@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
> >     v4: add missing braces
> >     v5: fixed condition (again ;-)
> >
> > Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-
> ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v5
> > Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-
> ffstaging-30/softworkz/submit_x264_api_imports_matt-v5
> > Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> >
> > Range-diff vs v4:
> >
> >  1:  0d1bee35b0 ! 1:  8c4fe7ffc2 libx264: Set min build version to 158
> >      @@ configure: enabled libvpx            && {
> >       -                             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"; }; }
> >      ++                             require_cpp_condition libx264 x264.h
> "X264_BUILD >= 118" && {
> >      ++                             "$toolchain" != msvc ||
> require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
> >        enabled libx265           && require_pkg_config libx265 x265
> x265.h x265_api_get &&
> >                                     require_cpp_condition libx265 x265.h
> "X265_BUILD >= 70"
> >        enabled libxavs           && require libxavs "stdint.h xavs.h"
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> >
> >
> >  configure            | 8 +++-----
> >  libavcodec/libx264.c | 4 ----
> >  2 files changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/configure b/configure
> > index f115b21064..e46d362b04 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 >= 118" && {
> > +                             "$toolchain" != msvc ||
> require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
> >  enabled libx265           && require_pkg_config libx265 x265 x265.h
> x265_api_get &&
> >                               require_cpp_condition libx265 x265.h
> "X265_BUILD >= 70"
> >  enabled libxavs           && require libxavs "stdint.h xavs.h"
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> 
> ./configure: 6663: ./configure: : Permission denied
> ERROR: X264_BUILD >= 158 not satisfied

Thanks! I installed x264 and could reproduce. 
Seems it need to go into square brackets:	

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

Seems to work in all cases. Does that make sense?


Thanks,
sw
 


_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
  2022-05-26  7:28       ` [FFmpeg-devel] [PATCH v5] " Matt Oliver
  2022-05-26 10:50         ` Michael Niedermayer
@ 2022-05-26 12:29         ` Matt Oliver
  2022-06-08 20:22           ` Marton Balint
  2022-06-09 23:27           ` [FFmpeg-devel] [PATCH v7] " Matt Oliver
  1 sibling, 2 replies; 19+ messages in thread
From: Matt Oliver @ 2022-05-26 12:29 UTC (permalink / raw)
  To: ffmpeg-devel
  Cc: Michael Niedermayer, softworkz, Matt Oliver, Andreas Rheinhardt

From: Matt Oliver <protogonoi@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@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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
    v4: add missing braces
    v5: fixed condition (again ;-)
    v6: hope I got it now..

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v6
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v6
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

Range-diff vs v5:

 1:  8c4fe7ffc2 ! 1:  47843fb51e libx264: Set min build version to 158
     @@ configure: enabled libvpx            && {
      -                             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 >= 118" && {
     -+                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
     ++                             [ "$toolchain" != "msvc" ] ||
     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
       enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"


 configure            | 9 ++++-----
 libavcodec/libx264.c | 4 ----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index f115b21064..d17361f37f 100755
--- a/configure
+++ b/configure
@@ -6656,11 +6656,10 @@ 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 >= 118" && {
+                             [ "$toolchain" != "msvc" ] ||
+                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
 enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
  2022-05-26 12:29         ` [FFmpeg-devel] [PATCH v6] " Matt Oliver
@ 2022-06-08 20:22           ` Marton Balint
  2022-06-08 22:50             ` Soft Works
  2022-06-09 23:27           ` [FFmpeg-devel] [PATCH v7] " Matt Oliver
  1 sibling, 1 reply; 19+ messages in thread
From: Marton Balint @ 2022-06-08 20:22 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Thu, 26 May 2022, Matt Oliver wrote:

> From: Matt Oliver <protogonoi@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@hotmail.com>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: Matt Oliver <protogonoi@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
>    v4: add missing braces
>    v5: fixed condition (again ;-)
>    v6: hope I got it now..
>
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v6
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v6
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
>
> Range-diff vs v5:
>
> 1:  8c4fe7ffc2 ! 1:  47843fb51e libx264: Set min build version to 158
>     @@ configure: enabled libvpx            && {
>      -                             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 >= 118" && {
>     -+                             "$toolchain" != msvc || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
>     ++                             [ "$toolchain" != "msvc" ] ||
>     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
>       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>       enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
>
>
> configure            | 9 ++++-----
> libavcodec/libx264.c | 4 ----
> 2 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/configure b/configure
> index f115b21064..d17361f37f 100755
> --- a/configure
> +++ b/configure
> @@ -6656,11 +6656,10 @@ 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"; } } &&

x264 without pkg-config feature got removed. If this is intentonal, 
then maybe you should mention this in the commit message?

> -                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
> -                             check_cpp_condition libx262 x264.h "X264_MPEG2"

Why is the x262 check got silently removed? This does not seem to belong 
to this commit.

Thanks,
Marton

> +enabled libx264           && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
> +                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
> +                             [ "$toolchain" != "msvc" ] ||
> +                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
> enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
> enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 4ce3791ae8..14177b3016 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -37,10 +37,6 @@
> #include "atsc_a53.h"
> #include "sei.h"
>
> -#if defined(_MSC_VER)
> -#define X264_API_IMPORTS 1
> -#endif
> -
> #include <x264.h>
> #include <float.h>
> #include <math.h>
>
> base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12
> -- 
> ffmpeg-codebot
> _______________________________________________
> 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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
  2022-06-08 20:22           ` Marton Balint
@ 2022-06-08 22:50             ` Soft Works
  2022-06-09 18:44               ` Marton Balint
  0 siblings, 1 reply; 19+ messages in thread
From: Soft Works @ 2022-06-08 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> Balint
> Sent: Wednesday, June 8, 2022 10:22 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
> 
> 
> 
> On Thu, 26 May 2022, Matt Oliver wrote:
> 
> > From: Matt Oliver <protogonoi@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@hotmail.com>
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > Signed-off-by: Matt Oliver <protogonoi@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
> >    v4: add missing braces
> >    v5: fixed condition (again ;-)
> >    v6: hope I got it now..
> >
> > Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-
> ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v6
> > Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-
> 30/softworkz/submit_x264_api_imports_matt-v6
> > Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
> >
> > Range-diff vs v5:
> >
> > 1:  8c4fe7ffc2 ! 1:  47843fb51e libx264: Set min build version to 158
> >     @@ configure: enabled libvpx            && {
> >      -                             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 >= 118" && {
> >     -+                             "$toolchain" != msvc ||
> require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
> >     ++                             [ "$toolchain" != "msvc" ] ||
> >     ++                             require_cpp_condition libx264 x264.h
> "X264_BUILD >= 158"; }
> >       enabled libx265           && require_pkg_config libx265 x265 x265.h
> x265_api_get &&
> >                                    require_cpp_condition libx265 x265.h
> "X265_BUILD >= 70"
> >       enabled libxavs           && require libxavs "stdint.h xavs.h"
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> >
> >
> > configure            | 9 ++++-----
> > libavcodec/libx264.c | 4 ----
> > 2 files changed, 4 insertions(+), 9 deletions(-)
> >
> > diff --git a/configure b/configure
> > index f115b21064..d17361f37f 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6656,11 +6656,10 @@ 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";
> } } &&
> 
> x264 without pkg-config feature got removed. If this is intentonal,
> then maybe you should mention this in the commit message?

I cannot honestly say that I would be sure about this part. Matt had
this removed in his original patch and objections were made about the version 
requirement, but none about the removal of the "non-pkg-config" condition.

Would there be any reasons to keep it?

> 
> > -                             require_cpp_condition libx264 x264.h
> "X264_BUILD >= 118" &&
> > -                             check_cpp_condition libx262 x264.h
> "X264_MPEG2"
> 
> Why is the x262 check got silently removed? This does not seem to belong
> to this commit.`

Matt had removed it and there was a comment about it saying that it 
would by dysfunctional for a long time already.

By a funny coincidence, Gyan has submitted a patch for complete removal
of this: 

https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220527082922.994-1-ffmpeg@gyani.pro/

Whether it belongs into this patch or not could be seen from two sides:

On one side, you could say that THIS patch is about updating and adapting
the x264 conditions to the state of time, but you could also say that 
it must rather be in Gyan's patch (which it is anyway).

Just let me know when you think I should change it.

PS: Thanks a lot for pushing the other patches!

Best wishes,
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
  2022-06-08 22:50             ` Soft Works
@ 2022-06-09 18:44               ` Marton Balint
  2022-06-09 19:19                 ` Soft Works
  0 siblings, 1 reply; 19+ messages in thread
From: Marton Balint @ 2022-06-09 18:44 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Wed, 8 Jun 2022, Soft Works wrote:

>>> -                               { require libx264 "stdint.h x264.h"
>> x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
>>> -                                 warn "using libx264 without pkg-config";
>> } } &&
>>
>> x264 without pkg-config feature got removed. If this is intentonal,
>> then maybe you should mention this in the commit message?
>
> I cannot honestly say that I would be sure about this part. Matt had
> this removed in his original patch and objections were made about the version
> requirement, but none about the removal of the "non-pkg-config" condition.
>
> Would there be any reasons to keep it?

Probably not. Removing it is fine by me, but the removal should be 
stated in the commit message.

>
>>
>>> -                             require_cpp_condition libx264 x264.h
>> "X264_BUILD >= 118" &&
>>> -                             check_cpp_condition libx262 x264.h
>> "X264_MPEG2"
>>
>> Why is the x262 check got silently removed? This does not seem to belong
>> to this commit.`
>
> Matt had removed it and there was a comment about it saying that it
> would by dysfunctional for a long time already.
>
> By a funny coincidence, Gyan has submitted a patch for complete removal
> of this:
>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220527082922.994-1-ffmpeg@gyani.pro/
>
> Whether it belongs into this patch or not could be seen from two sides:
>
> On one side, you could say that THIS patch is about updating and adapting
> the x264 conditions to the state of time, but you could also say that
> it must rather be in Gyan's patch (which it is anyway).
>
> Just let me know when you think I should change it.

I'd rather keep the X262 cpp check for now.

Thanks,
Marton
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
  2022-06-09 18:44               ` Marton Balint
@ 2022-06-09 19:19                 ` Soft Works
  0 siblings, 0 replies; 19+ messages in thread
From: Soft Works @ 2022-06-09 19:19 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> Balint
> Sent: Thursday, June 9, 2022 8:44 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v6] libx264: Set min build version to 158
> 
> 
> 
> On Wed, 8 Jun 2022, Soft Works wrote:
> 
> >>> -                               { require libx264 "stdint.h x264.h"
> >> x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
> >>> -                                 warn "using libx264 without pkg-
> config";
> >> } } &&
> >>
> >> x264 without pkg-config feature got removed. If this is intentonal,
> >> then maybe you should mention this in the commit message?
> >
> > I cannot honestly say that I would be sure about this part. Matt had
> > this removed in his original patch and objections were made about the
> version
> > requirement, but none about the removal of the "non-pkg-config" condition.
> >
> > Would there be any reasons to keep it?
> 
> Probably not. Removing it is fine by me, but the removal should be
> stated in the commit message.

Yup. Done.



> >>> -                             require_cpp_condition libx264 x264.h
> >> "X264_BUILD >= 118" &&
> >>> -                             check_cpp_condition libx262 x264.h
> >> "X264_MPEG2"
> >>
> >> Why is the x262 check got silently removed? This does not seem to belong
> >> to this commit.`
> >
> > Matt had removed it and there was a comment about it saying that it
> > would by dysfunctional for a long time already.
> >
> > By a funny coincidence, Gyan has submitted a patch for complete removal
> > of this:
> >
> > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220527082922.994-1-
> ffmpeg@gyani.pro/
> >
> > Whether it belongs into this patch or not could be seen from two sides:
> >
> > On one side, you could say that THIS patch is about updating and adapting
> > the x264 conditions to the state of time, but you could also say that
> > it must rather be in Gyan's patch (which it is anyway).
> >
> > Just let me know when you think I should change it.
> 
> I'd rather keep the X262 cpp check for now.

Ok agreed. The situation is not fully clear to me after re-reading Kieran's 
response to Gyan's patch.

Thanks,
sw 

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [FFmpeg-devel] [PATCH v7] libx264: Set min build version to 158
  2022-05-26 12:29         ` [FFmpeg-devel] [PATCH v6] " Matt Oliver
  2022-06-08 20:22           ` Marton Balint
@ 2022-06-09 23:27           ` Matt Oliver
  2022-06-11 12:20             ` Marton Balint
  1 sibling, 1 reply; 19+ messages in thread
From: Matt Oliver @ 2022-06-09 23:27 UTC (permalink / raw)
  To: ffmpeg-devel
  Cc: Michael Niedermayer, Matt Oliver, softworkz, Marton Balint,
	Andreas Rheinhardt

From: Matt Oliver <protogonoi@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 min version requirement of 158 is applied for msvc builds only.

This is also removing the check for 'libx264 without pkg-config'
which was left for compatibility reasons about 7 years ago when
the pkg-config check was introduced by commit
e06263ef1e0e172b2c76070b3dc739411af08e82.

Co-authored-by: softworkz <softworkz@hotmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Matt Oliver <protogonoi@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
    v4: add missing braces
    v5: fixed condition (again ;-)
    v6: hope I got it now..
    v7: add comment about dropping non-pkg-conf check, re-add libx262 check

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v7
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v7
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30

Range-diff vs v6:

 1:  47843fb51e ! 1:  3baec48834 libx264: Set min build version to 158
     @@ Commit message
          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.
     +    The min version requirement of 158 is applied for msvc builds only.
     +
     +    This is also removing the check for 'libx264 without pkg-config'
     +    which was left for compatibility reasons about 7 years ago when
     +    the pkg-config check was introduced by commit
     +    e06263ef1e0e172b2c76070b3dc739411af08e82.
      
          Co-authored-by: softworkz <softworkz@hotmail.com>
          Signed-off-by: softworkz <softworkz@hotmail.com>
     @@ configure: enabled libvpx            && {
      -                               { 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 >= 118" && {
      +                             [ "$toolchain" != "msvc" ] ||
     -+                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
     +                              check_cpp_condition libx262 x264.h "X264_MPEG2"
       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
     - enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
      
       ## libavcodec/libx264.c ##
      @@


 configure            | 8 ++++----
 libavcodec/libx264.c | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 5a167613a4..3dca1c4bd3 100755
--- a/configure
+++ b/configure
@@ -6658,10 +6658,10 @@ 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" &&
+enabled libx264           && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
+                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
+                             [ "$toolchain" != "msvc" ] ||
+                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
                              check_cpp_condition libx262 x264.h "X264_MPEG2"
 enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ce3791ae8..14177b3016 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -37,10 +37,6 @@
 #include "atsc_a53.h"
 #include "sei.h"
 
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
 #include <x264.h>
 #include <float.h>
 #include <math.h>

base-commit: 5d5a01419928d0c00bae54f730eede150cd5b268
-- 
ffmpeg-codebot
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [FFmpeg-devel] [PATCH v7] libx264: Set min build version to 158
  2022-06-09 23:27           ` [FFmpeg-devel] [PATCH v7] " Matt Oliver
@ 2022-06-11 12:20             ` Marton Balint
  0 siblings, 0 replies; 19+ messages in thread
From: Marton Balint @ 2022-06-11 12:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Thu, 9 Jun 2022, Matt Oliver wrote:

> From: Matt Oliver <protogonoi@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 min version requirement of 158 is applied for msvc builds only.
>
> This is also removing the check for 'libx264 without pkg-config'
> which was left for compatibility reasons about 7 years ago when
> the pkg-config check was introduced by commit
> e06263ef1e0e172b2c76070b3dc739411af08e82.
>
> Co-authored-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> Signed-off-by: Matt Oliver <protogonoi@gmail.com>

Thanks, applied.

Regards,
Marton

> ---
>    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
>    v4: add missing braces
>    v5: fixed condition (again ;-)
>    v6: hope I got it now..
>    v7: add comment about dropping non-pkg-conf check, re-add libx262 check
>
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v7
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v7
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30
>
> Range-diff vs v6:
>
> 1:  47843fb51e ! 1:  3baec48834 libx264: Set min build version to 158
>     @@ Commit message
>          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.
>     +    The min version requirement of 158 is applied for msvc builds only.
>     +
>     +    This is also removing the check for 'libx264 without pkg-config'
>     +    which was left for compatibility reasons about 7 years ago when
>     +    the pkg-config check was introduced by commit
>     +    e06263ef1e0e172b2c76070b3dc739411af08e82.
>
>          Co-authored-by: softworkz <softworkz@hotmail.com>
>          Signed-off-by: softworkz <softworkz@hotmail.com>
>     @@ configure: enabled libvpx            && {
>      -                               { 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 >= 118" && {
>      +                             [ "$toolchain" != "msvc" ] ||
>     -+                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; }
>     ++                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
>     +                              check_cpp_condition libx262 x264.h "X264_MPEG2"
>       enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                                    require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
>     - enabled libxavs           && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
>
>       ## libavcodec/libx264.c ##
>      @@
>
>
> configure            | 8 ++++----
> libavcodec/libx264.c | 4 ----
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/configure b/configure
> index 5a167613a4..3dca1c4bd3 100755
> --- a/configure
> +++ b/configure
> @@ -6658,10 +6658,10 @@ 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" &&
> +enabled libx264           && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
> +                             require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
> +                             [ "$toolchain" != "msvc" ] ||
> +                             require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
>                              check_cpp_condition libx262 x264.h "X264_MPEG2"
> enabled libx265           && require_pkg_config libx265 x265 x265.h x265_api_get &&
>                              require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 4ce3791ae8..14177b3016 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -37,10 +37,6 @@
> #include "atsc_a53.h"
> #include "sei.h"
>
> -#if defined(_MSC_VER)
> -#define X264_API_IMPORTS 1
> -#endif
> -
> #include <x264.h>
> #include <float.h>
> #include <math.h>
>
> base-commit: 5d5a01419928d0c00bae54f730eede150cd5b268
> -- 
> ffmpeg-codebot
> _______________________________________________
> 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".

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-06-11 12:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 23:11 [FFmpeg-devel] [PATCH] libx264: Set min build version to 158 Matt Oliver
2022-05-25  9:31 ` [FFmpeg-devel] [PATCH v2] " softworkz
2022-05-25  9:34   ` [FFmpeg-devel] [PATCH v3] " Matt Oliver
2022-05-25  9:38     ` Andreas Rheinhardt
2022-05-25  9:53       ` Soft Works
2022-05-25 11:05     ` [FFmpeg-devel] [PATCH v4] " Matt Oliver
2022-05-25 15:15       ` Michael Niedermayer
2022-05-25 22:53         ` Andreas Rheinhardt
2022-05-26  7:26           ` Soft Works
2022-05-26  7:28       ` [FFmpeg-devel] [PATCH v5] " Matt Oliver
2022-05-26 10:50         ` Michael Niedermayer
2022-05-26 11:20           ` Soft Works
2022-05-26 12:29         ` [FFmpeg-devel] [PATCH v6] " Matt Oliver
2022-06-08 20:22           ` Marton Balint
2022-06-08 22:50             ` Soft Works
2022-06-09 18:44               ` Marton Balint
2022-06-09 19:19                 ` Soft Works
2022-06-09 23:27           ` [FFmpeg-devel] [PATCH v7] " Matt Oliver
2022-06-11 12:20             ` Marton Balint

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git