History

lavc/libopenh264: Drop openh264 runtime version checks

With the way the runtime checks are currently set up, every single openh264 release, no matter how minor, is considered an ABI break and requires ffmpeg recompilation. This is unnecessarily strict because it doesn't allow downstream distributions to ship any openh264 bug fix version updates without breaking ffmpeg's openh264 support. Years ago, at the time when ffmpeg's openh264 support was merged, openh264 releases were done without a versioned soname (the library was just libopenh264.so, unversioned). Since then, starting with version 1.3.0, openh264 has started using versioned sonames and the intent has been to bump the soname every time there's a new release with an ABI change. This patch drops the exact version check and instead adds a minimum requirement on 1.3.0 to the configure script.

Kalev Lember committed 2 years ago

Commit b391fdb1 parent 25835e25 files · +1 −26Browse files

Unified · Split

5 files
  1. configure +1 −1
  2. libavcodec/libopenh264.c +0 −15
  3. libavcodec/libopenh264.h +0 −2
  4. libavcodec/libopenh264dec.c +0 −4
  5. libavcodec/libopenh264enc.c +0 −4
configure+1−1
@@ -6800,7 +6800,7 @@ enabled libopencv && { check_headers opencv2/core/core_c.h && · 6799 unmodified lines
68006800 { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
68016801 require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
68026802 require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
6803−enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
6803+enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
68046804 enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
68056805 { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
68066806 enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
libavcodec/libopenh264.c+0−15
@@ -46,18 +46,3 @@ void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg) · 45 unmodified lines
4646 int equiv_ffmpeg_log_level = libopenh264_to_ffmpeg_log_level(level);
4747 av_log(ctx, equiv_ffmpeg_log_level, "%s\n", msg);
4848 }
49−
50−int ff_libopenh264_check_version(void *logctx)
51−{
52− // Mingw GCC < 4.7 on x86_32 uses an incorrect/buggy ABI for the WelsGetCodecVersion
53− // function (for functions returning larger structs), thus skip the check in those
54− // configurations.
55−#if !defined(_WIN32) || !defined(__GNUC__) || !ARCH_X86_32 || AV_GCC_VERSION_AT_LEAST(4, 7)
56− OpenH264Version libver = WelsGetCodecVersion();
57− if (memcmp(&libver, &g_stCodecVersion, sizeof(libver))) {
58− av_log(logctx, AV_LOG_ERROR, "Incorrect library version loaded\n");
59− return AVERROR(EINVAL);
60− }
61−#endif
62− return 0;
63−}
libavcodec/libopenh264.h+0−2
@@ -34,6 +34,4 @@ · 33 unmodified lines
3434
3535 void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg);
3636
37−int ff_libopenh264_check_version(void *logctx);
38−
3937 #endif /* AVCODEC_LIBOPENH264_H */
libavcodec/libopenh264dec.c+0−4
@@ -52,13 +52,9 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) · 51 unmodified lines
5252 {
5353 SVCContext *s = avctx->priv_data;
5454 SDecodingParam param = { 0 };
55− int err;
5655 int log_level;
5756 WelsTraceCallback callback_function;
5857
59− if ((err = ff_libopenh264_check_version(avctx)) < 0)
60− return AVERROR_DECODER_NOT_FOUND;
61−
6258 if (WelsCreateDecoder(&s->decoder)) {
6359 av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
6460 return AVERROR_UNKNOWN;
libavcodec/libopenh264enc.c+0−4
@@ -110,14 +110,10 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) · 109 unmodified lines
110110 {
111111 SVCContext *s = avctx->priv_data;
112112 SEncParamExt param = { 0 };
113− int err;
114113 int log_level;
115114 WelsTraceCallback callback_function;
116115 AVCPBProperties *props;
117116
118− if ((err = ff_libopenh264_check_version(avctx)) < 0)
119− return AVERROR_ENCODER_NOT_FOUND;
120−
121117 if (WelsCreateSVCEncoder(&s->encoder)) {
122118 av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n");
123119 return AVERROR_UNKNOWN;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t