mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
glmixer: don't add rgba templates by default
Subclasses may want to override the pad template with different formats or with a different pad subclass. The original beahviour is still available by calling gst_gl_mixer_class_add_rgba_pad_templates() in _class_init() of the subclass. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
This commit is contained in:
parent
fc85b63c2b
commit
e9bf1c79cc
4 changed files with 26 additions and 6 deletions
|
@ -137,6 +137,7 @@ gst_gl_mosaic_class_init (GstGLMosaicClass * klass)
|
||||||
|
|
||||||
GST_GL_BASE_MIXER_CLASS (klass)->gl_stop = gst_gl_mosaic_gl_stop;
|
GST_GL_BASE_MIXER_CLASS (klass)->gl_stop = gst_gl_mosaic_gl_stop;
|
||||||
GST_GL_MIXER_CLASS (klass)->process_textures = gst_gl_mosaic_process_textures;
|
GST_GL_MIXER_CLASS (klass)->process_textures = gst_gl_mosaic_process_textures;
|
||||||
|
gst_gl_mixer_class_add_rgba_pad_templates (GST_GL_MIXER_CLASS (klass));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1303,6 +1303,7 @@ gst_gl_video_mixer_class_init (GstGLVideoMixerClass * klass)
|
||||||
"Filter/Effect/Video/Compositor", "OpenGL video_mixer",
|
"Filter/Effect/Video/Compositor", "OpenGL video_mixer",
|
||||||
"Matthew Waters <matthew@centricular.com>");
|
"Matthew Waters <matthew@centricular.com>");
|
||||||
|
|
||||||
|
gst_gl_mixer_class_add_rgba_pad_templates (GST_GL_MIXER_CLASS (klass));
|
||||||
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
||||||
&sink_factory, GST_TYPE_GL_VIDEO_MIXER_PAD);
|
&sink_factory, GST_TYPE_GL_VIDEO_MIXER_PAD);
|
||||||
|
|
||||||
|
|
|
@ -413,11 +413,31 @@ static void gst_gl_mixer_gl_stop (GstGLBaseMixer * mix);
|
||||||
|
|
||||||
static void gst_gl_mixer_finalize (GObject * object);
|
static void gst_gl_mixer_finalize (GObject * object);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_gl_mixer_class_add_rgba_pad_templates:
|
||||||
|
* @klass: the #GstGLMixerClass
|
||||||
|
*
|
||||||
|
* Adds the default RGBA pad templates to this class. If you have any special
|
||||||
|
* template requirements like a different pad subclass or different supported
|
||||||
|
* caps, you should not call this function and add the pad templates yourself
|
||||||
|
* manually.
|
||||||
|
*
|
||||||
|
* Since: 1.24
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_gl_mixer_class_add_rgba_pad_templates (GstGLMixerClass * klass)
|
||||||
|
{
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
||||||
|
&src_factory, GST_TYPE_AGGREGATOR_PAD);
|
||||||
|
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
||||||
|
&sink_factory, GST_TYPE_GL_MIXER_PAD);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_mixer_class_init (GstGLMixerClass * klass)
|
gst_gl_mixer_class_init (GstGLMixerClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = (GObjectClass *) klass;
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
||||||
GstVideoAggregatorClass *videoaggregator_class =
|
GstVideoAggregatorClass *videoaggregator_class =
|
||||||
(GstVideoAggregatorClass *) klass;
|
(GstVideoAggregatorClass *) klass;
|
||||||
GstAggregatorClass *agg_class = (GstAggregatorClass *) klass;
|
GstAggregatorClass *agg_class = (GstAggregatorClass *) klass;
|
||||||
|
@ -430,11 +450,6 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass)
|
||||||
gobject_class->get_property = gst_gl_mixer_get_property;
|
gobject_class->get_property = gst_gl_mixer_get_property;
|
||||||
gobject_class->set_property = gst_gl_mixer_set_property;
|
gobject_class->set_property = gst_gl_mixer_set_property;
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
|
||||||
&src_factory, GST_TYPE_AGGREGATOR_PAD);
|
|
||||||
gst_element_class_add_static_pad_template_with_gtype (element_class,
|
|
||||||
&sink_factory, GST_TYPE_GL_MIXER_PAD);
|
|
||||||
|
|
||||||
agg_class->sink_query = gst_gl_mixer_sink_query;
|
agg_class->sink_query = gst_gl_mixer_sink_query;
|
||||||
agg_class->src_query = gst_gl_mixer_src_query;
|
agg_class->src_query = gst_gl_mixer_src_query;
|
||||||
agg_class->stop = gst_gl_mixer_stop;
|
agg_class->stop = gst_gl_mixer_stop;
|
||||||
|
|
|
@ -101,6 +101,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLMixer, gst_object_unref);
|
||||||
GST_GL_API
|
GST_GL_API
|
||||||
GType gst_gl_mixer_get_type(void);
|
GType gst_gl_mixer_get_type(void);
|
||||||
|
|
||||||
|
GST_GL_API
|
||||||
|
void gst_gl_mixer_class_add_rgba_pad_templates (GstGLMixerClass * klass);
|
||||||
|
|
||||||
GST_GL_API
|
GST_GL_API
|
||||||
gboolean gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf);
|
gboolean gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue