applemedia: corevideobuffer: set the correct stride for packed formats

This commit is contained in:
Alessandro Decina 2013-12-08 16:46:58 +01:00
parent 839970e07c
commit ffeb719d4c

View file

@ -23,8 +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, CVPixelBufferUnlockBaseAddress (meta->pixbuf, kCVPixelBufferLock_ReadOnly);
kCVPixelBufferLock_ReadOnly);
} }
CVBufferRelease (meta->cvbuf); CVBufferRelease (meta->cvbuf);
@ -60,8 +59,7 @@ gst_core_video_meta_get_info (void)
} }
GstBuffer * GstBuffer *
gst_core_video_buffer_new (CVBufferRef cvbuf, gst_core_video_buffer_new (CVBufferRef cvbuf, GstVideoInfo * vinfo)
GstVideoInfo * vinfo)
{ {
void *data; void *data;
size_t size; size_t size;
@ -112,7 +110,8 @@ gst_core_video_buffer_new (CVBufferRef cvbuf,
size = tmp_vinfo.size; size = tmp_vinfo.size;
} else { } else {
n_planes = 1; n_planes = 1;
size = CVPixelBufferGetBytesPerRow (pixbuf) * height; stride[0] = CVPixelBufferGetBytesPerRow (pixbuf);
size = stride[0] * height;
} }
gst_buffer_append_memory (buf, gst_buffer_append_memory (buf,