metavideo: small fixes

Set the buffer as a field in the metadata so that we can use it to map the
buffer data.
Fix wrong assert.
This commit is contained in:
Wim Taymans 2011-06-17 17:44:56 +02:00
parent 0d75dc5a0b
commit 7426f19027

View file

@ -66,6 +66,7 @@ gst_buffer_add_meta_video_full (GstBuffer * buffer, GstVideoFlags flags,
meta->format = format; meta->format = format;
meta->width = width; meta->width = width;
meta->height = height; meta->height = height;
meta->buffer = buffer;
meta->n_planes = n_planes; meta->n_planes = n_planes;
for (i = 0; i < n_planes; i++) for (i = 0; i < n_planes; i++)
@ -115,7 +116,7 @@ gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
g_return_val_if_fail (buffer != NULL, NULL); g_return_val_if_fail (buffer != NULL, NULL);
write = (flags & GST_MAP_WRITE) != 0; write = (flags & GST_MAP_WRITE) != 0;
g_return_val_if_fail (write && !gst_buffer_is_writable (buffer), NULL); g_return_val_if_fail (!write || gst_buffer_is_writable (buffer), NULL);
offset = meta->plane[plane].offset; offset = meta->plane[plane].offset;
*stride = meta->plane[plane].stride; *stride = meta->plane[plane].stride;