#include <CoreFoundation/CFString.h>
#include "libavutil/avutil.h"
-#include "h264.h"
+#include "h264dec.h"
#include "internal.h"
#include "vda.h"
#include "vda_internal.h"
H264Context *h = avctx->priv_data;
VDAContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
- AVFrame *frame = &h->cur_pic_ptr->f;
+ AVFrame *frame = h->cur_pic_ptr->f;
int status;
if (!vda_ctx->decoder || !vda->bitstream)
CFMutableDictionaryRef io_surface_properties;
CFNumberRef cv_pix_fmt;
- /* Each VCL NAL in the bistream sent to the decoder
+ /* Each VCL NAL in the bitstream sent to the decoder
* is preceded by a 4 bytes length header.
* Change the avcC atom header if needed, to signal headers of 4 bytes. */
if (extradata_size >= 4 && (extradata[4] & 0x03) != 0x03) {
H264Context *h = avctx->priv_data;
VDAContext *vda = avctx->internal->hwaccel_priv_data;
AVVDAContext *vda_ctx = avctx->hwaccel_context;
- AVFrame *frame = &h->cur_pic_ptr->f;
+ AVFrame *frame = h->cur_pic_ptr->f;
uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames
CFDataRef coded_frame;
OSStatus status;
sizeof(vda->frame),
release_buffer, NULL,
AV_BUFFER_FLAG_READONLY);
- if (!frame->buf)
+ if (!frame->buf[0])
return AVERROR(ENOMEM);
frame->data[3] = (uint8_t*)vda->frame;
CFMutableDictionaryRef buffer_attributes;
CFMutableDictionaryRef io_surface_properties;
CFNumberRef cv_pix_fmt;
- int32_t fmt = 'avc1', pix_fmt = kCVPixelFormatType_422YpCbCr8;
+ int32_t fmt = 'avc1', pix_fmt = vda_ctx->cv_pix_fmt_type;
// kCVPixelFormatType_420YpCbCr8Planar;
- /* Each VCL NAL in the bistream sent to the decoder
+ /* Each VCL NAL in the bitstream sent to the decoder
* is preceded by a 4 bytes length header.
* Change the avcC atom header if needed, to signal headers of 4 bytes. */
if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {