mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-16 11:28:36 +00:00
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:
parent
1eabfad5c3
commit
548528c817
|
@ -1005,16 +1005,14 @@ static GstCaps *
|
||||||
gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
|
gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
|
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
|
||||||
GstCaps *tmp, *caps = NULL;
|
GstCaps *result;
|
||||||
|
|
||||||
if (decode->allowed_caps)
|
if (decode->allowed_caps)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
/* if we haven't a display yet, return our pad's template caps */
|
/* if we haven't a display yet, return our pad's template caps */
|
||||||
if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)) {
|
if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))
|
||||||
caps = gst_pad_get_pad_template_caps (GST_VIDEO_DECODER_SINK_PAD (vdec));
|
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
|
||||||
|
|
||||||
/* if the allowed caps calculation fails, return an empty caps, so
|
/* if the allowed caps calculation fails, return an empty caps, so
|
||||||
* the auto-plug can try other decoder */
|
* the auto-plug can try other decoder */
|
||||||
|
@ -1022,16 +1020,11 @@ gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
|
||||||
return gst_caps_new_empty ();
|
return gst_caps_new_empty ();
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
if (!caps)
|
result = gst_video_decoder_proxy_getcaps (vdec, decode->allowed_caps, filter);
|
||||||
caps = gst_caps_ref (decode->allowed_caps);
|
|
||||||
|
|
||||||
if (filter) {
|
GST_DEBUG_OBJECT (decode, "Returning sink caps %" GST_PTR_FORMAT, result);
|
||||||
tmp = caps;
|
|
||||||
caps = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
|
|
||||||
gst_caps_unref (tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return caps;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -339,32 +339,17 @@ gst_vaapiencode_buffer_loop (GstVaapiEncode * encode)
|
||||||
gst_pad_pause_task (GST_VAAPI_PLUGIN_BASE_SRC_PAD (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 *
|
static GstCaps *
|
||||||
gst_vaapiencode_get_caps (GstVideoEncoder * venc, GstCaps * filter)
|
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);
|
result = gst_video_encoder_proxy_getcaps (venc, plugin->sinkpad_caps, filter);
|
||||||
if (out_caps && filter) {
|
|
||||||
caps = gst_caps_intersect_full (out_caps, filter, GST_CAPS_INTERSECT_FIRST);
|
GST_DEBUG_OBJECT (venc, "Returning sink caps %" GST_PTR_FORMAT, result);
|
||||||
gst_caps_unref (out_caps);
|
|
||||||
out_caps = caps;
|
return result;
|
||||||
}
|
|
||||||
return out_caps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue