openh264: Drop 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 gst-plugins-bad recompilation. This is unnecessarily strict
because it doesn't allow downstream distributions to ship any openh264
bug fix version updates without breaking gstreamer's openh264 support.

Years ago, at the time when gstreamer'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 strict version check. meson.build already has a
minimum requirement on openh264 version 1.3.0 where soname versioning
was added, which should be good enough to ensure that the library is
using soname versioning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5780>
This commit is contained in:
Kalev Lember 2023-12-06 14:58:38 +01:00 committed by GStreamer Marge Bot
parent 4f27b50c2e
commit 1dadccd48c
5 changed files with 4 additions and 61 deletions

View file

@ -459,10 +459,7 @@ openh264dec_element_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_openh264dec_debug_category, "openh264dec", 0,
"debug category for openh264dec element");
if (openh264_element_init (plugin))
return gst_element_register (plugin, "openh264dec", GST_RANK_MARGINAL,
GST_TYPE_OPENH264DEC);
GST_ERROR ("Incorrect library version loaded, expecting %s", g_strCodecVer);
return FALSE;
return gst_element_register (plugin, "openh264dec", GST_RANK_MARGINAL,
GST_TYPE_OPENH264DEC);
}

View file

@ -1,48 +0,0 @@
/*
* Copyright (c) 2014, Ericsson AB. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gst/gst.h>
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
#include <string.h>
#include "gstopenh264elements.h"
gboolean
openh264_element_init (GstPlugin * plugin)
{
OpenH264Version libver;
/* g_stCodecVersion is the version detected at build time as defined in the
* headers and WelsGetCodecVersion() is the version detected at runtime.
* This is a safeguard to avoid crashes since OpenH264 has been changing
* ABI without changing the SONAME.
*/
libver = WelsGetCodecVersion ();
return (memcmp (&libver, &g_stCodecVersion, sizeof (libver)) == 0);
}

View file

@ -27,8 +27,6 @@
G_BEGIN_DECLS
gboolean openh264_element_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (openh264dec);
GST_ELEMENT_REGISTER_DECLARE (openh264enc);

View file

@ -1066,10 +1066,7 @@ openh264enc_element_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_openh264enc_debug_category, "openh264enc", 0,
"debug category for openh264enc element");
if (openh264_element_init (plugin))
return gst_element_register (plugin, "openh264enc", GST_RANK_MARGINAL,
GST_TYPE_OPENH264ENC);
GST_ERROR ("Incorrect library version loaded, expecting %s", g_strCodecVer);
return FALSE;
return gst_element_register (plugin, "openh264enc", GST_RANK_MARGINAL,
GST_TYPE_OPENH264ENC);
}

View file

@ -1,7 +1,6 @@
openh264_sources = [
'gstopenh264dec.cpp',
'gstopenh264enc.cpp',
'gstopenh264element.c',
'gstopenh264plugin.c',
]