You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavd/decklink_dec: add option to disable drawing bars on signal loss
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -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},
|
Sets the audio packet timestamp source. Must be @samp{video}, @samp{audio},
|
||||||
@samp{reference} or @samp{wallclock}. Defaults to @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
|
@end table
|
||||||
|
|
||||||
@subsection Examples
|
@subsection Examples
|
||||||
|
@@ -84,6 +84,7 @@ struct decklink_ctx {
|
|||||||
int duplex_mode;
|
int duplex_mode;
|
||||||
DecklinkPtsSource audio_pts_source;
|
DecklinkPtsSource audio_pts_source;
|
||||||
DecklinkPtsSource video_pts_source;
|
DecklinkPtsSource video_pts_source;
|
||||||
|
int draw_bars;
|
||||||
|
|
||||||
int frames_preroll;
|
int frames_preroll;
|
||||||
int frames_buffer;
|
int frames_buffer;
|
||||||
|
@@ -46,6 +46,7 @@ struct decklink_cctx {
|
|||||||
DecklinkPtsSource video_pts_source;
|
DecklinkPtsSource video_pts_source;
|
||||||
int audio_input;
|
int audio_input;
|
||||||
int video_input;
|
int video_input;
|
||||||
|
int draw_bars;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* AVDEVICE_DECKLINK_COMMON_C_H */
|
#endif /* AVDEVICE_DECKLINK_COMMON_C_H */
|
||||||
|
@@ -309,7 +309,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
|
|||||||
ctx->video_st->time_base.den);
|
ctx->video_st->time_base.den);
|
||||||
|
|
||||||
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
|
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
|
||||||
if (videoFrame->GetPixelFormat() == bmdFormat8BitYUV) {
|
if (ctx->draw_bars && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) {
|
||||||
unsigned bars[8] = {
|
unsigned bars[8] = {
|
||||||
0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035,
|
0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035,
|
||||||
0x6ADD6ACA, 0x51EF515A, 0x286D28EF, 0x10801080 };
|
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_input = decklink_audio_connection_map[cctx->audio_input];
|
||||||
ctx->audio_pts_source = cctx->audio_pts_source;
|
ctx->audio_pts_source = cctx->audio_pts_source;
|
||||||
ctx->video_pts_source = cctx->video_pts_source;
|
ctx->video_pts_source = cctx->video_pts_source;
|
||||||
|
ctx->draw_bars = cctx->draw_bars;
|
||||||
cctx->ctx = ctx;
|
cctx->ctx = ctx;
|
||||||
|
|
||||||
#if !CONFIG_LIBZVBI
|
#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"},
|
{ "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"},
|
{ "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"},
|
{ "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 },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#define LIBAVDEVICE_VERSION_MAJOR 57
|
#define LIBAVDEVICE_VERSION_MAJOR 57
|
||||||
#define LIBAVDEVICE_VERSION_MINOR 0
|
#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, \
|
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||||
LIBAVDEVICE_VERSION_MINOR, \
|
LIBAVDEVICE_VERSION_MINOR, \
|
||||||
|
Reference in New Issue
Block a user