Luma -> Alpha with v1.18

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jan 12 13:48:17 UTC 2022


Le mardi 11 janvier 2022 à 20:21 -0800, amindfv at mailbox.org a écrit :
> On Tue, Jan 11, 2022 at 01:51:47PM -0500, Nicolas Dufresne via gstreamer-devel wrote:
> > Indeed, all the GST_ELEMENT_REGISTER* macros are unreleased. Remove all calls to
> > GST_ELEMENT_REGISTER*, and use
> > 
> >   gst_element_register (plugin, "alphacombine", GST_RANK_NONE, GST_TYPE_ALPHA_COMBINE);
> > 
> > Inside the plugin_init function.
> 
> Thanks, the plugins are buiding cleanly now (finally!). I'm still running into an issue with registration, though:
>  
>     $ rm *.so && make
>     [... builds cleanly! ...]
>     $ GST_PLUGIN_PATH=$GST_PLUGIN_PATH:. gst-launch-1.0 videotestsrc ! alphacombine ! autovideosink
>     (gst-plugin-scanner:226263): GStreamer-WARNING **: 20:15:13.099: Failed to load plugin './libgstplugin.so': ./libgstplugin.so: undefined symbol: gst_alpha_combine_get_type

This is not entirely clear to me, but one things pops, the name of the plugin.
It should be named libgstcodecalpha.so, or libcodecalpha.so, this names is
extracted by the plugin loaded to assemble the name
	
	gst_plugin_<plugin-name>_get_desc()

>     WARNING: erroneous pipeline: no element "alphacombine"
>     $ nm -D --defined-only libgstplugin.so 
>     0000000000001150 T gst_plugin_codecalpha_get_desc
>     0000000000001160 T gst_plugin_codecalpha_register
>     $ nm -D --defined-only libgstalphacombine.so
>     0000000000006220 D format_map
>     0000000000002830 T gst_alpha_combine_get_type
> 
> Tom
> 
> Here's the Makefile:
> 
>     all: libgstplugin.so libgstalphacombine.so
>     %.o: %.c
>             gcc -I. -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -g -O2 -Wall -c $^ -fPIC -DPIC -o $@
>     lib%.so: %.o
>             gcc -shared  -fPIC -DPIC $^ -lgstcontroller-1.0 -lgstaudio-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0  -pthread -g -O2  -pthread -Wl,-soname -Wl,$@ -o $@
> 
> 
> And here's the current diff against current git HEAD:
> 
> diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c
> index aeefeb94f8..089b31ad93 100644
> --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c
> +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c
> @@ -46,10 +46,9 @@
>  
>  #include "gstalphacombine.h"
>  
> -
> -#define SUPPORTED_SINK_FORMATS "{ I420, NV12 }"
> -#define SUPPORTED_ALPHA_FORMATS "{ GRAY8, I420, NV12 }"
> -#define SUPPORTED_SRC_FORMATS "{ A420, AV12 }"
> +#define SUPPORTED_SINK_FORMATS "{ I420 }"
> +#define SUPPORTED_ALPHA_FORMATS "{ GRAY8, I420 }"
> +#define SUPPORTED_SRC_FORMATS "{ A420 }"
>  
>  /* *INDENT-OFF* */
>  struct {
> @@ -69,18 +68,6 @@ struct {
>      .sink = GST_VIDEO_FORMAT_I420,
>      .alpha = GST_VIDEO_FORMAT_NV12,
>      .src = GST_VIDEO_FORMAT_A420
> -  }, {
> -    .sink = GST_VIDEO_FORMAT_NV12,
> -    .alpha = GST_VIDEO_FORMAT_NV12,
> -    .src = GST_VIDEO_FORMAT_AV12,
> -  }, {
> -    .sink = GST_VIDEO_FORMAT_NV12,
> -    .alpha = GST_VIDEO_FORMAT_GRAY8,
> -    .src = GST_VIDEO_FORMAT_AV12
> - },{
> -    .sink = GST_VIDEO_FORMAT_NV12,
> -    .alpha = GST_VIDEO_FORMAT_I420,
> -    .src = GST_VIDEO_FORMAT_AV12
>    },
>  };
>  /* *INDENT-ON* */
> @@ -117,8 +104,7 @@ G_DEFINE_TYPE_WITH_CODE (GstAlphaCombine, gst_alpha_combine,
>      GST_DEBUG_CATEGORY_INIT (alphacombine_debug, "alphacombine", 0,
>          "Alpha Combiner"));
>  
> -GST_ELEMENT_REGISTER_DEFINE (alpha_combine, "alphacombine",
> -    GST_RANK_NONE, GST_TYPE_ALPHA_COMBINE);
> +// GST_ELEMENT_REGISTER_DEFINE (alpha_combine);
>  
>  static GstStaticPadTemplate gst_alpha_combine_sink_template =
>  GST_STATIC_PAD_TEMPLATE ("sink",
> diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.h b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.h
> index 423717861f..e101c41184 100644
> --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.h
> +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.h
> @@ -29,7 +29,7 @@ G_BEGIN_DECLS
>  G_DECLARE_FINAL_TYPE (GstAlphaCombine,
>      gst_alpha_combine, GST, ALPHA_COMBINE, GstElement);
>  
> -GST_ELEMENT_REGISTER_DECLARE (alpha_combine);
> +// GST_ELEMENT_REGISTER_DECLARE (alpha_combine);
>  
>  G_END_DECLS
>  #endif
> diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstplugin.c b/subprojects/gst-plugins-bad/gst/codecalpha/gstplugin.c
> index ff061c58f9..deece876cc 100644
> --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstplugin.c
> +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstplugin.c
> @@ -43,10 +43,7 @@
>  
>  #include <gst/gst.h>
>  
> -#include "gstcodecalphademux.h"
>  #include "gstalphacombine.h"
> -#include "gstvp8alphadecodebin.h"
> -#include "gstvp9alphadecodebin.h"
>  
>  /* When wrapping, use the original rank plus this offset. The ad-hoc rules is
>   * that hardware implementation will use PRIMARY+1 or +2 to override the
> @@ -59,18 +56,19 @@
>  static gboolean
>  plugin_init (GstPlugin * plugin)
>  {
> -  gboolean ret = FALSE;
> +  return gst_element_register (plugin, "alphacombine", GST_RANK_NONE, GST_TYPE_ALPHA_COMBINE);
> +}
>  
> -  ret |= GST_ELEMENT_REGISTER (codec_alpha_demux, plugin);
> -  ret |= GST_ELEMENT_REGISTER (alpha_combine, plugin);
> -  ret |= GST_ELEMENT_REGISTER (vp8_alpha_decode_bin, plugin);
> -  ret |= GST_ELEMENT_REGISTER (vp9_alpha_decode_bin, plugin);
> +#ifndef PACKAGE
> +#define PACKAGE "codecalpha"
> +#endif
>  
> -  return ret;
> -}
> +#ifndef GST_PACKAGE_NAME
> +#define GST_PACKAGE_NAME "codecalpha"
> +#endif
>  
>  GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
>      GST_VERSION_MINOR,
>      codecalpha,
>      "CODEC Alpha Utilities",
> -    plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
> +    plugin_init, "1.0.0", "LGPL", GST_PACKAGE_NAME, "http://gstreamer.net/")
> \ No newline at end of file
> 



More information about the gstreamer-devel mailing list