[0.11] gst-plugins-base: Update for memory API changes

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


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

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan 19 09:17:07 2012 +0100

Update for memory API changes

---

 gst-libs/gst/rtp/gstrtpbuffer.c   |    2 +-
 gst-libs/gst/video/gstvideometa.c |    9 +++------
 gst-libs/gst/video/gstvideometa.h |    4 ++--
 gst-libs/gst/video/video.c        |    2 +-
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c
index 6604900..724c2d3 100644
--- a/gst-libs/gst/rtp/gstrtpbuffer.c
+++ b/gst-libs/gst/rtp/gstrtpbuffer.c
@@ -124,7 +124,7 @@ gst_rtp_buffer_allocate_data (GstBuffer * buffer, guint payload_len,
   GST_RTP_HEADER_SEQ (data) = 0;
   GST_RTP_HEADER_TIMESTAMP (data) = 0;
   GST_RTP_HEADER_SSRC (data) = 0;
-  gst_memory_unmap (mem, data, len);
+  gst_memory_unmap (mem);
 
   gst_buffer_take_memory (buffer, -1, mem);
 }
diff --git a/gst-libs/gst/video/gstvideometa.c b/gst-libs/gst/video/gstvideometa.c
index 6ce4d0d..5e90c5e 100644
--- a/gst-libs/gst/video/gstvideometa.c
+++ b/gst-libs/gst/video/gstvideometa.c
@@ -235,19 +235,17 @@ gst_video_meta_map (GstVideoMeta * meta, guint plane, gint * stride,
  * gst_video_meta_unmap:
  * @meta: a #GstVideoMeta
  * @plane: a plane
- * @data: the data to unmap
  *
- * Unmap previously mapped data with gst_video_meta_map().
+ * Unmap a previously mapped plane with gst_video_meta_map().
  *
  * Returns: TRUE if the memory was successfully unmapped.
  */
 gboolean
-gst_video_meta_unmap (GstVideoMeta * meta, guint plane, gpointer data)
+gst_video_meta_unmap (GstVideoMeta * meta, guint plane)
 {
   guint offset;
   GstBuffer *buffer;
   GstMemory *mem;
-  guint8 *base;
 
   g_return_val_if_fail (meta != NULL, FALSE);
   g_return_val_if_fail (plane < meta->n_planes, FALSE);
@@ -257,9 +255,8 @@ gst_video_meta_unmap (GstVideoMeta * meta, guint plane, gpointer data)
 
   offset = meta->offset[plane];
   mem = find_mem_for_offset (buffer, &offset, GST_MAP_READ);
-  base = data;
 
-  gst_memory_unmap (mem, base - offset, -1);
+  gst_memory_unmap (mem);
 
   return TRUE;
 }
diff --git a/gst-libs/gst/video/gstvideometa.h b/gst-libs/gst/video/gstvideometa.h
index b68b979..d9b9a0f 100644
--- a/gst-libs/gst/video/gstvideometa.h
+++ b/gst-libs/gst/video/gstvideometa.h
@@ -68,7 +68,7 @@ struct _GstVideoMeta {
 
   gpointer (*map)    (GstVideoMeta *meta, guint plane, gint *stride,
                       GstMapFlags flags);
-  gboolean (*unmap)  (GstVideoMeta *meta, guint plane, gpointer data);
+  gboolean (*unmap)  (GstVideoMeta *meta, guint plane);
 };
 
 const GstMetaInfo * gst_video_meta_get_info (void);
@@ -85,7 +85,7 @@ GstVideoMeta * gst_buffer_add_video_meta_full  (GstBuffer *buffer, GstVideoFlags
 
 gpointer       gst_video_meta_map        (GstVideoMeta *meta, guint plane, gint *stride,
                                           GstMapFlags flags);
-gboolean       gst_video_meta_unmap      (GstVideoMeta *meta, guint plane, gpointer data);
+gboolean       gst_video_meta_unmap      (GstVideoMeta *meta, guint plane);
 
 /**
  * GstVideoCropMeta:
diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c
index 94bd87b..cda2e56 100644
--- a/gst-libs/gst/video/video.c
+++ b/gst-libs/gst/video/video.c
@@ -1107,7 +1107,7 @@ gst_video_frame_unmap (GstVideoFrame * frame)
 
   if (meta) {
     for (i = 0; i < frame->info.finfo->n_planes; i++) {
-      gst_video_meta_unmap (meta, i, frame->data[i]);
+      gst_video_meta_unmap (meta, i);
     }
   } else {
     guint8 *data;



More information about the gstreamer-commits mailing list