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
@ 2021-12-29  6:16 Matt Oliver
  2021-12-29 12:37 ` Michael Niedermayer
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Oliver @ 2021-12-29  6:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 2590 bytes --]

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.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
---
 configure            | 8 +++-----
 libavcodec/libx264.c | 4 ----
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ede8f9777b..b35728aace 100755
--- a/configure
+++ b/configure
@@ -6535,11 +6535,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 21f434d06d..efbc9608c7 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -34,10 +34,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>
--

[-- Attachment #2: 0001-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch --]
[-- Type: application/octet-stream, Size: 2763 bytes --]

[-- Attachment #3: 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] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libx264: Set min build version to 158
  2021-12-29  6:16 [FFmpeg-devel] [PATCH] libx264: Set min build version to 158 Matt Oliver
@ 2021-12-29 12:37 ` Michael Niedermayer
  2021-12-30  1:45   ` Matt Oliver
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Niedermayer @ 2021-12-29 12:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


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

On Wed, Dec 29, 2021 at 05:16:25PM +1100, Matt Oliver wrote:
> 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.
> 
> Signed-off-by: Matt Oliver <protogonoi@gmail.com>
> ---
>  configure            | 8 +++-----
>  libavcodec/libx264.c | 4 ----
>  2 files changed, 3 insertions(+), 9 deletions(-)

I think this would effectivly drop ubuntu LTS support which seem to
ship older versions

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If the United States is serious about tackling the national security threats 
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier

[-- 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] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libx264: Set min build version to 158
  2021-12-29 12:37 ` Michael Niedermayer
@ 2021-12-30  1:45   ` Matt Oliver
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Oliver @ 2021-12-30  1:45 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Wed, 29 Dec 2021 at 23:37, Michael Niedermayer <michael@niedermayer.cc>
wrote:

> On Wed, Dec 29, 2021 at 05:16:25PM +1100, Matt Oliver wrote:
> > 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.
> >
> > Signed-off-by: Matt Oliver <protogonoi@gmail.com>
> > ---
> >  configure            | 8 +++-----
> >  libavcodec/libx264.c | 4 ----
> >  2 files changed, 3 insertions(+), 9 deletions(-)
>
> I think this would effectivly drop ubuntu LTS support which seem to
> ship older versions
>
> thx
>

As I mentioned in the patch comments, if dropping pre 158 is not suitable
then some changes to configure could be made to fallback to old behaviour
but I'm not familiar enough with configure to do it. The configure check
would then need to be updated to do a pkg_config check if build 158 or
newer and if not then fallback to setting X264_API_IMPORTS on the command
line. This fallback still wouldnt allow static linking with msvc but that
is the current behaviour so it's not changing anything there. So some help
on what the correct configure changes should be would be appreciated.
_______________________________________________
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] 4+ messages in thread

* [FFmpeg-devel] [PATCH] libx264: Set min build version to 158
@ 2022-05-20 23:11 Matt Oliver
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29  6:16 [FFmpeg-devel] [PATCH] libx264: Set min build version to 158 Matt Oliver
2021-12-29 12:37 ` Michael Niedermayer
2021-12-30  1:45   ` Matt Oliver
2022-05-20 23:11 Matt Oliver

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