Libav
vda_h264.c
Go to the documentation of this file.
1 /*
2  * VDA H.264 hardware acceleration
3  *
4  * copyright (c) 2011 Sebastien Zwickert
5  *
6  * This file is part of Libav.
7  *
8  * Libav is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * Libav is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Libav; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <CoreFoundation/CFNumber.h>
24 #include <CoreFoundation/CFData.h>
25 #include <CoreFoundation/CFString.h>
26 
27 #include "libavutil/avutil.h"
28 #include "h264.h"
29 #include "internal.h"
30 #include "vda.h"
31 #include "vda_internal.h"
32 
33 typedef struct VDAContext {
34  // The current bitstream buffer.
36 
37  // The current size of the bitstream.
39 
40  // The reference size used for fast reallocation.
42 
43  CVImageBufferRef frame;
44 } VDAContext;
45 
46 /* Decoder callback that adds the VDA frame to the queue in display order. */
47 static void vda_decoder_callback(void *vda_hw_ctx,
48  CFDictionaryRef user_info,
49  OSStatus status,
50  uint32_t infoFlags,
51  CVImageBufferRef image_buffer)
52 {
53  struct vda_context *vda_ctx = vda_hw_ctx;
54 
55  if (!image_buffer)
56  return;
57 
58  if (vda_ctx->cv_pix_fmt_type != CVPixelBufferGetPixelFormatType(image_buffer))
59  return;
60 
61  vda_ctx->cv_buffer = CVPixelBufferRetain(image_buffer);
62 }
63 
64 static int vda_sync_decode(VDAContext *ctx, struct vda_context *vda_ctx)
65 {
66  OSStatus status;
67  CFDataRef coded_frame;
68  uint32_t flush_flags = 1 << 0;
69 
70  coded_frame = CFDataCreate(kCFAllocatorDefault,
71  ctx->bitstream,
72  ctx->bitstream_size);
73 
74  status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, NULL);
75 
76  if (kVDADecoderNoErr == status)
77  status = VDADecoderFlush(vda_ctx->decoder, flush_flags);
78 
79  CFRelease(coded_frame);
80 
81  return status;
82 }
83 
84 
86  av_unused const uint8_t *buffer,
87  av_unused uint32_t size)
88 {
89  VDAContext *vda = avctx->internal->hwaccel_priv_data;
90  struct vda_context *vda_ctx = avctx->hwaccel_context;
91 
92  if (!vda_ctx->decoder)
93  return -1;
94 
95  vda->bitstream_size = 0;
96 
97  return 0;
98 }
99 
101  const uint8_t *buffer,
102  uint32_t size)
103 {
104  VDAContext *vda = avctx->internal->hwaccel_priv_data;
105  struct vda_context *vda_ctx = avctx->hwaccel_context;
106  void *tmp;
107 
108  if (!vda_ctx->decoder)
109  return -1;
110 
111  tmp = av_fast_realloc(vda->bitstream,
112  &vda->allocated_size,
113  vda->bitstream_size + size + 4);
114  if (!tmp)
115  return AVERROR(ENOMEM);
116 
117  vda->bitstream = tmp;
118 
119  AV_WB32(vda->bitstream + vda->bitstream_size, size);
120  memcpy(vda->bitstream + vda->bitstream_size + 4, buffer, size);
121 
122  vda->bitstream_size += size + 4;
123 
124  return 0;
125 }
126 
128 {
129  H264Context *h = avctx->priv_data;
130  VDAContext *vda = avctx->internal->hwaccel_priv_data;
131  struct vda_context *vda_ctx = avctx->hwaccel_context;
132  AVFrame *frame = &h->cur_pic_ptr->f;
133  int status;
134 
135  if (!vda_ctx->decoder || !vda->bitstream)
136  return -1;
137 
138  status = vda_sync_decode(vda, vda_ctx);
139  frame->data[3] = (void*)vda_ctx->cv_buffer;
140 
141  if (status)
142  av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
143 
144  return status;
145 }
146 
147 int ff_vda_create_decoder(struct vda_context *vda_ctx,
148  uint8_t *extradata,
149  int extradata_size)
150 {
151  OSStatus status = kVDADecoderNoErr;
152  CFNumberRef height;
153  CFNumberRef width;
154  CFNumberRef format;
155  CFDataRef avc_data;
156  CFMutableDictionaryRef config_info;
157  CFMutableDictionaryRef buffer_attributes;
158  CFMutableDictionaryRef io_surface_properties;
159  CFNumberRef cv_pix_fmt;
160 
161  /* Each VCL NAL in the bistream sent to the decoder
162  * is preceded by a 4 bytes length header.
163  * Change the avcC atom header if needed, to signal headers of 4 bytes. */
164  if (extradata_size >= 4 && (extradata[4] & 0x03) != 0x03) {
165  uint8_t *rw_extradata;
166 
167  if (!(rw_extradata = av_malloc(extradata_size)))
168  return AVERROR(ENOMEM);
169 
170  memcpy(rw_extradata, extradata, extradata_size);
171 
172  rw_extradata[4] |= 0x03;
173 
174  avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, extradata_size);
175 
176  av_freep(&rw_extradata);
177  } else {
178  avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size);
179  }
180 
181  config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
182  4,
183  &kCFTypeDictionaryKeyCallBacks,
184  &kCFTypeDictionaryValueCallBacks);
185 
186  height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
187  width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
188  format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
189 
190  CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height);
191  CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width);
192  CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format);
193  CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avc_data);
194 
195  buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
196  2,
197  &kCFTypeDictionaryKeyCallBacks,
198  &kCFTypeDictionaryValueCallBacks);
199  io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
200  0,
201  &kCFTypeDictionaryKeyCallBacks,
202  &kCFTypeDictionaryValueCallBacks);
203  cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault,
204  kCFNumberSInt32Type,
205  &vda_ctx->cv_pix_fmt_type);
206  CFDictionarySetValue(buffer_attributes,
207  kCVPixelBufferPixelFormatTypeKey,
208  cv_pix_fmt);
209  CFDictionarySetValue(buffer_attributes,
210  kCVPixelBufferIOSurfacePropertiesKey,
211  io_surface_properties);
212 
213  status = VDADecoderCreate(config_info,
214  buffer_attributes,
215  (VDADecoderOutputCallback *)vda_decoder_callback,
216  vda_ctx,
217  &vda_ctx->decoder);
218 
219  CFRelease(height);
220  CFRelease(width);
221  CFRelease(format);
222  CFRelease(avc_data);
223  CFRelease(config_info);
224  CFRelease(io_surface_properties);
225  CFRelease(cv_pix_fmt);
226  CFRelease(buffer_attributes);
227 
228  return status;
229 }
230 
232 {
233  OSStatus status = kVDADecoderNoErr;
234 
235  if (vda_ctx->decoder)
236  status = VDADecoderDestroy(vda_ctx->decoder);
237 
238  return status;
239 }
240 
241 static int vda_h264_uninit(AVCodecContext *avctx)
242 {
243  VDAContext *vda = avctx->internal->hwaccel_priv_data;
244  av_freep(&vda->bitstream);
245  if (vda->frame)
246  CVPixelBufferRelease(vda->frame);
247  return 0;
248 }
249 
251  .name = "h264_vda",
252  .type = AVMEDIA_TYPE_VIDEO,
253  .id = AV_CODEC_ID_H264,
254  .pix_fmt = AV_PIX_FMT_VDA_VLD,
255  .start_frame = vda_old_h264_start_frame,
256  .decode_slice = vda_old_h264_decode_slice,
257  .end_frame = vda_old_h264_end_frame,
258  .uninit = vda_h264_uninit,
259  .priv_data_size = sizeof(VDAContext),
260 };
261 
262 void ff_vda_output_callback(void *opaque,
263  CFDictionaryRef user_info,
264  OSStatus status,
265  uint32_t infoFlags,
266  CVImageBufferRef image_buffer)
267 {
268  AVCodecContext *ctx = opaque;
270 
271 
272  if (vda->frame) {
273  CVPixelBufferRelease(vda->frame);
274  vda->frame = NULL;
275  }
276 
277  if (!image_buffer)
278  return;
279 
280  vda->frame = CVPixelBufferRetain(image_buffer);
281 }
282 
284  const uint8_t *buffer,
285  uint32_t size)
286 {
287  VDAContext *vda = avctx->internal->hwaccel_priv_data;
288 
289  vda->bitstream_size = 0;
290 
291  return 0;
292 }
293 
295  const uint8_t *buffer,
296  uint32_t size)
297 {
298  VDAContext *vda = avctx->internal->hwaccel_priv_data;
299  void *tmp;
300 
301  tmp = av_fast_realloc(vda->bitstream,
302  &vda->allocated_size,
303  vda->bitstream_size + size + 4);
304  if (!tmp)
305  return AVERROR(ENOMEM);
306 
307  vda->bitstream = tmp;
308 
309  AV_WB32(vda->bitstream + vda->bitstream_size, size);
310  memcpy(vda->bitstream + vda->bitstream_size + 4, buffer, size);
311 
312  vda->bitstream_size += size + 4;
313 
314  return 0;
315 }
316 
317 static void release_buffer(void *opaque, uint8_t *data)
318 {
319  CVImageBufferRef frame = (CVImageBufferRef)data;
320  CVPixelBufferRelease(frame);
321 }
322 
324 {
325  H264Context *h = avctx->priv_data;
326  VDAContext *vda = avctx->internal->hwaccel_priv_data;
327  AVVDAContext *vda_ctx = avctx->hwaccel_context;
328  AVFrame *frame = &h->cur_pic_ptr->f;
329  uint32_t flush_flags = 1 << 0;
330  CFDataRef coded_frame;
331  OSStatus status;
332 
333  if (!vda->bitstream_size)
334  return AVERROR_INVALIDDATA;
335 
336 
337  coded_frame = CFDataCreate(kCFAllocatorDefault,
338  vda->bitstream,
339  vda->bitstream_size);
340 
341  status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, NULL);
342 
343  if (status == kVDADecoderNoErr)
344  status = VDADecoderFlush(vda_ctx->decoder, flush_flags);
345 
346  CFRelease(coded_frame);
347 
348  if (status != kVDADecoderNoErr) {
349  av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
350  return AVERROR_UNKNOWN;
351  }
352 
353  if (vda->frame) {
354  av_buffer_unref(&frame->buf[0]);
355 
356  frame->buf[0] = av_buffer_create((uint8_t*)vda->frame,
357  sizeof(vda->frame),
360  if (!frame->buf)
361  return AVERROR(ENOMEM);
362 
363  frame->data[3] = (uint8_t*)vda->frame;
364  vda->frame = NULL;
365  }
366 
367  return 0;
368 }
369 
371 {
372  AVVDAContext *vda_ctx = avctx->hwaccel_context;
373  OSStatus status = kVDADecoderNoErr;
374  CFNumberRef height;
375  CFNumberRef width;
376  CFNumberRef format;
377  CFDataRef avc_data;
378  CFMutableDictionaryRef config_info;
379  CFMutableDictionaryRef buffer_attributes;
380  CFMutableDictionaryRef io_surface_properties;
381  CFNumberRef cv_pix_fmt;
382  int32_t fmt = 'avc1', pix_fmt = kCVPixelFormatType_422YpCbCr8;
383 
384  // kCVPixelFormatType_420YpCbCr8Planar;
385 
386  /* Each VCL NAL in the bistream sent to the decoder
387  * is preceded by a 4 bytes length header.
388  * Change the avcC atom header if needed, to signal headers of 4 bytes. */
389  if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {
390  uint8_t *rw_extradata;
391 
392  if (!(rw_extradata = av_malloc(avctx->extradata_size)))
393  return AVERROR(ENOMEM);
394 
395  memcpy(rw_extradata, avctx->extradata, avctx->extradata_size);
396 
397  rw_extradata[4] |= 0x03;
398 
399  avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, avctx->extradata_size);
400 
401  av_freep(&rw_extradata);
402  } else {
403  avc_data = CFDataCreate(kCFAllocatorDefault,
404  avctx->extradata, avctx->extradata_size);
405  }
406 
407  config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
408  4,
409  &kCFTypeDictionaryKeyCallBacks,
410  &kCFTypeDictionaryValueCallBacks);
411 
412  height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->height);
413  width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->width);
414  format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &fmt);
415  CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height);
416  CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width);
417  CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avc_data);
418  CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format);
419 
420  buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
421  2,
422  &kCFTypeDictionaryKeyCallBacks,
423  &kCFTypeDictionaryValueCallBacks);
424  io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
425  0,
426  &kCFTypeDictionaryKeyCallBacks,
427  &kCFTypeDictionaryValueCallBacks);
428  cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault,
429  kCFNumberSInt32Type,
430  &pix_fmt);
431 
432  CFDictionarySetValue(buffer_attributes,
433  kCVPixelBufferPixelFormatTypeKey,
434  cv_pix_fmt);
435  CFDictionarySetValue(buffer_attributes,
436  kCVPixelBufferIOSurfacePropertiesKey,
437  io_surface_properties);
438 
439  status = VDADecoderCreate(config_info,
440  buffer_attributes,
441  (VDADecoderOutputCallback *)ff_vda_output_callback,
442  avctx,
443  &vda_ctx->decoder);
444 
445  CFRelease(format);
446  CFRelease(height);
447  CFRelease(width);
448  CFRelease(avc_data);
449  CFRelease(config_info);
450  CFRelease(cv_pix_fmt);
451  CFRelease(io_surface_properties);
452  CFRelease(buffer_attributes);
453 
454  if (status != kVDADecoderNoErr) {
455  av_log(avctx, AV_LOG_ERROR, "Cannot initialize VDA %d\n", status);
456  }
457 
458  switch (status) {
459  case kVDADecoderHardwareNotSupportedErr:
460  case kVDADecoderFormatNotSupportedErr:
461  return AVERROR(ENOSYS);
462  case kVDADecoderConfigurationError:
463  return AVERROR(EINVAL);
464  case kVDADecoderDecoderFailedErr:
465  return AVERROR_INVALIDDATA;
466  case kVDADecoderNoErr:
467  return 0;
468  default:
469  return AVERROR_UNKNOWN;
470  }
471 }
472 
473 static int vda_h264_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
474 {
475  frame->width = avctx->width;
476  frame->height = avctx->height;
477  frame->format = avctx->pix_fmt;
478  frame->buf[0] = av_buffer_alloc(1);
479 
480  if (!frame->buf[0])
481  return AVERROR(ENOMEM);
482  return 0;
483 }
484 
486  .name = "h264_vda",
487  .type = AVMEDIA_TYPE_VIDEO,
488  .id = AV_CODEC_ID_H264,
489  .pix_fmt = AV_PIX_FMT_VDA,
490  .alloc_frame = vda_h264_alloc_frame,
491  .start_frame = vda_h264_start_frame,
492  .decode_slice = vda_h264_decode_slice,
493  .end_frame = vda_h264_end_frame,
494  .uninit = vda_h264_uninit,
495  .priv_data_size = sizeof(VDAContext),
496 };
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:62
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
Definition: buffer.c:105
int size
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
Definition: frame.h:393
AVHWAccel ff_h264_vda_old_hwaccel
Definition: vda_h264.c:250
static int vda_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vda_h264.c:294
static void release_buffer(void *opaque, uint8_t *data)
Definition: vda_h264.c:317
void ff_vda_output_callback(void *opaque, CFDictionaryRef user_info, OSStatus status, uint32_t infoFlags, CVImageBufferRef image_buffer)
Definition: vda_h264.c:262
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1254
external API header
H264Context.
Definition: h264.h:303
static int vda_old_h264_end_frame(AVCodecContext *avctx)
Definition: vda_h264.c:127
int format
The frame format.
Definition: vda.h:105
struct AVFrame f
Definition: h264.h:264
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
OSType cv_pix_fmt_type
The pixel format for output image buffers.
Definition: vda.h:113
This struct holds all the information that needs to be passed between the caller and libavcodec for i...
Definition: vda.h:145
uint8_t
void * hwaccel_context
Hardware accelerator context.
Definition: avcodec.h:2444
#define AV_WB32(p, d)
Definition: intreadwrite.h:239
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1164
const char data[16]
Definition: mxf.c:70
int width
The frame width.
Definition: vda.h:89
#define AV_BUFFER_FLAG_READONLY
Always treat the buffer as read-only, even when it has only one reference.
Definition: buffer.h:113
static int vda_h264_uninit(AVCodecContext *avctx)
Definition: vda_h264.c:241
CVPixelBufferRef cv_buffer
The Core Video pixel buffer that contains the current image data.
Definition: vda.h:73
H.264 / AVC / MPEG4 part10 codec.
int ff_vda_default_init(AVCodecContext *avctx)
Definition: vda_h264.c:370
int width
width and height of the video frame
Definition: frame.h:174
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
Definition: mem.c:369
VDADecoder decoder
VDA decoder object.
Definition: vda.h:65
#define AVERROR(e)
Definition: error.h:43
static int vda_h264_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: vda_h264.c:473
static int vda_sync_decode(VDAContext *ctx, struct vda_context *vda_ctx)
Definition: vda_h264.c:64
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:168
AVBufferRef * av_buffer_create(uint8_t *data, int size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
Definition: buffer.c:27
HW acceleration through VDA, data[3] contains a CVPixelBufferRef.
Definition: pixfmt.h:204
This structure is used to provide the necessary configurations and data to the VDA Libav HWAccel impl...
Definition: vda.h:58
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:2899
int width
picture width / height.
Definition: avcodec.h:1224
int32_t
static char buffer[20]
Definition: seek-test.c:31
VDADecoder decoder
VDA decoder object.
Definition: vda.h:149
enum AVPixelFormat pix_fmt
Definition: movenc.c:843
if(ac->has_optimized_func)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
Definition: frame.h:186
NULL
Definition: eval.c:55
static int width
Definition: utils.c:156
AVHWAccel.
Definition: avcodec.h:2893
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:65
Public libavcodec VDA header.
int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
Destroy the video decoder.
Definition: vda_h264.c:231
main external API structure.
Definition: avcodec.h:1050
static int vda_old_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vda_h264.c:100
int extradata_size
Definition: avcodec.h:1165
static void vda_decoder_callback(void *vda_hw_ctx, CFDictionaryRef user_info, OSStatus status, uint32_t infoFlags, CVImageBufferRef image_buffer)
Definition: vda_h264.c:47
H264Picture * cur_pic_ptr
Definition: h264.h:315
AVHWAccel ff_h264_vda_hwaccel
Definition: vda_h264.c:485
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:141
int height
Definition: gxfenc.c:72
hardware decoding through VDA
Definition: pixfmt.h:162
common internal api header.
static int vda_h264_end_frame(AVCodecContext *avctx)
Definition: vda_h264.c:323
int allocated_size
Definition: vda_h264.c:41
void * hwaccel_priv_data
hwaccel-specific private data
Definition: internal.h:102
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:61
void * priv_data
Definition: avcodec.h:1092
struct AVCodecInternal * internal
Private context used for internal data.
Definition: avcodec.h:1100
int ff_vda_create_decoder(struct vda_context *vda_ctx, uint8_t *extradata, int extradata_size)
Create the video decoder.
Definition: vda_h264.c:147
static int vda_old_h264_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vda_h264.c:85
int height
Definition: frame.h:174
int bitstream_size
Definition: vda_h264.c:38
static int vda_h264_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vda_h264.c:283
uint8_t * bitstream
Definition: vda_h264.c:35
int height
The frame height.
Definition: vda.h:97
#define av_unused
Definition: attributes.h:86
CVImageBufferRef frame
Definition: vda_h264.c:43