summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 017e64d)
raw | patch | inline | side by side (parent: 017e64d)
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Fri, 20 Jan 2012 10:55:57 +0000 (11:55 +0100) | ||
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Fri, 20 Jan 2012 11:00:37 +0000 (12:00 +0100) |
We use the internal pool until we get the first output buffer, then we switch to
downstream provided buffers. Destroy the internal pool once we get the first
output buffer so that we release memory. The pool is then recreated when/if
needed.
downstream provided buffers. Destroy the internal pool once we get the first
output buffer so that we release memory. The pool is then recreated when/if
needed.
src/gstducatividdec.c | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 622c2f305ddec83ab6a4f3a6507d6bbb9bcc6262..e93a092ae91b0bd530aff2940fa420008867be3e 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
if (G_UNLIKELY (self->first_out_buffer) && send) {
gint crop_width, crop_height;
+ GstDucatiBufferPool *pool;
/* send region of interest to sink on first buffer: */
XDM_Rect *r = &(self->outArgs->displayBufs.bufDesc[0].activeFrameRegion);
crop_width, crop_height));
self->first_out_buffer = FALSE;
+
+ /* Destroy the pool so the buffers we used so far are eventually released.
+ * The pool will be recreated if needed.
+ */
+ pool = self->pool;
+ self->pool = NULL;
+ gst_ducati_bufferpool_destroy (pool);
}
if (send) {
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
- /* pass new output buffer as to the decoder to decode into: */
+ /* Pass new output buffer to the decoder to decode into. Use buffers from the
+ * internal pool while self->first_out_buffer == TRUE in order to simplify
+ * things in case we need to renegotiate */
self->inArgs->inputID = codec_prepare_outbuf (self, &outbuf, self->first_out_buffer);
if (!self->inArgs->inputID) {
GST_ERROR_OBJECT (self, "could not prepare output buffer");