mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
Fixes to element/elementfactory creation
This commit is contained in:
parent
32d4d29706
commit
4966f68512
2 changed files with 13 additions and 6 deletions
|
@ -2329,11 +2329,12 @@ register_codecs (GstPlugin * plugin)
|
|||
gchar *type_name, *element_name;
|
||||
guint rank;
|
||||
|
||||
if (is_video && !codec_info->is_encoder)
|
||||
if (is_video && !codec_info->is_encoder) {
|
||||
type = gst_amc_video_dec_get_type ();
|
||||
else
|
||||
} else {
|
||||
GST_DEBUG ("Skipping unsupported codec type");
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
g_type_query (type, &type_query);
|
||||
memset (&type_info, 0, sizeof (type_info));
|
||||
|
@ -2351,7 +2352,7 @@ register_codecs (GstPlugin * plugin)
|
|||
subtype = g_type_register_static (type, type_name, &type_info, 0);
|
||||
g_free (type_name);
|
||||
|
||||
g_type_set_qdata (type, gst_amc_codec_info_quark, codec_info);
|
||||
g_type_set_qdata (subtype, gst_amc_codec_info_quark, codec_info);
|
||||
|
||||
element_name =
|
||||
create_element_name (is_video, codec_info->is_encoder,
|
||||
|
|
|
@ -303,6 +303,7 @@ gst_amc_video_dec_base_init (gpointer g_class)
|
|||
const GstAmcCodecInfo *codec_info;
|
||||
GstPadTemplate *templ;
|
||||
GstCaps *caps;
|
||||
gchar *longname;
|
||||
|
||||
codec_info =
|
||||
g_type_get_qdata (G_TYPE_FROM_CLASS (g_class), gst_amc_codec_info_quark);
|
||||
|
@ -315,15 +316,20 @@ gst_amc_video_dec_base_init (gpointer g_class)
|
|||
/* Add pad templates */
|
||||
caps = create_sink_caps (codec_info);
|
||||
templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps);
|
||||
gst_caps_unref (caps);
|
||||
gst_element_class_add_pad_template (element_class, templ);
|
||||
gst_object_unref (templ);
|
||||
|
||||
caps = create_src_caps (codec_info);
|
||||
templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps);
|
||||
gst_caps_unref (caps);
|
||||
gst_element_class_add_pad_template (element_class, templ);
|
||||
gst_object_unref (templ);
|
||||
|
||||
longname = g_strdup_printf ("Android MediaCodec %s", codec_info->name);
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
codec_info->name,
|
||||
"Codec/Decoder/Video",
|
||||
longname, "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
|
||||
g_free (longname);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue