Set the buffer as a field in the metadata so that we can use it to map the
buffer data.
Fix wrong assert.
meta->format = format;
meta->width = width;
meta->height = height;
+ meta->buffer = buffer;
meta->n_planes = n_planes;
for (i = 0; i < n_planes; i++)
g_return_val_if_fail (buffer != NULL, NULL);
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;
*stride = meta->plane[plane].stride;