33 CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->
data[3];
34 OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
37 int linesize[4] = { 0 };
42 switch (pixel_format) {
47 "Unsupported pixel format: %u\n", pixel_format);
57 err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
58 if (err != kCVReturnSuccess) {
63 if (CVPixelBufferIsPlanar(pixbuf)) {
65 planes = CVPixelBufferGetPlaneCount(pixbuf);
66 for (i = 0; i < planes; i++) {
67 data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
68 linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
71 data[0] = CVPixelBufferGetBaseAddress(pixbuf);
72 linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
126 av_log(NULL, loglevel,
"Error creating VDA decoder.\n");