Commit c0479010 authored by Marton Balint's avatar Marton Balint

avdevice/decklink_enc: add support for setting genlock timing offset

Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 418c90fa
......@@ -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
......
......@@ -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;
}
......
......@@ -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 */
......@@ -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 },
};
......
......@@ -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, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment