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

View file

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