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
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-06-07 16:28:07 +02:00
parent ca0c3fd627
commit 55daedf514
2 changed files with 27 additions and 11 deletions

View file

@ -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);

View file

@ -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) {