applemedia: We need to map the coremedia buffers in non-readonly mode

Our buffers claim to be writable so other elements expect to be able
to write there without losing their changes.
This commit is contained in:
Sebastian Dröge 2014-09-19 14:32:46 +03:00
parent 6d67b5263f
commit bee1477f08
2 changed files with 4 additions and 7 deletions

View file

@ -25,8 +25,7 @@ static void
gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf) gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf)
{ {
if (meta->image_buf != NULL) { if (meta->image_buf != NULL) {
CVPixelBufferUnlockBaseAddress (meta->image_buf, CVPixelBufferUnlockBaseAddress (meta->image_buf, 0);
kCVPixelBufferLock_ReadOnly);
CVBufferRelease (meta->image_buf); CVBufferRelease (meta->image_buf);
} }
if (meta->block_buf != NULL) { if (meta->block_buf != NULL) {
@ -93,8 +92,7 @@ gst_core_media_buffer_wrap_pixel_buffer (GstBuffer * buf, GstVideoInfo * info,
GstVideoMeta *video_meta; GstVideoMeta *video_meta;
UInt32 size; UInt32 size;
if (CVPixelBufferLockBaseAddress (pixel_buf, if (CVPixelBufferLockBaseAddress (pixel_buf, 0) != kCVReturnSuccess) {
kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) {
GST_ERROR ("Could not lock pixel buffer base address"); GST_ERROR ("Could not lock pixel buffer base address");
return FALSE; return FALSE;
} }

View file

@ -23,7 +23,7 @@ static void
gst_core_video_meta_free (GstCoreVideoMeta * meta, GstBuffer * buf) gst_core_video_meta_free (GstCoreVideoMeta * meta, GstBuffer * buf)
{ {
if (meta->pixbuf != NULL) { if (meta->pixbuf != NULL) {
CVPixelBufferUnlockBaseAddress (meta->pixbuf, kCVPixelBufferLock_ReadOnly); CVPixelBufferUnlockBaseAddress (meta->pixbuf, 0);
} }
CVBufferRelease (meta->cvbuf); CVBufferRelease (meta->cvbuf);
@ -74,8 +74,7 @@ gst_core_video_buffer_new (CVBufferRef cvbuf, GstVideoInfo * vinfo)
pixbuf = (CVPixelBufferRef) cvbuf; pixbuf = (CVPixelBufferRef) cvbuf;
if (CVPixelBufferLockBaseAddress (pixbuf, if (CVPixelBufferLockBaseAddress (pixbuf, 0) != kCVReturnSuccess) {
kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) {
goto error; goto error;
} }