plugins: proxy information from downstream caps

Propagate to upstream the downstream information, such as fps, par, etc.

This will fix several "getcaps" critical warnings in gst-validate.

https://bugzilla.gnome.org/show_bug.cgi?id=763300
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-03-08 10:47:56 +01:00
parent 1eabfad5c3
commit 548528c817
2 changed files with 12 additions and 34 deletions

View file

@ -1005,16 +1005,14 @@ static GstCaps *
gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
GstCaps *tmp, *caps = NULL;
GstCaps *result;
if (decode->allowed_caps)
goto bail;
/* if we haven't a display yet, return our pad's template caps */
if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)) {
caps = gst_pad_get_pad_template_caps (GST_VIDEO_DECODER_SINK_PAD (vdec));
if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))
goto bail;
}
/* if the allowed caps calculation fails, return an empty caps, so
* the auto-plug can try other decoder */
@ -1022,16 +1020,11 @@ gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
return gst_caps_new_empty ();
bail:
if (!caps)
caps = gst_caps_ref (decode->allowed_caps);
result = gst_video_decoder_proxy_getcaps (vdec, decode->allowed_caps, filter);
if (filter) {
tmp = caps;
caps = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (tmp);
}
GST_DEBUG_OBJECT (decode, "Returning sink caps %" GST_PTR_FORMAT, result);
return caps;
return result;
}
static gboolean

View file

@ -339,32 +339,17 @@ gst_vaapiencode_buffer_loop (GstVaapiEncode * encode)
gst_pad_pause_task (GST_VAAPI_PLUGIN_BASE_SRC_PAD (encode));
}
static GstCaps *
gst_vaapiencode_get_caps_impl (GstVideoEncoder * venc)
{
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (venc);
GstCaps *caps;
if (plugin->sinkpad_caps)
caps = gst_caps_ref (plugin->sinkpad_caps);
else {
caps = gst_pad_get_pad_template_caps (plugin->sinkpad);
}
return caps;
}
static GstCaps *
gst_vaapiencode_get_caps (GstVideoEncoder * venc, GstCaps * filter)
{
GstCaps *caps, *out_caps;
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (venc);
GstCaps *result;
out_caps = gst_vaapiencode_get_caps_impl (venc);
if (out_caps && filter) {
caps = gst_caps_intersect_full (out_caps, filter, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (out_caps);
out_caps = caps;
}
return out_caps;
result = gst_video_encoder_proxy_getcaps (venc, plugin->sinkpad_caps, filter);
GST_DEBUG_OBJECT (venc, "Returning sink caps %" GST_PTR_FORMAT, result);
return result;
}
static gboolean