From 55daedf514175949d0343123f15fe2d45b0fa4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 7 Jun 2016 16:28:07 +0200 Subject: [PATCH] vaapidecode: split all the codecs Split the vaapidecode to all the supported codecs with the format vaapi{codec}dec. vaapidecode is stil registered as a GObject type, but not as a GStreamer feature, so it can be used internally by vaapidecodebin without changing its code too much. https://bugzilla.gnome.org/show_bug.cgi?id=734093 --- gst/vaapi/gstvaapidecode.c | 25 ++++++++++++++++++++++++- gst/vaapi/gstvaapidecodebin.c | 13 +++---------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 5ed1c38fe4..3d6ceae941 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -154,6 +154,25 @@ struct _GstVaapiDecoderMap static const GstVaapiDecoderMap vaapi_decode_map[] = { #if USE_JPEG_DECODER {GST_VAAPI_CODEC_JPEG, GST_RANK_MARGINAL, "jpeg", "image/jpeg"}, +#endif + {GST_VAAPI_CODEC_MPEG2, GST_RANK_PRIMARY, "mpeg2", + "video/mpeg, mpegversion=2, systemstream=(boolean)false"}, + {GST_VAAPI_CODEC_MPEG4, GST_RANK_PRIMARY, "mpeg4", + "video/mpeg, mpegversion=4"}, + {GST_VAAPI_CODEC_H263, GST_RANK_PRIMARY, "h263", "video/x-h263"}, + {GST_VAAPI_CODEC_H264, GST_RANK_PRIMARY, "h264", "video/x-h264"}, + {GST_VAAPI_CODEC_WMV3, GST_RANK_PRIMARY, "wmv3", + "video/x-wmv, wmvversion=3, format=WMV3"}, + {GST_VAAPI_CODEC_VC1, GST_RANK_PRIMARY, "vc1", + "video/x-wmv, wmvversion=3, format={WVC1,WMVA}"}, +#if USE_VP8_DECODER + {GST_VAAPI_CODEC_VP8, GST_RANK_PRIMARY, "vp8", "video/x-vp8"}, +#endif +#if USE_VP9_DECODER + {GST_VAAPI_CODEC_VP9, GST_RANK_PRIMARY, "vp9", "video/x-vp9"}, +#endif +#if USE_HEVC_DECODER + {GST_VAAPI_CODEC_H265, GST_RANK_PRIMARY, "h265", "video/x-h265"}, #endif {0 /* the rest */ , GST_RANK_PRIMARY + 1, NULL, gst_vaapidecode_sink_caps_str}, @@ -1393,7 +1412,11 @@ gst_vaapidecode_register (GstPlugin * plugin) (gpointer) & vaapi_decode_map[i]); } - ret |= gst_element_register (plugin, element_name, rank, type); + /* Register GstVaapiDecode as GObject type, but not in GStreamer, so + * vaapidecodebin can use it internally, but no exposed as a plugin + * feature */ + if (codec) + ret |= gst_element_register (plugin, element_name, rank, type); g_free (element_name); g_free (type_name); diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 9e20727c01..1b1aead9cb 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -281,16 +281,9 @@ gst_vaapi_decode_bin_configure (GstVaapiDecodeBin * vaapidecbin) GstPad *pad, *ghostpad; /* create the decoder */ - /* @FIXME: "vaapidecode" is going to be removed soon: (bug - * #734093). Instead there are going to be a set of elements - * "vaapi{codec}dec". We will need a mechanism to automatically - * select de correct decoder based on caps. - */ - vaapidecbin->decoder = gst_element_factory_make ("vaapidecode", NULL); - if (!vaapidecbin->decoder) { - missing_factory = "vaapidecode"; - goto error_element_missing; - } + vaapidecbin->decoder = + g_object_new (g_type_from_name ("GstVaapiDecode"), NULL); + /* create the queue */ vaapidecbin->queue = gst_element_factory_make ("queue", NULL); if (!vaapidecbin->queue) {