Commit 2f3015c2 authored by Marton Balint's avatar Marton Balint

lavd/decklink_dec: add option to disable drawing bars on signal loss

Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent fecb3e82
......@@ -273,6 +273,10 @@ Sets the video packet timestamp source. Must be @samp{video}, @samp{audio},
Sets the audio packet timestamp source. Must be @samp{video}, @samp{audio},
@samp{reference} or @samp{wallclock}. Defaults to @samp{audio}.
@item draw_bars
If set to @samp{true}, color bars are drawn in the event of a signal loss.
Defaults to @samp{true}.
@end table
@subsection Examples
......
......@@ -84,6 +84,7 @@ struct decklink_ctx {
int duplex_mode;
DecklinkPtsSource audio_pts_source;
DecklinkPtsSource video_pts_source;
int draw_bars;
int frames_preroll;
int frames_buffer;
......
......@@ -46,6 +46,7 @@ struct decklink_cctx {
DecklinkPtsSource video_pts_source;
int audio_input;
int video_input;
int draw_bars;
};
#endif /* AVDEVICE_DECKLINK_COMMON_C_H */
......@@ -309,7 +309,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
ctx->video_st->time_base.den);
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
if (videoFrame->GetPixelFormat() == bmdFormat8BitYUV) {
if (ctx->draw_bars && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) {
unsigned bars[8] = {
0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035,
0x6ADD6ACA, 0x51EF515A, 0x286D28EF, 0x10801080 };
......@@ -485,6 +485,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
ctx->audio_input = decklink_audio_connection_map[cctx->audio_input];
ctx->audio_pts_source = cctx->audio_pts_source;
ctx->video_pts_source = cctx->video_pts_source;
ctx->draw_bars = cctx->draw_bars;
cctx->ctx = ctx;
#if !CONFIG_LIBZVBI
......
......@@ -62,6 +62,7 @@ static const AVOption options[] = {
{ "video", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_VIDEO }, 0, 0, DEC, "pts_source"},
{ "reference", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_REFERENCE}, 0, 0, DEC, "pts_source"},
{ "wallclock", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_WALLCLOCK}, 0, 0, DEC, "pts_source"},
{ "draw_bars", "draw bars on signal loss" , OFFSET(draw_bars), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, DEC },
{ NULL },
};
......
......@@ -29,7 +29,7 @@
#define LIBAVDEVICE_VERSION_MAJOR 57
#define LIBAVDEVICE_VERSION_MINOR 0
#define LIBAVDEVICE_VERSION_MICRO 102
#define LIBAVDEVICE_VERSION_MICRO 103
#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