summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-10-13 23:56:45 +0200
committerMarton Balint <cus@passwd.hu>2016-10-21 20:24:12 +0200
commit2f3015c25aaecf0307a82e38099c04b783223013 (patch)
treec44ae7c0315ea46205f4f7fcc5ffd9b21a052415 /libavdevice
parentfecb3e82a4ba09dc11a51ad0961ab491881a53a1 (diff)
downloadffmpeg-2f3015c25aaecf0307a82e38099c04b783223013.tar.gz
lavd/decklink_dec: add option to disable drawing bars on signal loss
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/decklink_common.h1
-rw-r--r--libavdevice/decklink_common_c.h1
-rw-r--r--libavdevice/decklink_dec.cpp3
-rw-r--r--libavdevice/decklink_dec_c.c1
-rw-r--r--libavdevice/version.h2
5 files changed, 6 insertions, 2 deletions
diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index d2d0ab26b7..bfa2b08484 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -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;
diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
index 3c5f218713..d5656317ae 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -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 */
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 24b42e3eb0..5318bbe690 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -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
diff --git a/libavdevice/decklink_dec_c.c b/libavdevice/decklink_dec_c.c
index 56bc4394cf..543d16b396 100644
--- a/libavdevice/decklink_dec_c.c
+++ b/libavdevice/decklink_dec_c.c
@@ -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 },
};
diff --git a/libavdevice/version.h b/libavdevice/version.h
index 94a34fd670..8603bb1261 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -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, \