Update for memory API changes

This commit is contained in:
Wim Taymans 2012-01-19 09:17:07 +01:00
parent 3d42f0f6ed
commit 5872bcc33a
4 changed files with 7 additions and 10 deletions

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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:

View file

@ -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;