From patchwork Fri Oct 14 18:46:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1006 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp43120vsd; Fri, 14 Oct 2016 11:47:04 -0700 (PDT) X-Received: by 10.194.77.237 with SMTP id v13mr3150357wjw.220.1476470823962; Fri, 14 Oct 2016 11:47:03 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l186si1053409wml.146.2016.10.14.11.47.03; Fri, 14 Oct 2016 11:47:03 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 346D268988C; Fri, 14 Oct 2016 21:47:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CF4B6687EBE for ; Fri, 14 Oct 2016 21:46:53 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DBB16102CBC; Fri, 14 Oct 2016 20:46:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JrwNIrRcbayk; Fri, 14 Oct 2016 20:46:53 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3F9EB100B24; Fri, 14 Oct 2016 20:46:53 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 Oct 2016 20:46:31 +0200 Message-Id: <1476470792-3926-1-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 Subject: [FFmpeg-devel] [PATCH 1/2] lavd/decklink_dec: add option to disable drawing bars on signal loss X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Deti Fliegl , Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- doc/indevs.texi | 4 ++++ libavdevice/decklink_common.h | 1 + libavdevice/decklink_common_c.h | 1 + libavdevice/decklink_dec.cpp | 3 ++- libavdevice/decklink_dec_c.c | 1 + libavdevice/version.h | 2 +- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index f693d7a..54f270b 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -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 diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index d2d0ab2..bfa2b08 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 3c5f218..d565631 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 24b42e3..5318bbe 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 56bc439..543d16b 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 94a34fd..8603bb1 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, \