[FFmpeg-devel] [PATCH v3 2/4] avdevice/decklink: add sqd configure

lance.lmwang at gmail.com lance.lmwang at gmail.com
Fri Aug 13 06:22:25 EEST 2021


On Thu, Aug 12, 2021 at 09:49:01PM +0200, Marton Balint wrote:
> 
> 
> On Tue, 10 Aug 2021, lance.lmwang at gmail.com wrote:
> 
> > From: Limin Wang <lance.lmwang at gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> > configure                       | 2 +-
> > doc/outdevs.texi                | 5 +++++
> > libavdevice/decklink_common.cpp | 7 +++++++
> > libavdevice/decklink_common_c.h | 1 +
> > libavdevice/decklink_enc_c.c    | 4 ++++
> > 5 files changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/configure b/configure
> > index f9fdf58..11f774c 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6387,7 +6387,7 @@ enabled avisynth          && require_headers "avisynth/avisynth_c.h"
> > enabled cuda_nvcc         && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
> > enabled chromaprint       && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
> > enabled decklink          && { require_headers DeckLinkAPI.h &&
> > -                               { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0a0000" || die "ERROR: Decklink API version must be >= 10.10"; } }
> > +                               { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0400" || die "ERROR: Decklink API version must be >= 10.11.4"; } }
> 
> Can you double check this version requriement? According to API docs
> (ReadMe.rtf in SDK) the required option was added in 10.11, not 10.11.4.

Yes, it's 10.11, Have downloaded sdk 10.11.1 for check. will fix it.

> 
> > enabled frei0r            && require_headers "frei0r.h dlfcn.h"
> > enabled gmp               && require gmp gmp.h mpz_export -lgmp
> > enabled gnutls            && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
> > diff --git a/doc/outdevs.texi b/doc/outdevs.texi
> > index f046b23..e3e88b2 100644
> > --- a/doc/outdevs.texi
> > +++ b/doc/outdevs.texi
> > @@ -211,6 +211,11 @@ Sets the SDI video link configuration on the used output. Must be
> > SDI.
> > Defaults to @samp{unset}.
> > 
> > + at item sqd
> > +Enable Square Division Quad Split mode for Quad-link SDI output.
> > +Must be @samp{unset}, @samp{true} or @samp{false}.
> > +Defaults to @option{unset}.
> > +
> > @end table
> > 
> > @subsection Examples
> > diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
> > index 4e0df04..a892a6c 100644
> > --- a/libavdevice/decklink_common.cpp
> > +++ b/libavdevice/decklink_common.cpp
> > @@ -221,6 +221,13 @@ int ff_decklink_set_configs(AVFormatContext *avctx,
> >             av_log(avctx, AV_LOG_WARNING, "Setting link configuration failed.\n");
> >         else
> >             av_log(avctx, AV_LOG_VERBOSE, "Successfully set link configuration: 0x%x.\n", ctx->link);
> > +        if (ctx->link == bmdLinkConfigurationQuadLink && cctx->sqd >= 0) {
> > +            res = ctx->cfg->SetFlag(bmdDeckLinkConfigQuadLinkSDIVideoOutputSquareDivisionSplit, cctx->sqd);
> > +            if (res != S_OK)
> > +                av_log(avctx, AV_LOG_WARNING, "Setting SquareDivisionSplit failed.\n");
> > +            else
> > +                av_log(avctx, AV_LOG_VERBOSE, "Successfully set SquareDivisionSplit.\n");
> > +        }
> >     }
> > 
> >     return 0;
> > diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
> > index f37e0c0..fdaa1f9 100644
> > --- a/libavdevice/decklink_common_c.h
> > +++ b/libavdevice/decklink_common_c.h
> > @@ -49,6 +49,7 @@ struct decklink_cctx {
> >     int audio_depth;
> >     int duplex_mode;
> >     int link;
> > +    int sqd;
> >     DecklinkPtsSource audio_pts_source;
> >     DecklinkPtsSource video_pts_source;
> >     int audio_input;
> > diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
> > index 4d191d8..4bcdbfe 100644
> > --- a/libavdevice/decklink_enc_c.c
> > +++ b/libavdevice/decklink_enc_c.c
> > @@ -40,6 +40,10 @@ static const AVOption options[] = {
> >     { "single"      ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 1   }, 0, 0, ENC, "link"},
> >     { "dual"        ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 2   }, 0, 0, ENC, "link"},
> >     { "quad"        ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 3   }, 0, 0, ENC, "link"},
> > +    { "sqd"         , "set Square Division"     , OFFSET(sqd)         , AV_OPT_TYPE_INT,    { .i64 = -1  }, -1,1, ENC, "sqd"},
> > +    { "unset"       ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = -1  }, 0, 0, ENC, "sqd"},
> > +    { "false"       ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 0   }, 0, 0, ENC, "sqd"},
> > +    { "true"        ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 1   }, 0, 0, ENC, "sqd"},
> >     { "timing_offset", "genlock timing pixel offset", OFFSET(timing_offset), AV_OPT_TYPE_INT,   { .i64 = INT_MIN }, INT_MIN, INT_MAX, ENC, "timing_offset"},
> >     { "unset"       ,  NULL                     , 0                        , AV_OPT_TYPE_CONST, { .i64 = INT_MIN },       0,       0, ENC, "timing_offset"},
> 
> This is also a new option so libavdevice micro bump is needed.
> 
> Otherwise this look good as well.
> 
> Thanks,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list