]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vda.c
lavc: mark the old audio/video encoding API as deprecated
[ffmpeg] / libavcodec / vda.c
index f71fb164885e5d79af4e8479b55af70560191ad4..eb4b9982cb7397912a28b8973b524ed76933b293 100644 (file)
@@ -28,15 +28,22 @@ AVVDAContext *av_vda_alloc_context(void)
 {
     AVVDAContext *ret = av_mallocz(sizeof(*ret));
 
-    if (ret)
+    if (ret) {
         ret->output_callback = ff_vda_output_callback;
+        ret->cv_pix_fmt_type = kCVPixelFormatType_422YpCbCr8;
+    }
 
     return ret;
 }
 
 int av_vda_default_init(AVCodecContext *avctx)
 {
-    avctx->hwaccel_context = av_vda_alloc_context();
+    return av_vda_default_init2(avctx, NULL);
+}
+
+int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx)
+{
+    avctx->hwaccel_context = vdactx ?: av_vda_alloc_context();
     if (!avctx->hwaccel_context)
         return AVERROR(ENOMEM);
     return ff_vda_default_init(avctx);