[0.11] gst-plugins-good: update for memory API

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 19 03:52:03 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: b22c0dd3f6babc0e139c065840cb05279faff282
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=b22c0dd3f6babc0e139c065840cb05279faff282

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan 19 12:44:39 2012 +0100

update for memory API

---

 ext/jpeg/gstjpegenc.c     |    6 +++---
 gst/udp/gstmultiudpsink.c |    6 +-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c
index 9250619..3057802 100644
--- a/ext/jpeg/gstjpegenc.c
+++ b/ext/jpeg/gstjpegenc.c
@@ -176,8 +176,7 @@ ensure_memory (GstJpegEnc * jpegenc)
   /* copy previous data if any */
   if (jpegenc->output_mem) {
     memcpy (new_data, jpegenc->output_data, old_size);
-    gst_memory_unmap (jpegenc->output_mem, jpegenc->output_data,
-        jpegenc->output_size);
+    gst_memory_unmap (jpegenc->output_mem);
     gst_memory_unref (jpegenc->output_mem);
   }
 
@@ -216,8 +215,9 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
   GstJpegEnc *jpegenc = (GstJpegEnc *) (cinfo->client_data);
   GST_DEBUG_OBJECT (jpegenc, "gst_jpegenc_chain: term_source");
 
+  gst_memory_unmap (jpegenc->output_mem);
   /* Trim the buffer size. we will push it in the chain function */
-  gst_memory_unmap (jpegenc->output_mem, jpegenc->output_data,
+  gst_memory_resize (jpegenc->output_mem, 0,
       jpegenc->output_size - jpegenc->jdest.free_in_buffer);
   jpegenc->output_data = NULL;
   jpegenc->output_size = 0;
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
index 96dfb02..8eef113 100644
--- a/gst/udp/gstmultiudpsink.c
+++ b/gst/udp/gstmultiudpsink.c
@@ -511,11 +511,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
   /* unmap all memory again */
   for (i = 0; i < n_mem; i++) {
     mem = gst_buffer_peek_memory (buffer, i, GST_MAP_READ);
-
-    bdata = (guint8 *) vec[i].buffer;
-    bsize = vec[i].size;
-
-    gst_memory_unmap (mem, bdata, bsize);
+    gst_memory_unmap (mem);
   }
   g_free (vec);
 



More information about the gstreamer-commits mailing list