summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 785adb8)
raw | patch | inline | side by side (parent: 785adb8)
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Tue, 28 Feb 2012 17:07:33 +0000 (18:07 +0100) | ||
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Tue, 28 Feb 2012 17:07:33 +0000 (18:07 +0100) |
Flush the codec when caps change. Needed for downstream sinks that provide a
buffer pool and need to destroy all the outstanding buffers before they can
negotiate new caps (hello v4l2sink).
buffer pool and need to destroy all the outstanding buffers before they can
negotiate new caps (hello v4l2sink).
src/gstducatividdec.c | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 1d403efd3cf31e85a2e955762f53c47ff097eb48..0ba4af36d61ee32bd34355932f719c576b32dc8e 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
GST_INFO_OBJECT (self, "outsize %d stride %d outcaps: %" GST_PTR_FORMAT,
self->outsize, self->stride, outcaps);
+ if (!self->first_in_buffer) {
+ /* Caps changed mid stream. We flush the codec to unlock all the potentially
+ * locked buffers. This is needed for downstream sinks that provide a
+ * buffer pool and need to destroy all the outstanding buffers before they
+ * can negotiate new caps (hello v4l2sink).
+ */
+ gst_ducati_viddec_codec_flush (self, FALSE);
+ }
+
/* (re)send a crop event when caps change */
self->send_crop_event = TRUE;