mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
uvcsink: use the pad's current caps to update caps_changed
The caps that were sent by the caps event can be retrieved from the sinkpad using gst_pad_get_current_caps(). This is more reliable than using cur_caps as we know exactly which caps upstream selected when the UVC host didn't select a format, yet. This further allows to simplify the check, if the uvcsink has to wait for the caps event before switching to the internal v4l2sink. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
This commit is contained in:
parent
733b4d9597
commit
c020dab393
1 changed files with 6 additions and 4 deletions
|
@ -611,8 +611,6 @@ gst_uvc_sink_task (gpointer data)
|
||||||
GstCaps *configured_caps;
|
GstCaps *configured_caps;
|
||||||
GstCaps *prev_caps;
|
GstCaps *prev_caps;
|
||||||
|
|
||||||
prev_caps = gst_caps_copy (self->cur_caps);
|
|
||||||
|
|
||||||
/* The configured caps are not sufficient for negotiation. Select caps
|
/* The configured caps are not sufficient for negotiation. Select caps
|
||||||
* from the probed caps that match the configured caps.
|
* from the probed caps that match the configured caps.
|
||||||
*/
|
*/
|
||||||
|
@ -625,8 +623,12 @@ gst_uvc_sink_task (gpointer data)
|
||||||
self->cur_caps);
|
self->cur_caps);
|
||||||
gst_caps_unref (configured_caps);
|
gst_caps_unref (configured_caps);
|
||||||
|
|
||||||
if (!gst_caps_is_equal (self->probed_caps, prev_caps))
|
prev_caps = gst_pad_get_current_caps (self->sinkpad);
|
||||||
self->caps_changed = !gst_caps_is_equal (self->cur_caps, prev_caps);
|
if (!gst_caps_is_subset (prev_caps, self->cur_caps)) {
|
||||||
|
self->caps_changed = TRUE;
|
||||||
|
GST_DEBUG_OBJECT (self,
|
||||||
|
"caps changed from %" GST_PTR_FORMAT, prev_caps);
|
||||||
|
}
|
||||||
gst_caps_unref (prev_caps);
|
gst_caps_unref (prev_caps);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue