mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
vaapidecode: register decoder with internal GType
Don't expose the the vaapidecode GType, instead expose a function which will register element. This is the first step to split the decoder by codecs. https://bugzilla.gnome.org/show_bug.cgi?id=734093
This commit is contained in:
parent
8aa880786d
commit
96ac9bee8e
3 changed files with 37 additions and 15 deletions
|
@ -53,8 +53,8 @@
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
gst_element_register (plugin, "vaapidecode",
|
gst_vaapidecode_register (plugin);
|
||||||
GST_RANK_PRIMARY + 1, GST_TYPE_VAAPIDECODE);
|
|
||||||
gst_element_register (plugin, "vaapipostproc",
|
gst_element_register (plugin, "vaapipostproc",
|
||||||
GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC);
|
GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC);
|
||||||
gst_element_register (plugin, "vaapisink",
|
gst_element_register (plugin, "vaapisink",
|
||||||
|
|
|
@ -120,14 +120,10 @@ static GstStaticPadTemplate gst_vaapidecode_src_factory =
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS(gst_vaapidecode_src_caps_str));
|
GST_STATIC_CAPS(gst_vaapidecode_src_caps_str));
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE(
|
|
||||||
GstVaapiDecode,
|
|
||||||
gst_vaapidecode,
|
|
||||||
GST_TYPE_VIDEO_DECODER,
|
|
||||||
GST_VAAPI_PLUGIN_BASE_INIT_INTERFACES)
|
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
static GstElementClass *parent_class = NULL;
|
||||||
|
|
||||||
static gboolean gst_vaapidecode_update_sink_caps (GstVaapiDecode * decode,
|
static gboolean gst_vaapidecode_update_sink_caps (GstVaapiDecode * decode,
|
||||||
GstCaps * caps);
|
GstCaps * caps);
|
||||||
static gboolean gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode,
|
static gboolean gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode,
|
||||||
|
@ -815,7 +811,7 @@ gst_vaapidecode_finalize (GObject * object)
|
||||||
g_mutex_clear (&decode->surface_ready_mutex);
|
g_mutex_clear (&decode->surface_ready_mutex);
|
||||||
|
|
||||||
gst_vaapi_plugin_base_finalize (GST_VAAPI_PLUGIN_BASE (object));
|
gst_vaapi_plugin_base_finalize (GST_VAAPI_PLUGIN_BASE (object));
|
||||||
G_OBJECT_CLASS (gst_vaapidecode_parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -1036,8 +1032,7 @@ gst_vaapidecode_sink_query (GstVideoDecoder * vdec, GstQuery * query)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->sink_query
|
ret = GST_VIDEO_DECODER_CLASS (parent_class)->sink_query (vdec, query);
|
||||||
(vdec, query);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1075,8 +1070,7 @@ gst_vaapidecode_src_query (GstVideoDecoder * vdec, GstQuery * query)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->src_query
|
ret = GST_VIDEO_DECODER_CLASS (parent_class)->src_query (vdec, query);
|
||||||
(vdec, query);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1095,6 +1089,8 @@ gst_vaapidecode_class_init (GstVaapiDecodeClass * klass)
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_vaapidecode,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_vaapidecode,
|
||||||
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
|
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
|
||||||
|
|
||||||
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
gst_vaapi_plugin_base_class_init (GST_VAAPI_PLUGIN_BASE_CLASS (klass));
|
gst_vaapi_plugin_base_class_init (GST_VAAPI_PLUGIN_BASE_CLASS (klass));
|
||||||
|
|
||||||
object_class->finalize = gst_vaapidecode_finalize;
|
object_class->finalize = gst_vaapidecode_finalize;
|
||||||
|
@ -1147,3 +1143,30 @@ gst_vaapidecode_init (GstVaapiDecode * decode)
|
||||||
|
|
||||||
gst_video_decoder_set_packetized (vdec, FALSE);
|
gst_video_decoder_set_packetized (vdec, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_vaapidecode_register (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
GType type;
|
||||||
|
GTypeInfo typeinfo = {
|
||||||
|
sizeof (GstVaapiDecodeClass),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
(GClassInitFunc) gst_vaapidecode_class_init,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
sizeof (GstVaapiDecode),
|
||||||
|
0,
|
||||||
|
(GInstanceInitFunc) gst_vaapidecode_init,
|
||||||
|
};
|
||||||
|
|
||||||
|
type = g_type_from_name ("GstVaapiDecode");
|
||||||
|
if (!type) {
|
||||||
|
type = g_type_register_static (GST_TYPE_VIDEO_DECODER, "GstVaapiDecode",
|
||||||
|
&typeinfo, 0);
|
||||||
|
gst_vaapi_plugin_base_init_interfaces (type);
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
gst_element_register (plugin, "vaapidecode", GST_RANK_PRIMARY + 1, type);
|
||||||
|
}
|
||||||
|
|
|
@ -81,8 +81,7 @@ struct _GstVaapiDecodeClass {
|
||||||
GstVaapiPluginBaseClass parent_class;
|
GstVaapiPluginBaseClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType
|
gboolean gst_vaapidecode_register (GstPlugin * plugin);
|
||||||
gst_vaapidecode_get_type(void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue