mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
plugins: first validate the out caps
When calling _set_caps() first validate the out caps before doing anything else.
This commit is contained in:
parent
f09d9ff2ab
commit
ec364858b1
1 changed files with 4 additions and 4 deletions
|
@ -740,19 +740,19 @@ gst_vaapi_plugin_base_set_caps (GstVaapiPluginBase * plugin, GstCaps * incaps,
|
||||||
GstCaps * outcaps)
|
GstCaps * outcaps)
|
||||||
{
|
{
|
||||||
if (incaps && incaps != plugin->sinkpad_caps) {
|
if (incaps && incaps != plugin->sinkpad_caps) {
|
||||||
g_clear_object (&plugin->sinkpad_allocator);
|
|
||||||
gst_caps_replace (&plugin->sinkpad_caps, incaps);
|
|
||||||
if (!gst_video_info_from_caps (&plugin->sinkpad_info, incaps))
|
if (!gst_video_info_from_caps (&plugin->sinkpad_info, incaps))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
g_clear_object (&plugin->sinkpad_allocator);
|
||||||
|
gst_caps_replace (&plugin->sinkpad_caps, incaps);
|
||||||
plugin->sinkpad_caps_is_raw = !gst_caps_has_vaapi_surface (incaps);
|
plugin->sinkpad_caps_is_raw = !gst_caps_has_vaapi_surface (incaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outcaps && outcaps != plugin->srcpad_caps) {
|
if (outcaps && outcaps != plugin->srcpad_caps) {
|
||||||
|
if (!gst_video_info_from_caps (&plugin->srcpad_info, outcaps))
|
||||||
|
return FALSE;
|
||||||
g_clear_object (&plugin->srcpad_allocator);
|
g_clear_object (&plugin->srcpad_allocator);
|
||||||
gst_caps_replace (&plugin->srcpad_caps, outcaps);
|
gst_caps_replace (&plugin->srcpad_caps, outcaps);
|
||||||
plugin_reset_texture_map (plugin);
|
plugin_reset_texture_map (plugin);
|
||||||
if (!gst_video_info_from_caps (&plugin->srcpad_info, outcaps))
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ensure_sinkpad_buffer_pool (plugin, plugin->sinkpad_caps))
|
if (!ensure_sinkpad_buffer_pool (plugin, plugin->sinkpad_caps))
|
||||||
|
|
Loading…
Reference in a new issue