28 #include <CoreFoundation/CoreFoundation.h>
34 #ifndef kCFCoreFoundationVersionNumber10_7
35 #define kCFCoreFoundationVersionNumber10_7 635.00
74 CVPixelBufferUnlockBaseAddress(context->
cv_buffer, 0);
83 if (!context || !buffer) {
89 pic->
data[0] = (
void *)1;
100 ret = ff_h264_decoder.
decode(avctx, data, got_frame, avpkt);
104 CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->
data[3];
106 CVPixelBufferRetain(cv_buffer);
107 CVPixelBufferLockBaseAddress(cv_buffer, 0);
110 if (CVPixelBufferIsPlanar(cv_buffer)) {
111 int i,
count = CVPixelBufferGetPlaneCount(cv_buffer);
113 for (i = 0; i <
count; i++) {
114 pic->
data[i] = CVPixelBufferGetBaseAddressOfPlane(cv_buffer, i);
115 pic->
linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(cv_buffer, i);
118 pic->
data[0] = CVPixelBufferGetBaseAddress(cv_buffer);
119 pic->
linesize[0] = CVPixelBufferGetBytesPerRow(cv_buffer);
134 ff_h264_decoder.
close(avctx);
148 if (!ff_h264_vda_decoder.
pix_fmts) {
182 if (status != kVDADecoderNoErr) {
184 "Failed to init VDA decoder: %d.\n", status);
192 #if FF_API_GET_BUFFER
194 avctx->get_buffer = NULL;
198 ret = ff_h264_decoder.
init(avctx);
214 return ff_h264_decoder.
flush(avctx);