summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-11-25 01:38:05 +0100
committerMarton Balint <cus@passwd.hu>2018-12-02 00:57:10 +0100
commitc0479010125b8ec7eafe6cd55574cee9c3aeb475 (patch)
tree2d881e8b6469cce7191005b0ae5b0dcce99ccf1f /libavdevice
parent418c90faac6522c73481650d000e9f5f030187cb (diff)
downloadffmpeg-c0479010125b8ec7eafe6cd55574cee9c3aeb475.tar.gz
avdevice/decklink_enc: add support for setting genlock timing offset
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/decklink_common.cpp5
-rw-r--r--libavdevice/decklink_common_c.h1
-rw-r--r--libavdevice/decklink_enc_c.c2
-rw-r--r--libavdevice/version.h2
4 files changed, 9 insertions, 1 deletions
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 130e70b2ca..d3cc1eb3d1 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -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;
}
diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
index 8e3bbeb7df..ca85ec2504 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -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 */
diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
index 6169078159..63cbd39ecd 100644
--- a/libavdevice/decklink_enc_c.c
+++ b/libavdevice/decklink_enc_c.c
@@ -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 },
};
diff --git a/libavdevice/version.h b/libavdevice/version.h
index edf26bdc1a..e6ae2c44fc 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -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, \