]> git.sesse.net Git - ffmpeg/commitdiff
avdevice/decklink_enc: add support for setting genlock timing offset
authorMarton Balint <cus@passwd.hu>
Sun, 25 Nov 2018 00:38:05 +0000 (01:38 +0100)
committerMarton Balint <cus@passwd.hu>
Sat, 1 Dec 2018 23:57:10 +0000 (00:57 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
doc/outdevs.texi
libavdevice/decklink_common.cpp
libavdevice/decklink_common_c.h
libavdevice/decklink_enc_c.c
libavdevice/version.h

index 7509ac695db2723cacd6d9479219de255dc3955d..1fd83c28cc10fb3287e72a32bcc054e3acb9b548 100644 (file)
@@ -155,6 +155,10 @@ Defaults to @option{0.5}.
 Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.
 Defaults to @samp{unset}.
 
+@item timing_offset
+Sets the genlock timing pixel offset on the used output.
+Defaults to @samp{unset}.
+
 @end table
 
 @subsection Examples
index 130e70b2ca4564f3eac675f9fb31da4f161454b8..d3cc1eb3d16f16a3a0aa965c80913eda60fc05b1 100644 (file)
@@ -171,6 +171,11 @@ int ff_decklink_set_configs(AVFormatContext *avctx,
         if (ret < 0)
             return ret;
     }
+    if (direction == DIRECTION_OUT && cctx->timing_offset != INT_MIN) {
+        res = ctx->cfg->SetInt(bmdDeckLinkConfigReferenceInputTimingOffset, cctx->timing_offset);
+        if (res != S_OK)
+            av_log(avctx, AV_LOG_WARNING, "Setting timing offset failed.\n");
+    }
     return 0;
 }
 
index 8e3bbeb7df79ce1044f5b80e81f0c15785ef265c..ca85ec2504c5da88a5d681b776ef9e835136b7ed 100644 (file)
@@ -57,6 +57,7 @@ struct decklink_cctx {
     int64_t queue_size;
     int copyts;
     int64_t timestamp_align;
+    int timing_offset;
 };
 
 #endif /* AVDEVICE_DECKLINK_COMMON_C_H */
index 6169078159c57c50afec5d5bd1fcc5b19fd81ece..63cbd39ecd59f88929fd018184e7f4a9166c9c27 100644 (file)
@@ -35,6 +35,8 @@ static const AVOption options[] = {
     { "unset"       ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 0   }, 0, 0, ENC, "duplex_mode"},
     { "half"        ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 1   }, 0, 0, ENC, "duplex_mode"},
     { "full"        ,  NULL                     , 0                   , AV_OPT_TYPE_CONST , { .i64 = 2   }, 0, 0, ENC, "duplex_mode"},
+    { "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"},
     { NULL },
 };
 
index edf26bdc1a853586160d22ec2c97c29d56531ced..e6ae2c44fc7fa65e21513cbb2da08996fedb9f7d 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVDEVICE_VERSION_MAJOR  58
 #define LIBAVDEVICE_VERSION_MINOR   6
-#define LIBAVDEVICE_VERSION_MICRO 100
+#define LIBAVDEVICE_VERSION_MICRO 101
 
 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
                                                LIBAVDEVICE_VERSION_MINOR, \