From patchwork Fri Aug 6 01:24:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 29302 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp91932ioh; Thu, 5 Aug 2021 18:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQjvSKqaG6RDcLhZ0Hl6XyS3k2VVonQcxWjGlfxaQ49RAVOs4O2EQrVBF+e3zgCznRUtp1 X-Received: by 2002:a17:906:1ccf:: with SMTP id i15mr7659972ejh.120.1628213131930; Thu, 05 Aug 2021 18:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628213131; cv=none; d=google.com; s=arc-20160816; b=Xz9DFYGcnqIVZ0adBWmyX1QsCbmF3EmArJW9NMMAbEqGp2VdBaffK0lvVLVTERdVjy HjaiSIFr8endiVNBl8bDA0ciWk9zjMNBvwhhAqnvx6uh5YlMuzYB+FK6tJkFPUqHi87T d8xoxiZE/hE+MOy8dxtl/Prgy9JSjijyMBIljoLd4CxWoSrkTJolY3rD96LoAHYrIbOs jC3/37BO+6yP+UdRd/xH8w4Xeo212t334o+3QB1gFFBfPZFTJ0nQWy/9G3ina6zkj043 652lHz21CC2hRByg30urab8IVp/e74rfzm2OylpeJ5behvGxoO7nO71UtplpDSdIzj3d JmQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=6BADai24DLGqZ5lzxq+c/Wwl5C2iuKiuVfzJqTjpMak=; b=0FluS5Ml3jHGEZiO6GZAZsYxR5GBE9Q02buaYxL6s5PLeWl0+d/NETYavQR6xdhiMD nibK7WRfnz7kBtsOEoRTZQKMMEa/25vVBlt8zR9YrWmUzxkfTtgt597R3Ain5NHzUSUt pE8xvj//kPHzY7hTFrqFLLUwj0uyyXKmlboYo3fRoEe40w59a8mLtSS6FnkFmFRafvTm L7y4fmqBWGwxxsQwMNeIzGX7CHRbIw3yb8ytSJgrdwxct2hBnEVOwDga0gvxgnzRv5/S 2PfgQzUI+7ZVgTHR6cEN5e7TohdQOJ3z6bpDblRj8o71DLOWs4lQk/xWE22atLGgoAnT 5Ugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=KIfKNJTZ; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id du1si8077371ejc.712.2021.08.05.18.25.31; Thu, 05 Aug 2021 18:25:31 -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=@gmail.com header.s=20161025 header.b=KIfKNJTZ; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2CC4368A073; Fri, 6 Aug 2021 04:25:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B4FD689248 for ; Fri, 6 Aug 2021 04:24:58 +0300 (EEST) Received: by mail-pj1-f45.google.com with SMTP id s22-20020a17090a1c16b0290177caeba067so19433378pjs.0 for ; Thu, 05 Aug 2021 18:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QaUMxBghS8DejxAqsqo7Dk8ASEK+SyaVoq8Q9M85Afk=; b=KIfKNJTZyka1IAkWf01yUVT5fUNz5htZHSSl9WJErBnMP2+/6L6D0lHvjo3LMGg3QZ my/2knyLJSdIiuVgZHFkzqeGaqsQrTPHMewu7il24m8yYChdfte3TPiqEzc4WSZvReqG 1dKY3K8Mi2ieN5dG8vfDyTd5iA7GfgjOwPYTJQYfRE5l1TuMGtk4Do6nRmPlsr33Znu9 jlguywI3/b3MmaSW620pueRyk8K3d9Vy8YjDRkqxEfy00ikn518War4fyqQTtu8is3Ur xdEQQZleV/s7gvRQZwu2XoFJh6Co8HPL6xS61ZLSDA0AAZhkW9Es5yOkEg7rB4rC8hEC Ntyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QaUMxBghS8DejxAqsqo7Dk8ASEK+SyaVoq8Q9M85Afk=; b=hyPcupnN0uHZl6kskw4QtbPZIeB3MWmk6K+wIEgPdqg25qK4mGW88tDRxKSc01HluM uv0GgH6ySZQ3ce8qVPur5R9XVh7kBXWAB0gRGlzYBS92SEJTpFATBbJMphxctNo9x6nO q3LJflFgWqhkohkHFuvTZavI5dYaDKe5ghZ34JsKhlnIENwucRSi6HqBQ9gWyfjYarSL FTm24zN7KKOaQggno9GGv5m7JSpiJ7VBEmbUEsp50ZnkyWuyV3GW0uNmzXs61Fta06Qh aHxJmZwteZyxIwrNkYc/x1psOYYb70xAFIW4D5DFEk/94BXSMwpp/Rq/FgLlR/drx/qV iTtA== X-Gm-Message-State: AOAM5322DIuAVcOHwavMpyIY5/fRw1gG6OEa0zX6aHE870uSXjPjTI0v MtRy0OONQLiRvd2tqLN4Q8bgXv/Iuk0= X-Received: by 2002:a17:902:cec2:b029:12c:bef0:ec4b with SMTP id d2-20020a170902cec2b029012cbef0ec4bmr6378953plg.74.1628213095787; Thu, 05 Aug 2021 18:24:55 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id x8sm7426339pjn.10.2021.08.05.18.24.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Aug 2021 18:24:55 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Aug 2021 09:24:46 +0800 Message-Id: <1628213087-15896-3-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628213087-15896-1-git-send-email-lance.lmwang@gmail.com> References: <1628037188-8826-1-git-send-email-lance.lmwang@gmail.com> <1628213087-15896-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 3/4] avdevice/decklink: add levelA configure 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 5R7Jq0TbeBwx From: Limin Wang Signed-off-by: Limin Wang --- just rebase the code to the master branch to fix the first warning. doc/outdevs.texi | 4 ++++ libavdevice/decklink_common.cpp | 17 +++++++++++++++++ libavdevice/decklink_common_c.h | 1 + libavdevice/decklink_enc_c.c | 1 + 4 files changed, 23 insertions(+) diff --git a/doc/outdevs.texi b/doc/outdevs.texi index c4c1eba..dee9de3 100644 --- a/doc/outdevs.texi +++ b/doc/outdevs.texi @@ -214,6 +214,10 @@ Defaults to @samp{unset}. If set to @option{true}, Quad-link SDI is output in Square Division Quad Split mode. Defaults to @option{false}. +@item levelA +If set to @option{true}, SMPTE Level A is enable on the used output. +Defaults to @option{false}. + @end table @subsection Examples diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp index bb69a54..46e9768 100644 --- a/libavdevice/decklink_common.cpp +++ b/libavdevice/decklink_common.cpp @@ -234,6 +234,23 @@ int ff_decklink_set_configs(AVFormatContext *avctx, } } + if (direction == DIRECTION_OUT && cctx->levelA) { + DECKLINK_BOOL levelA_supported = false; + + if (ctx->attr->GetFlag(BMDDeckLinkSupportsSMPTELevelAOutput, &levelA_supported) != S_OK) + levelA_supported = false; + + if (levelA_supported) { + res = ctx->cfg->SetFlag(bmdDeckLinkConfigSMPTELevelAOutput, cctx->levelA); + if (res != S_OK) + av_log(avctx, AV_LOG_WARNING, "Setting SMPTE levelA failed.\n"); + else + av_log(avctx, AV_LOG_VERBOSE, "Successfully set SMPTE levelA.\n"); + } else { + av_log(avctx, AV_LOG_WARNING, "Unable to set SMPTE levelA mode, because it is not supported.\n"); + } + } + return 0; } diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h index fdaa1f9..d855311 100644 --- a/libavdevice/decklink_common_c.h +++ b/libavdevice/decklink_common_c.h @@ -50,6 +50,7 @@ struct decklink_cctx { int duplex_mode; int link; int sqd; + int levelA; DecklinkPtsSource audio_pts_source; DecklinkPtsSource video_pts_source; int audio_input; diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c index b26c93b..614a84a 100644 --- a/libavdevice/decklink_enc_c.c +++ b/libavdevice/decklink_enc_c.c @@ -40,6 +40,7 @@ static const AVOption options[] = { { "single" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "link"}, { "dual" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 2 }, 0, 0, ENC, "link"}, { "quad" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 3 }, 0, 0, ENC, "link"}, + { "levelA" , "set SMPTE LevelA" , OFFSET(levelA) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, { "sqd" , "set Square Division" , OFFSET(sqd) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, { "timing_offset", "genlock timing pixel offset", OFFSET(timing_offset), AV_OPT_TYPE_INT, { .i64 = INT_MIN }, INT_MIN, INT_MAX, ENC, "timing_offset"}, { "unset" , NULL , 0 , AV_OPT_TYPE_CONST, { .i64 = INT_MIN }, 0, 0, ENC, "timing_offset"},