28 #include <CoreFoundation/CoreFoundation.h>
34 #ifndef kCFCoreFoundationVersionNumber10_7
35 #define kCFCoreFoundationVersionNumber10_7 635.00
83 CVPixelBufferUnlockBaseAddress(context->
cv_buffer, 0);
92 if (!context || !buffer) {
98 pic->
data[0] = (
void *)1;
111 #if FF_API_GET_BUFFER
123 #if FF_API_GET_BUFFER
136 ret = ff_h264_decoder.
decode(avctx, data, got_frame, avpkt);
141 CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->
data[3];
143 CVPixelBufferRetain(cv_buffer);
144 CVPixelBufferLockBaseAddress(cv_buffer, 0);
147 if (CVPixelBufferIsPlanar(cv_buffer)) {
148 int i,
count = CVPixelBufferGetPlaneCount(cv_buffer);
150 for (i = 0; i <
count; i++) {
151 pic->
data[i] = CVPixelBufferGetBaseAddressOfPlane(cv_buffer, i);
152 pic->
linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(cv_buffer, i);
155 pic->
data[0] = CVPixelBufferGetBaseAddress(cv_buffer);
156 pic->
linesize[0] = CVPixelBufferGetBytesPerRow(cv_buffer);
172 ff_h264_decoder.
close(avctx);
188 if (!ff_h264_vda_decoder.
pix_fmts) {
222 if (status != kVDADecoderNoErr) {
224 "Failed to init VDA decoder: %d.\n", status);
230 ret = ff_h264_decoder.
init(avctx);
258 ff_h264_decoder.
flush(avctx);