From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E51EF47FFE for ; Fri, 8 Dec 2023 08:16:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1587568CFF7; Fri, 8 Dec 2023 10:15:59 +0200 (EET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8788A68CF34 for ; Fri, 8 Dec 2023 10:15:52 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702023351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DAGxAMOS0GjaJ24C1vBym+i3e8+KYzVwz+fwBmW9Ofs=; b=BklulpPx7ryjny+RXPGaWnCwBLSIEwQ3yhPYeZo570UD5NsQ1gV8XU86VGgVasD5EA46cb /4RveztsJiwhcxZ/lVHq4z61ksnFMFgU2fJGqrDmuRc+91z/DLAxE+vRfwOlOlIbbKPsyU 4GiztpOrE+zISBJKVjH7kkXxBUr+fW4= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537--HYzaQO0NhmZuTKiuyoQlw-1; Fri, 08 Dec 2023 03:15:48 -0500 X-MC-Unique: -HYzaQO0NhmZuTKiuyoQlw-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ca0ab9a5e6so13224761fa.3 for ; Fri, 08 Dec 2023 00:15:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702023346; x=1702628146; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DAGxAMOS0GjaJ24C1vBym+i3e8+KYzVwz+fwBmW9Ofs=; b=Z3rJjaqwhVpK+PcsUKISOEEANWOcJaTydKc+sl75Rm7IKXYbXA7QYJKy90qaTjbbT6 pZKOg004syvko6jpuJcevAT2sVZ1sW0wr8kgap2v02inAFnIX48L+vGnvAYcylB7CBUi oLAWckD9icBp528DsgTBbCpzivC+d4R17FQTB+8lgDGl4AolK+Sq0fYhuKohsbTIYxGj kOg06srihy+TyWvX21tDH821p2r7aH54tCtp6tKaGSazVxi5mppTYyEyHkP6EQwXfsAK N5dhYBMn+X5z8d9XRES1PM5225Guhhu5mzcF7YtWbS/LPIyo8E4YRUl+0F67poir3cDv noJg== X-Gm-Message-State: AOJu0YyKcZGhoAx7kQ0gMH8B3tqIDqg2nOtMeW+4mgvIoOz551ZMKvZJ g7/0FXK6DvxApwZXXqChiGJ2LNjl+68b9SueL/jWDtMX2tHe+HfaHAbeQas8hcBHCFNZiPYyUyk 0PJHKIB4/QqQ5fSg6fCcH0Rp0OQTUREq67+CI/nWdpLuSRhXVdB/3ibzKGUh0PQ7X5ZU6M2f//k ch X-Received: by 2002:a2e:9f10:0:b0:2c9:f67e:fba0 with SMTP id u16-20020a2e9f10000000b002c9f67efba0mr2187311ljk.37.1702023346498; Fri, 08 Dec 2023 00:15:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVIvnONM6YLfE6KXsVp7yqeUCPEf1fJnYZNlWxGj8VOWDjGemKPHId2Q/7OPuROwo6LzRUzw== X-Received: by 2002:a2e:9f10:0:b0:2c9:f67e:fba0 with SMTP id u16-20020a2e9f10000000b002c9f67efba0mr2187303ljk.37.1702023346127; Fri, 08 Dec 2023 00:15:46 -0800 (PST) Received: from collie.lan (c188-149-247-5.bredband.tele2.se. [188.149.247.5]) by smtp.gmail.com with ESMTPSA id j17-20020a2eb711000000b002c9fda71acesm154499ljo.127.2023.12.08.00.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 00:15:45 -0800 (PST) From: Kalev Lember To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Dec 2023 09:15:36 +0100 Message-ID: <20231208081536.14141-1-klember@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [FFmpeg-devel] [PATCH] lavc/libopenh264: Drop openh264 runtime version checks X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Kalev Lember Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Years ago, openh264 releases often changed their ABI without changing the library soname. To avoid running into ABI issues, a version check was added to lavc libopenh264 code to error out at runtime in case the build time and runtime openh264 versions don't match. This should no longer be an issue with newer openh264 releases and we can drop the runtime version check and rely on upstream doing the right thing and bump the library soname if the ABI changes, similar to how other libraries are consumed in ffmpeg. Almost all major distributions now include openh264 and this means there are more eyes on ABI changes and issues are discovered and reported quickly. See e.g. https://github.com/cisco/openh264/issues/3564 where an ABI issue was quickly discovered and fixed. Relaxing the check allows downstream distributions to build ffmpeg against e.g. openh264 2.3.1 and ship an update to ABI-compatible openh264 2.4.0, without needing to coordinate a lock step update between ffmpeg and openh264 (which can be difficult if openh264 is distributed by Cisco and ffmpeg comes from the distro, such as is the case for Fedora). Signed-off-by: Kalev Lember --- libavcodec/libopenh264.c | 15 --------------- libavcodec/libopenh264.h | 2 -- libavcodec/libopenh264dec.c | 4 ---- libavcodec/libopenh264enc.c | 4 ---- 4 files changed, 25 deletions(-) diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c index 0f6d28ed88..c80c85ea8b 100644 --- a/libavcodec/libopenh264.c +++ b/libavcodec/libopenh264.c @@ -46,18 +46,3 @@ void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg) int equiv_ffmpeg_log_level = libopenh264_to_ffmpeg_log_level(level); av_log(ctx, equiv_ffmpeg_log_level, "%s\n", msg); } - -int ff_libopenh264_check_version(void *logctx) -{ - // Mingw GCC < 4.7 on x86_32 uses an incorrect/buggy ABI for the WelsGetCodecVersion - // function (for functions returning larger structs), thus skip the check in those - // configurations. -#if !defined(_WIN32) || !defined(__GNUC__) || !ARCH_X86_32 || AV_GCC_VERSION_AT_LEAST(4, 7) - OpenH264Version libver = WelsGetCodecVersion(); - if (memcmp(&libver, &g_stCodecVersion, sizeof(libver))) { - av_log(logctx, AV_LOG_ERROR, "Incorrect library version loaded\n"); - return AVERROR(EINVAL); - } -#endif - return 0; -} diff --git a/libavcodec/libopenh264.h b/libavcodec/libopenh264.h index dbb9c5d429..0b462d6fdc 100644 --- a/libavcodec/libopenh264.h +++ b/libavcodec/libopenh264.h @@ -34,6 +34,4 @@ void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg); -int ff_libopenh264_check_version(void *logctx); - #endif /* AVCODEC_LIBOPENH264_H */ diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index 7d650ae03e..b6a9bba2dc 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -52,13 +52,9 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) { SVCContext *s = avctx->priv_data; SDecodingParam param = { 0 }; - int err; int log_level; WelsTraceCallback callback_function; - if ((err = ff_libopenh264_check_version(avctx)) < 0) - return AVERROR_DECODER_NOT_FOUND; - if (WelsCreateDecoder(&s->decoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); return AVERROR_UNKNOWN; diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index f518d0894e..6f231d22b2 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -110,14 +110,10 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) { SVCContext *s = avctx->priv_data; SEncParamExt param = { 0 }; - int err; int log_level; WelsTraceCallback callback_function; AVCPBProperties *props; - if ((err = ff_libopenh264_check_version(avctx)) < 0) - return AVERROR_ENCODER_NOT_FOUND; - if (WelsCreateSVCEncoder(&s->encoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n"); return AVERROR_UNKNOWN; -- 2.43.0 _______________________________________________ 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".