From bee1477f08952e25ea5dafb2ae11f7c1de333d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 19 Sep 2014 14:32:46 +0300 Subject: [PATCH] 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. --- sys/applemedia/coremediabuffer.c | 6 ++---- sys/applemedia/corevideobuffer.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/applemedia/coremediabuffer.c b/sys/applemedia/coremediabuffer.c index 73995f0dd2..548f858fbe 100644 --- a/sys/applemedia/coremediabuffer.c +++ b/sys/applemedia/coremediabuffer.c @@ -25,8 +25,7 @@ static void gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf) { if (meta->image_buf != NULL) { - CVPixelBufferUnlockBaseAddress (meta->image_buf, - kCVPixelBufferLock_ReadOnly); + CVPixelBufferUnlockBaseAddress (meta->image_buf, 0); CVBufferRelease (meta->image_buf); } if (meta->block_buf != NULL) { @@ -93,8 +92,7 @@ gst_core_media_buffer_wrap_pixel_buffer (GstBuffer * buf, GstVideoInfo * info, GstVideoMeta *video_meta; UInt32 size; - if (CVPixelBufferLockBaseAddress (pixel_buf, - kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) { + if (CVPixelBufferLockBaseAddress (pixel_buf, 0) != kCVReturnSuccess) { GST_ERROR ("Could not lock pixel buffer base address"); return FALSE; } diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c index 0e08398c2e..b1da334cbe 100644 --- a/sys/applemedia/corevideobuffer.c +++ b/sys/applemedia/corevideobuffer.c @@ -23,7 +23,7 @@ static void gst_core_video_meta_free (GstCoreVideoMeta * meta, GstBuffer * buf) { if (meta->pixbuf != NULL) { - CVPixelBufferUnlockBaseAddress (meta->pixbuf, kCVPixelBufferLock_ReadOnly); + CVPixelBufferUnlockBaseAddress (meta->pixbuf, 0); } CVBufferRelease (meta->cvbuf); @@ -74,8 +74,7 @@ gst_core_video_buffer_new (CVBufferRef cvbuf, GstVideoInfo * vinfo) pixbuf = (CVPixelBufferRef) cvbuf; - if (CVPixelBufferLockBaseAddress (pixbuf, - kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) { + if (CVPixelBufferLockBaseAddress (pixbuf, 0) != kCVReturnSuccess) { goto error; }