From patchwork Tue Apr 23 08:25:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riedl X-Patchwork-Id: 48235 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:2d06:b0:1a9:af23:56c1 with SMTP id tw6csp276899pzb; Tue, 23 Apr 2024 01:25:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUmL3dVqVXzSimXa87/gXQDKpf4ttG6pXAyYZkFuhOxlmCJOIbETAehJqywH/SKwBsT0ct3bhlfeDkvzVnrDFegq+Q7WAnWDm5TKw== X-Google-Smtp-Source: AGHT+IGVixkMNynLeMZS1wuyHlx2EwrDLt5hx6t64VRaDJC/XA+U73SCGAjVHOGk0Hlzc+6AbeM3 X-Received: by 2002:a50:9f61:0:b0:570:1062:2b5f with SMTP id b88-20020a509f61000000b0057010622b5fmr8369332edf.2.1713860730520; Tue, 23 Apr 2024 01:25:30 -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 a19-20020aa7d753000000b0057023a3bd10si6647704eds.179.2024.04.23.01.25.29; Tue, 23 Apr 2024 01:25:30 -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; dkim=neutral (body hash did not verify) header.i=@nativewaves.onmicrosoft.com header.s=selector2-nativewaves-onmicrosoft-com header.b=huvCePlV; arc=fail (body hash mismatch); 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 D5E7868D3A7; Tue, 23 Apr 2024 11:25:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2134.outbound.protection.outlook.com [40.107.8.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 95C8468D2A9 for ; Tue, 23 Apr 2024 11:25:15 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T8NCUHpCINjWJu9dN5wfVDW0A1JZLbw89nFzhpkq8PrgrY7nkFsXSXDnQ2jRwQAOm63fXu4VlGWyBoEywdWI5T76ke2YLx9OkAtlUTCXE2kz2CCGHto+u6WMtBQfFwHBZGwhfcdp+fbq16/Q++eEesYxJf2/ogvB8xVp/QtHjh6/Lmt8vj0//EMGSI67p/6+cdt8wVjNRzZBLyiAZzgUz16qrlHKNo/LD/hd2M8lpOvIBrk+1Vu1rX/YWBJq9DZzGoD1fL8eFNOEkBRr+4q+GR8saBuy7NWfaEv+PGz7LvMB2HAZwwV54KSZipnktFGs98eCkcDFzxhj2xQxls7COA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8N7vyZTgTj6RtQuGBpS0yAEocYkU8xqE1CIOsHNid8k=; b=gsFTqmRw/+EUHtNSxzhW9tjd7MIQccm+gpyw5W8wRAA+parZBZ09lCq3kniOZjmHrthe61IilAjdgBSsbHMDNdo4SMcYfh+UutL4Eikj3UlZKgky3l7zpWiAGM56ITEOU6VcmKGCilnq4EffqrS8H/F9Y8HRT0hbz+3oHaindQ3bOUsz95VoRKI9DHmSn/PvnDUWyZbDjw30HJhUjVF77kpbnhsC1qi6xHx1kXcdUwHHZHPFm70QciBbcHs9b+zWUE1+1ABVHPb+sqWWFOxKUKFN2pcanfvdM0PInph8K7j9jCNIC/KrDH7YCYZmWU+XGkvG4NccqsHu8yUzSu4U5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nativewaves.com; dmarc=pass action=none header.from=nativewaves.com; dkim=pass header.d=nativewaves.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nativewaves.onmicrosoft.com; s=selector2-nativewaves-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8N7vyZTgTj6RtQuGBpS0yAEocYkU8xqE1CIOsHNid8k=; b=huvCePlVWyBVzMBiGdf73DrB/LUq0SVY9CeoXLFzceUrAL2gPMvyEX2kiZWlazFnYpvc0vPiQRWGaklQTwFNZpTv/9CDi1q2OG9+l7tzs6i5U0EDOVSgsaz746wTkswLhYiPouXncGigTeYGQoU/k0TnSzJ0IxWekOV42ZRpJWw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nativewaves.com; Received: from DB9PR03MB7673.eurprd03.prod.outlook.com (2603:10a6:10:2c2::17) by DU0PR03MB8933.eurprd03.prod.outlook.com (2603:10a6:10:475::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 08:25:10 +0000 Received: from DB9PR03MB7673.eurprd03.prod.outlook.com ([fe80::d133:f032:3270:cb45]) by DB9PR03MB7673.eurprd03.prod.outlook.com ([fe80::d133:f032:3270:cb45%3]) with mapi id 15.20.7472.044; Tue, 23 Apr 2024 08:25:10 +0000 Message-ID: <1c80d825-5046-4108-87b4-ae5f5f1a9ac8@nativewaves.com> Date: Tue, 23 Apr 2024 10:25:09 +0200 User-Agent: Mozilla Thunderbird From: Michael Riedl To: ffmpeg-devel@ffmpeg.org Content-Language: en-US X-ClientProxiedBy: VI1P189CA0025.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::38) To DB9PR03MB7673.eurprd03.prod.outlook.com (2603:10a6:10:2c2::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR03MB7673:EE_|DU0PR03MB8933:EE_ X-MS-Office365-Filtering-Correlation-Id: e80ccc86-493d-4430-0abf-08dc636ee3da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Yq/5OvM1hH1MgN2w4dKQU19hR8rCi1R?= =?utf-8?q?vlImTN0YMWF8Oa6g5YlKdt5nuOnAmOwXunEVpmkbcIvEC+s2IBvzOyWVmrklPyTLY?= =?utf-8?q?arMKvphGtbRw38Nje0L27q96MWzeL6u6frqfXFQTLWoYJZUWNrdcaKQNAK6bFTXTi?= =?utf-8?q?DCynAwN1sl83+HA4/UQjYGeydzdQ1jnHHQagRXQYu6vm7BYoDr8hVjn+jtm4Jtg5M?= =?utf-8?q?O5EhE8xAM/m44fJeYMEQm844R8Q/ooFQCvv8rBXE3YfndmHzcs+VCtYkHi+35VN6q?= =?utf-8?q?+cbuCMyk6mm4YtZFZh4SNfbn3AvX9/gA9MKszts9yNEC/Wocf64fGGqRsteiGKRCP?= =?utf-8?q?ATodycx1WEdvCF5RklIkbtv7Lmoqmfu1snXqVhIsJH5fxiO5czOCdMd5uK7N3XR51?= =?utf-8?q?m0FFUc+J/c9K4ywg5sox7zF0HwWfdOoBv1YQGsm3x3Dt6Tn6tqK1YSqMp5lJcv65g?= =?utf-8?q?9cglp0iKAAResESPkn1la7N3jRj2+Qkvzb/QiMYoNTGS1yYOBuOTymxJB/ji1Ssmj?= =?utf-8?q?snC6kYBRZwpcyfcKAkQ0mrhNvzn+Pgq8tRt6cvXuPtqYavyg+QALzktgQkrJ8tZJO?= =?utf-8?q?X149Byr+h0GISI68E3cPZqEP97ztIJwTNeWnHLd+vrCS6DUCr3Ok6pW4EGKwMKBZf?= =?utf-8?q?wBJHrcWfxkebgqERaijksOsqrMDjHRLNC4iPB/FecMbCsoIeEJvt28MGvlIEVTfHC?= =?utf-8?q?R65BOY5SBtpIeEO/WbBeiXl3udo5w/pW6ZOt7ANxK41VizEAIqJ1fx8UmmtxMj9U7?= =?utf-8?q?dI9bmWWYisEq76dcv/rEZFhzX7o7H8RmYebyEoXPA/4QZqX7m1Wawkf2Da/T83+cx?= =?utf-8?q?4Me+G6WGZgFoMO0Di0jFKam7XC8DCzF0LG/PAFSCHmvxr3kgw9UPRsP3i77u7C7IJ?= =?utf-8?q?w7PxmrFVYEeKUziqyodZ71r1lEUqBsBDJPM+F4HvbUeTa5pONQamk1xkN/0wGepkH?= =?utf-8?q?lxNQTk61uJZ3cXtOs36MQvSK9DDEtPrQNlMiETgCnReWAQCC6ztmEHMvipg4PAH4k?= =?utf-8?q?lpEzPiIY/EKE4YJGH0ZVEStmnOPIQ7Z4+kT9wJT0dS02yUVqfKTLu3q4h6/BWEOHL?= =?utf-8?q?97t/IR1MurvZ85t7zW2rwVDWJRTCP2M9qQWapetNbHq1+3w0/OkPR+lbLWC26U06E?= =?utf-8?q?xPntGZ2RQGpVUwvN56IwlGCTbCZGEuuVkC4TMGtutTSpP5hOYtnUsCDK1muH+U7Gm?= =?utf-8?q?ZZvWDK84BWz8BQnOiDla9znnF7kZXxHVktKA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR03MB7673.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KrlGRKt7C83bkneaq9cVPQC7JCt1?= =?utf-8?q?uKmj2CgiYyN3n6ugjQfhrt2BA4bUMhRJgc+gD362YWI6eeleOSsVCqll1iFEQk+NO?= =?utf-8?q?L5sYKVWUy2WrcxhDCjuXUYjYMDRZhsiQVRzq7jBFJk1xILx7BxhySjvAnW4ILM6ek?= =?utf-8?q?/Wq/6HdXtiNV3onDfOn2ab3pYo/nOkmWXzo4llhy1Fanvws5QTDrrkUmRdhW2Y3m8?= =?utf-8?q?Qyot1O9NBz2TidhmM6Pvk3B9zpUPcfRugjhyGIcNsR4lBZztkZbxvCp+JbB8TPRWi?= =?utf-8?q?CxRmGah4HLDk/kd4jJD9ZJOn+59+PhuC0Jq54vNzqeyTDbIZwtm3JZncVk0/KY+qS?= =?utf-8?q?ATNRTZ1+sVj1kx7wxf+8QHzz9SEQ+mVSRS8650fRLLtwqRsvE5/nF8Sb1d3LaoTwe?= =?utf-8?q?2XaAFkrwD+Mx6LAsVw8FfUp0/tjqI+iTAsWwVrXel9dAZ+HMCVGIp1XvDkDbLkaHv?= =?utf-8?q?2sf4VN9AsX/Kd1Knyih+Fm9cPT3WIw+Z6gFVgOCTYCaiFyB0TSXNiXmQRrXPYQOvZ?= =?utf-8?q?3ctVmOXyLOnStFirx33d0H5duc3ThOVrSuv4ej+xEVONDUKToju410clS9Vmy7h7f?= =?utf-8?q?NHFbuP+gsqGA7KAjVEujJZG7s/6mitwVEvIpjPm5wstxVll2t+nT2wEp3TQwdJ409?= =?utf-8?q?+SUWhobtNAT7FNhhfdxjjJzxyHWc64OpY7lwKRWqhQGc0U9vjf5MSa/SUADcgJCfC?= =?utf-8?q?IBHPXl1Jq4lj7RTuvjpvqlr/C8bt0mZ+yzolq+q/Wn5zEg2J9cfZ/gRuHkmBkH26p?= =?utf-8?q?2euZZCc67IC7yhjhyHescwnvdoMirqaZsQhxnIfjVwFG4byWKRwMXITEVEYY/L2qH?= =?utf-8?q?hcq/Vf9KvuFuajZSUH5edq5d2y2n8xUeTtl0wZ7rfSBs7i8C4n+FbjTxvUffQf9Tw?= =?utf-8?q?3gnrLO7pZxPA91lUdZbsTGrcRL1MDfR8H/Q+ZyIKB1Kj1VQrD8S6pdmpazSK4lliu?= =?utf-8?q?+fj2FxT8AJy1YSygs+4OT24IZkkrMf0eIle+zBYJmtW+duzK+ppgy382iMFUzmZdF?= =?utf-8?q?/VY1KR39iVRPvCT4dUBgotcGnG8zVF+blk6rm0uJgg1xsuaLuwiXnfJ+LPJwTJhur?= =?utf-8?q?q/bd0xfO0GekVAMcmuoFZgPNxhmkdlDEh/OVSEH/SZpcG5rxHMCDVs+2dbukkrn/C?= =?utf-8?q?NiIxCyUvH8Wrt1Yn8zkl0jAZhMZX3cW3mRa2jWEfCC3iPS+yhteG95vbJ1/ItuxQL?= =?utf-8?q?0TV/wHhImmEnaB8xfpuRZ35TrxVefwyNeUW9PYehZSDKz2LO+4BEUMpxyMerweFJG?= =?utf-8?q?lFEa1PmXmpz562kPSw3CjPoK/B2A7xG14JJ7PWQl82ZEkWBWhTfh0iaLhqTN8DSzW?= =?utf-8?q?SU07W7wRQzbdI5cxumgh2bFKcprZgST5LVS0NBwxdz0n54Bbkv/GFZ1wvJVdt75Lb?= =?utf-8?q?7BezS/N8YvpwlHjmYRVZtvnoV6VmZ0Ef3nlm6rNqn5LGTKJ47XDIZU/lhPEuI3Fkd?= =?utf-8?q?kqau8br004xiYRJFTus2iWyeYxxQ83kdkNb277VhnHBnZUDJEHiSdYWGY8J4U7Y7d?= =?utf-8?q?dJIZQtUrtyc8tTromizuB7PNJyYHZyWjYZZ2eEFgfwmP7t8uN44nyr8=3D?= X-OriginatorOrg: nativewaves.com X-MS-Exchange-CrossTenant-Network-Message-Id: e80ccc86-493d-4430-0abf-08dc636ee3da X-MS-Exchange-CrossTenant-AuthSource: DB9PR03MB7673.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 08:25:10.1301 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4239718-b000-4513-8314-02ef46bd0276 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y0KyQtXEQOsNFcBJ8tpz9a+QOnkBXzBVrOEYmad/s0KzbHoUx4aQ08KUrj/JvMYxx2LN7h5Y/nEL7gHTjWJYKpK98DYL2E00Eeog/d/UPwM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB8933 Subject: [FFmpeg-devel] [PATCH v2 1/1] libavdevice/decklink: extend available actions on signal loss X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: RGkLShQ5P53a Deprecate the option 'draw_bars' in favor of the new option 'signal_loss_action', which controls the behavior when the input signal is not available (including the behavior previously available through draw_bars). The default behavior remains unchanged to be backwards compatible. The new option is more flexible for extending now and in the future. The new value 'repeat' repeats the last video frame. This is useful for very short dropouts and was not available before. Signed-off-by: Michael Riedl --- doc/indevs.texi | 16 ++++++++++++++++ libavdevice/decklink_common.h | 1 + libavdevice/decklink_common_c.h | 7 +++++++ libavdevice/decklink_dec.cpp | 23 ++++++++++++++++++++++- libavdevice/decklink_dec_c.c | 6 +++++- 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index 734fc657523..cdf44a66382 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -396,6 +396,22 @@ 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}. +This option is deprecated, please use the @code{signal_loss_action} option. + +@item signal_loss_action +Sets the action to take in the event of a signal loss. Accepts one of the +following values: + +@table @option +@item 1, none +Do nothing on signal loss. This usually results in black frames. +@item 2, bars +Draw color bars on signal loss. Only supported for 8-bit input signals. +@item 3, repeat +Repeat the last video frame on signal loss. +@end table + +Defaults to @samp{bars}. @item queue_size Sets maximum input buffer size in bytes. If the buffering reaches this value, diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index c54a635876c..6b32dc2d09c 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -147,6 +147,7 @@ struct decklink_ctx { DecklinkPtsSource video_pts_source; int draw_bars; BMDPixelFormat raw_format; + DecklinkSignalLossAction signal_loss_action; int frames_preroll; int frames_buffer; diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h index 9c55d891494..53d2c583e7e 100644 --- a/libavdevice/decklink_common_c.h +++ b/libavdevice/decklink_common_c.h @@ -37,6 +37,12 @@ typedef enum DecklinkPtsSource { PTS_SRC_NB } DecklinkPtsSource; +typedef enum DecklinkSignalLossAction { + SIGNAL_LOSS_NONE = 1, + SIGNAL_LOSS_REPEAT = 2, + SIGNAL_LOSS_BARS = 3 +} DecklinkSignalLossAction; + struct decklink_cctx { const AVClass *cclass; @@ -68,6 +74,7 @@ struct decklink_cctx { int64_t timestamp_align; int timing_offset; int wait_for_tc; + DecklinkSignalLossAction signal_loss_action; }; #endif /* AVDEVICE_DECKLINK_COMMON_C_H */ diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 671573853ba..1c2d08ea9fc 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -593,6 +593,7 @@ private: int no_video; int64_t initial_video_pts; int64_t initial_audio_pts; + IDeckLinkVideoInputFrame* last_video_frame; }; decklink_input_callback::decklink_input_callback(AVFormatContext *_avctx) : _refs(1) @@ -602,10 +603,13 @@ decklink_input_callback::decklink_input_callback(AVFormatContext *_avctx) : _ref ctx = (struct decklink_ctx *)cctx->ctx; no_video = 0; initial_audio_pts = initial_video_pts = AV_NOPTS_VALUE; + last_video_frame = nullptr; } decklink_input_callback::~decklink_input_callback() { + if (last_video_frame) + last_video_frame->Release(); } ULONG decklink_input_callback::AddRef(void) @@ -773,7 +777,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( ctx->video_st->time_base.den); if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) { - if (ctx->draw_bars && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) { + if (ctx->signal_loss_action == SIGNAL_LOSS_BARS && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) { unsigned bars[8] = { 0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035, 0x6ADD6ACA, 0x51EF515A, 0x286D28EF, 0x10801080 }; @@ -785,6 +789,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( for (int x = 0; x < width; x += 2) *p++ = bars[(x * 8) / width]; } + } else if (ctx->signal_loss_action == SIGNAL_LOSS_REPEAT) { + last_video_frame->GetBytes(&frameBytes); } if (!no_video) { @@ -793,6 +799,12 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( } no_video = 1; } else { + if (ctx->signal_loss_action == SIGNAL_LOSS_REPEAT) { + if (last_video_frame) + last_video_frame->Release(); + last_video_frame = videoFrame; + last_video_frame->AddRef(); + } if (no_video) { av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - Input returned " "- Frames dropped %u\n", ctx->frameCount, ++ctx->dropped); @@ -1074,6 +1086,15 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) ctx->audio_pts_source = cctx->audio_pts_source; ctx->video_pts_source = cctx->video_pts_source; ctx->draw_bars = cctx->draw_bars; + ctx->signal_loss_action = cctx->signal_loss_action; + if (!ctx->draw_bars && ctx->signal_loss_action == SIGNAL_LOSS_BARS) { + ctx->signal_loss_action = SIGNAL_LOSS_NONE; + av_log(avctx, AV_LOG_WARNING, "Setting signal_loss_action to none because draw_bars is false\n"); + } + if (!ctx->draw_bars && ctx->signal_loss_action != SIGNAL_LOSS_NONE) { + av_log(avctx, AV_LOG_ERROR, "options draw_bars and signal_loss_action are mutually exclusive\n"); + return AVERROR(EINVAL); + } ctx->audio_depth = cctx->audio_depth; if (cctx->raw_format > 0 && (unsigned int)cctx->raw_format < FF_ARRAY_ELEMS(decklink_raw_format_map)) ctx->raw_format = decklink_raw_format_map[cctx->raw_format]; diff --git a/libavdevice/decklink_dec_c.c b/libavdevice/decklink_dec_c.c index e211c9d3f4e..b8cdb7bd8e1 100644 --- a/libavdevice/decklink_dec_c.c +++ b/libavdevice/decklink_dec_c.c @@ -95,12 +95,16 @@ static const AVOption options[] = { { "reference", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_REFERENCE}, 0, 0, DEC, .unit = "pts_source"}, { "wallclock", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_WALLCLOCK}, 0, 0, DEC, .unit = "pts_source"}, { "abs_wallclock", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_ABS_WALLCLOCK}, 0, 0, DEC, .unit = "pts_source"}, - { "draw_bars", "draw bars on signal loss" , OFFSET(draw_bars), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, DEC }, + { "draw_bars", "use option signal_loss_action instead" , OFFSET(draw_bars), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, DEC | AV_OPT_FLAG_DEPRECATED }, { "queue_size", "input queue buffer size", OFFSET(queue_size), AV_OPT_TYPE_INT64, { .i64 = (1024 * 1024 * 1024)}, 0, INT64_MAX, DEC }, { "audio_depth", "audio bitdepth (16 or 32)", OFFSET(audio_depth), AV_OPT_TYPE_INT, { .i64 = 16}, 16, 32, DEC }, { "decklink_copyts", "copy timestamps, do not remove the initial offset", OFFSET(copyts), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC }, { "timestamp_align", "capture start time alignment (in seconds)", OFFSET(timestamp_align), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, DEC }, { "wait_for_tc", "drop frames till a frame with timecode is received. TC format must be set", OFFSET(wait_for_tc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC }, + { "signal_loss_action", "action on signal loss", OFFSET(signal_loss_action), AV_OPT_TYPE_INT, { .i64 = SIGNAL_LOSS_BARS }, SIGNAL_LOSS_NONE, SIGNAL_LOSS_BARS, DEC, .unit = "signal_loss_action" }, + { "none", "do not do anything (usually leads to black frames)", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_NONE }, 0, 0, DEC, .unit = "signal_loss_action"}, + { "bars", "draw color bars (only supported for 8-bit signals)", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_BARS }, 0, 0, DEC, .unit = "signal_loss_action"}, + { "repeat", "repeat the last video frame", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_REPEAT }, 0, 0, DEC, .unit = "signal_loss_action"}, { NULL }, };