if (self->image_buf != NULL) {
GstCVApi *cv = self->ctx->cv;
- cv->CVPixelBufferUnlockBaseAddress (self->image_buf, 0);
+ cv->CVPixelBufferUnlockBaseAddress (self->image_buf,
+ kCVPixelBufferLock_ReadOnly);
}
self->ctx->cm->FigSampleBufferRelease (self->sample_buf);
g_object_unref (self->ctx);
CFGetTypeID (image_buf) == cv->CVPixelBufferGetTypeID ()) {
pixel_buf = (CVPixelBufferRef) image_buf;
- if (cv->CVPixelBufferLockBaseAddress (pixel_buf, 0) != kCVReturnSuccess)
+ if (cv->CVPixelBufferLockBaseAddress (pixel_buf,
+ kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) {
goto error;
+ }
if (cv->CVPixelBufferIsPlanar (pixel_buf)) {
gint plane_count, plane_idx;
GstCoreVideoBuffer *self = GST_CORE_VIDEO_BUFFER_CAST (mini_object);
GstCVApi *cv = self->ctx->cv;
- if (self->pixbuf != NULL)
- cv->CVPixelBufferUnlockBaseAddress (self->pixbuf, 0);
+ if (self->pixbuf != NULL) {
+ cv->CVPixelBufferUnlockBaseAddress (self->pixbuf,
+ kCVPixelBufferLock_ReadOnly);
+ }
cv->CVBufferRelease (self->cvbuf);
if (CFGetTypeID (cvbuf) == cv->CVPixelBufferGetTypeID ()) {
pixbuf = (CVPixelBufferRef) cvbuf;
- if (cv->CVPixelBufferLockBaseAddress (pixbuf, 0) != kCVReturnSuccess)
+ if (cv->CVPixelBufferLockBaseAddress (pixbuf,
+ kCVPixelBufferLock_ReadOnly) != kCVReturnSuccess) {
goto error;
+ }
data = cv->CVPixelBufferGetBaseAddress (pixbuf);
size = cv->CVPixelBufferGetBytesPerRow (pixbuf) *
cv->CVPixelBufferGetHeight (pixbuf);
kCVPixelFormatType_422YpCbCr8 = '2vuy'
};
+enum _CVPixelBufferLockFlags
+{
+ kCVPixelBufferLock_ReadOnly = 0x00000001
+};
+
struct _GstCVApi
{
GstDynApi parent;