mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
v4l2transform: Check if caps have changes before asserting
In set_caps, now checks if caps actually changed and succeed if they didn't change.
This commit is contained in:
parent
a89986ebd5
commit
026f79b5bd
2 changed files with 18 additions and 1 deletions
|
@ -188,7 +188,9 @@ gst_v4l2_transform_stop (GstBaseTransform * trans)
|
||||||
gst_v4l2_object_close (self->v4l2output);
|
gst_v4l2_object_close (self->v4l2output);
|
||||||
gst_v4l2_object_close (self->v4l2capture);
|
gst_v4l2_object_close (self->v4l2capture);
|
||||||
gst_caps_replace (&self->probed_srccaps, NULL);
|
gst_caps_replace (&self->probed_srccaps, NULL);
|
||||||
gst_caps_replace (&self->probed_sinkcaps, NULL);
|
gst_caps_replace (&self->probed_srccaps, NULL);
|
||||||
|
gst_caps_replace (&self->incaps, NULL);
|
||||||
|
gst_caps_replace (&self->outcaps, NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -199,10 +201,21 @@ gst_v4l2_transform_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
||||||
{
|
{
|
||||||
GstV4l2Transform *self = GST_V4L2_TRANSFORM (trans);
|
GstV4l2Transform *self = GST_V4L2_TRANSFORM (trans);
|
||||||
|
|
||||||
|
if (self->incaps && self->outcaps) {
|
||||||
|
if (gst_caps_is_equal (incaps, self->incaps) &&
|
||||||
|
gst_caps_is_equal (outcaps, self->outcaps)) {
|
||||||
|
GST_DEBUG_OBJECT (trans, "Caps did not changed");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO Add renegotiation support */
|
/* 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->v4l2output), FALSE);
|
||||||
g_return_val_if_fail (!GST_V4L2_IS_ACTIVE (self->v4l2capture), 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);
|
||||||
|
|
||||||
if (!gst_v4l2_object_set_format (self->v4l2output, incaps))
|
if (!gst_v4l2_object_set_format (self->v4l2output, incaps))
|
||||||
goto incaps_failed;
|
goto incaps_failed;
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,10 @@ struct _GstV4l2Transform
|
||||||
/* pads */
|
/* pads */
|
||||||
GstCaps *probed_srccaps;
|
GstCaps *probed_srccaps;
|
||||||
GstCaps *probed_sinkcaps;
|
GstCaps *probed_sinkcaps;
|
||||||
|
|
||||||
|
/* Selected caps */
|
||||||
|
GstCaps *incaps;
|
||||||
|
GstCaps *outcaps;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstV4l2TransformClass
|
struct _GstV4l2TransformClass
|
||||||
|
|
Loading…
Reference in a new issue