mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 13:02:29 +00:00
v4l2transform: Handle caps changes
As this element is single threaded, we only need to stop the objects to allow changing the format again. Fixes assertion notably on shutdown and on some other situation where the format may be set twice without actually activating the element. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1991>
This commit is contained in:
parent
45b949fb24
commit
fc8e3814ab
1 changed files with 5 additions and 6 deletions
|
@ -212,12 +212,8 @@ gst_v4l2_transform_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO Add renegotiation support */
|
||||
g_return_val_if_fail (!GST_V4L2_IS_ACTIVE (self->v4l2output), FALSE);
|
||||
g_return_val_if_fail (!GST_V4L2_IS_ACTIVE (self->v4l2capture), FALSE);
|
||||
|
||||
gst_caps_replace (&self->incaps, incaps);
|
||||
gst_caps_replace (&self->outcaps, outcaps);
|
||||
gst_v4l2_object_stop (self->v4l2output);
|
||||
gst_v4l2_object_stop (self->v4l2capture);
|
||||
|
||||
if (!gst_v4l2_object_set_format (self->v4l2output, incaps, &error))
|
||||
goto incaps_failed;
|
||||
|
@ -225,6 +221,9 @@ gst_v4l2_transform_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|||
if (!gst_v4l2_object_set_format (self->v4l2capture, outcaps, &error))
|
||||
goto outcaps_failed;
|
||||
|
||||
gst_caps_replace (&self->incaps, incaps);
|
||||
gst_caps_replace (&self->outcaps, outcaps);
|
||||
|
||||
/* FIXME implement fallback if crop not supported */
|
||||
if (!gst_v4l2_object_set_crop (self->v4l2output))
|
||||
goto failed;
|
||||
|
|
Loading…
Reference in a new issue