]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vda_h264.c
cllc: Convert to the new bitstream reader
[ffmpeg] / libavcodec / vda_h264.c
index acefde67afa02260a22fa4be1c0616384bd84b71..037715da810214bed8598f9b2b2fabe6c388ba2f 100644 (file)
@@ -25,7 +25,7 @@
 #include <CoreFoundation/CFString.h>
 
 #include "libavutil/avutil.h"
-#include "h264.h"
+#include "h264dec.h"
 #include "internal.h"
 #include "vda.h"
 #include "vda_internal.h"
@@ -129,7 +129,7 @@ static int vda_old_h264_end_frame(AVCodecContext *avctx)
     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)
@@ -158,7 +158,7 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
     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) {
@@ -325,7 +325,7 @@ static int vda_h264_end_frame(AVCodecContext *avctx)
     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;
@@ -359,7 +359,7 @@ static int vda_h264_end_frame(AVCodecContext *avctx)
                                      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;
@@ -380,11 +380,11 @@ int ff_vda_default_init(AVCodecContext *avctx)
     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) {