]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/decklink_enc.cpp
avdevice/decklink_enc: simplify usage of buffercount type
[ffmpeg] / libavdevice / decklink_enc.cpp
index 8b621d00543e6fe3a9af0b770e7eaf1f04b69c7a..ee341111ce4b49a361a1219260e472137d70f35d 100644 (file)
@@ -197,8 +197,11 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
                " Check available formats with -list_formats 1.\n");
         return -1;
     }
-    if (ctx->dlo->EnableVideoOutput(ctx->bmd_mode,
-                                    ctx->supports_vanc ? bmdVideoOutputVANC : bmdVideoOutputFlagDefault) != S_OK) {
+    if (ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputVANC) != S_OK) {
+        av_log(avctx, AV_LOG_WARNING, "Could not enable video output with VANC! Trying without...\n");
+        ctx->supports_vanc = 0;
+    }
+    if (!ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputFlagDefault) != S_OK) {
         av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n");
         return -1;
     }
@@ -433,7 +436,7 @@ static int decklink_write_video_packet(AVFormatContext *avctx, AVPacket *pkt)
     AVFrame *avframe = NULL, *tmp = (AVFrame *)pkt->data;
     AVPacket *avpacket = NULL;
     decklink_frame *frame;
-    buffercount_type buffered;
+    uint32_t buffered;
     HRESULT hr;
 
     if (st->codecpar->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME) {
@@ -522,7 +525,7 @@ static int decklink_write_audio_packet(AVFormatContext *avctx, AVPacket *pkt)
     struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
     struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
     int sample_count = pkt->size / (ctx->channels << 1);
-    buffercount_type buffered;
+    uint32_t buffered;
 
     ctx->dlo->GetBufferedAudioSampleFrameCount(&buffered);
     if (pkt->pts > 1 && !buffered)
@@ -565,6 +568,7 @@ av_cold int ff_decklink_write_header(AVFormatContext *avctx)
 
     /* List available devices and exit. */
     if (ctx->list_devices) {
+        av_log(avctx, AV_LOG_WARNING, "The -list_devices option is deprecated and will be removed. Please use ffmpeg -sinks decklink instead.\n");
         ff_decklink_list_devices_legacy(avctx, 0, 1);
         return AVERROR_EXIT;
     }