From patchwork Mon Oct 11 16:23:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31067 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3871093ioa; Mon, 11 Oct 2021 09:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8zuUO39g5yKztHIbQGboHOQqfqTSJUyN0u6l8u/8Lrn258O2Lf7Z5u0Ld+TtKtP654DPA X-Received: by 2002:a05:6402:4308:: with SMTP id m8mr42587685edc.188.1633969410764; Mon, 11 Oct 2021 09:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969410; cv=none; d=google.com; s=arc-20160816; b=iSrNn9ozRA9TrQs0CAE68eSm+hPvmuCgsHt+EKQckIyLQwFlcFBkaoMx/cdMWqJ5BY vZbkBZ7LOXecad0BUf9GZeKYvkxjtiVDF4M8f4DQdOBI/JNavSzlKvG3Pel3HkKT/5GP ukV4OTYpo9HoJO8o+Ib+0E/b6pl+oXbuyq2D+4CuiGL37SKxhqaOynrZUWq4MZCO+R35 VjGMYzvMJyFAg3SVnboqIAeg7ANBtdAnf8NrLxiRrT6rtNCeT5dDQRoH1eoL28G+WqFP Ina1kg2TGlhT9iRc9VfPgQO+eTiwn1oGEhLfmbF2Of1Oo/dvMyHlMBhP27WPThgy8u7c Zh6A== 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=B4YrD0c0H5RFD66qIQSXFY/hE//6g1+eaWT6HQDy50I=; b=RosblHsZn4PDHgi9CsXdqzvOhdvraojzS5f2/QQlI3jt0xSi7X4gPaoOFZpbKeYbwo oK9jfP68VWu8rejP1v4SnVKRe6gte9h/SOA+pjqSsjwsSHGU9HhIWc6csyyHb+9yp05b bXosOyaHNCsl2VWwm2bwXSOq5gSVnP9wIaFT9DkpcBQSAOdKAFxHLxrTPC+P/uz4KMef bYR6r/O+tiLr17qv+yG2vphq7rs2GvvzWc+PIZ1KsgIeeEh2UYzmDcc5bi9W7Bka3xY6 B+gtFeMo3rXCjdvEgzR8rTuB1gI+8gwn5B9HHLzTCWiCnB3ZKqOzgjxcRYbANi28ROM2 6N3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=pTDQRFTO; 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 dd5si18205493ejc.375.2021.10.11.09.23.29; Mon, 11 Oct 2021 09:23: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=@gmail.com header.s=20210112 header.b=pTDQRFTO; 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 522C768052C; Mon, 11 Oct 2021 19:23:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B126968052C for ; Mon, 11 Oct 2021 19:23:19 +0300 (EEST) Received: by mail-pl1-f182.google.com with SMTP id g9so1243272plo.12 for ; Mon, 11 Oct 2021 09:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cj4lTd2Rim5c7nx+6AH4rIoFqK3y8gkONlAOo6sZQck=; b=pTDQRFTOt5qfvUgmVNHVj5QZ/TTP4jJ4cFbd2J6O2MRv+tpD/4ggFY9WFmLD/JfDAG TNCKg9FLNYvtKqKBfg9iPRsDoO3nc287WZgGvITg5LA2kk2WJgYZ6k1jNqRO8AvkXvGQ bFaIrqxDpUUpMw3Lm2BxAnRU9mNFgB+RU4FMh3qBMQRWfivDUxw4vUbdpj780jQ3yjQ5 vH0gJV6yakJ1QJFaG6PJulelW3c/zO9o2xXfaF7zmEMfAzGojglVLQgbe9lCVo0TtkiT FpjQoWVdDxPmP2h/yG4ps1h+evSt5cUL0AGsTWG4aP/InZET6YFRH8H9tNmxHSLN/52p QmEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cj4lTd2Rim5c7nx+6AH4rIoFqK3y8gkONlAOo6sZQck=; b=hojyA1sDgZB4HEZ+eGS+4rc14PckIUHmndoWkMoKdcAwppxywoWJofcvMeoNaMrG9m Us74Ft+7fJrDy8G0f8A4xbDZQjGaGoE5uqjpbvGrLuejmx1/t/xM2YFDTVjeO104Zz7l xXEcEFXWnDEYnkSYZUoN0L9ehA+V2ggY4EhrFSuNCEXAUk3kB7xpAvYgrkgGEuLeDugM fRAhiRoZeKJaiHsHpchsP3OpZLEhIsCfNk0E/yuOxvm/2ro9nj4ed4GKQifYf7XfeV1B dGSD+BywYujUGwRHJ7yeY+IJ+sKGXXWiYXkpBa5+HuEuqezIN0/2l3OqohhfB7ZQUJ7W IXhQ== X-Gm-Message-State: AOAM532PaR55pGIJMxmAXciygYFr0p3wC1/bWLBsBHdGZlq3c/EBC85n asAbD2AMp/N4JNCvwp7ZLtu1eyeof9A= X-Received: by 2002:a17:90a:9404:: with SMTP id r4mr31263707pjo.240.1633969397558; Mon, 11 Oct 2021 09:23:17 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k17sm8459152pfk.16.2021.10.11.09.23.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 09:23:17 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Oct 2021 00:23:09 +0800 Message-Id: <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1633515251-5156-5-git-send-email-lance.lmwang@gmail.com> References: <1633515251-5156-5-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 1/4] avformat/rtpdec_rfc4175: add support for exactframerate 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: WM0SmfQAqKrm From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpdec_rfc4175.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index 712c683..060f725 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -25,9 +25,11 @@ #include "rtpdec_formats.h" #include "libavutil/avstring.h" #include "libavutil/pixdesc.h" +#include "libavutil/parseutils.h" struct PayloadContext { char *sampling; + AVRational framerate; int depth; int width; int height; @@ -69,6 +71,11 @@ static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) stream->codecpar->bits_per_coded_sample = av_get_bits_per_pixel(desc); data->frame_size = data->width * data->height * data->pgroup / data->xinc; + if (data->framerate.den > 0) { + stream->avg_frame_rate = data->framerate; + stream->codecpar->bit_rate = data->frame_size * av_q2d(data->framerate) * 8; + } + return 0; } @@ -84,6 +91,10 @@ static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream, data->sampling = av_strdup(value); else if (!strncmp(attr, "depth", 5)) data->depth = atoi(value); + else if (!strncmp(attr, "exactframerate", 14)) { + if (av_parse_video_rate(&data->framerate, value) < 0) + return AVERROR(EINVAL); + } return 0; } From patchwork Mon Oct 11 16:23:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31068 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3871229ioa; Mon, 11 Oct 2021 09:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdlPqfrCuT/Tr64+zmImtY+n8pffKFiheg0GTdlpb3bgrhAm7Se40b5ZvKfRU5CzMmNPDa X-Received: by 2002:a17:906:69d4:: with SMTP id g20mr27421210ejs.556.1633969419724; Mon, 11 Oct 2021 09:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969419; cv=none; d=google.com; s=arc-20160816; b=Btf0RMhzZku74GpY2StY/Ilr2xIkab7ucguNUPLiA2MDqybMVM/O5jjCtxMM19MoF7 vDPi+b23o5DXTR9+dOHEvdb9KBBzVB1yZEhRY3Y4GcB3xTOnl6WCI8ehLNYQAnf+W5wi WHfFyASTM6B0qkipgXZWjBG14C6xekEGTxzXr2KBimEvVy7O4qsfbffkHjQ9RxswKC69 hisXRFKcrTm/VvuS4wF3PnomyCvf4Be6Z70KDkWtzjYGZbFoT7Bs2r5sto6LkwG3Rz+Z seJdIREzkuuSFz97td9k1PuS7gEfzCARhkm8oT2ZwHoT+VrREk8EKxQNBt2Tpk6sk6VC pMqw== 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=9mLcS9D4cMttIIkrkIbuEA4GhYJ7DjYdVpC1/OGFaZE=; b=aWn+ABOC6vOtzNWgTtutQzn+c35Y93orXw7WYfdxv6fNO+rtDv9MtYUuN+uFfR9o9C phNDaCPMlvYTFFd3xhp1C48D+kDOgYosox4PqHZNf/Wiq9qaUZI3GtELBIjzOMmFZuS/ mirN+5hz1lAcvVyfhehx0XLqBjdK9jStL1OxkY64RelfkFOy3DMVvskQ6LH2GmuTbWsc Xt0/FoItaOd/maEVB+2TM7+UFC7ARibQoLR488LVeHPPnr7SHStCaV8CT9Rm7EBgky2a Z6Y/UPs0TvvVp5f5Z5rIyMVkuwMrqHsQHTg4JbrCexdJkneYNa41D0+LEwbTiJ9vHJji 4vdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=pmB5h43n; 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 d5si12180887ejm.652.2021.10.11.09.23.39; Mon, 11 Oct 2021 09:23:39 -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=20210112 header.b=pmB5h43n; 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 CEF1C68A8F3; Mon, 11 Oct 2021 19:23:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C59E5687F3F for ; Mon, 11 Oct 2021 19:23:20 +0300 (EEST) Received: by mail-pf1-f179.google.com with SMTP id c29so15280697pfp.2 for ; Mon, 11 Oct 2021 09:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xNxYhem0EuQ2JquPD1NsnPM18dk9wo8PRLKLTEGEN8o=; b=pmB5h43naFPUF43E+F/OKw4u0gKUrKUrKvXtAiv77FnQnkb+gxg0H+X9LBAF9bphf7 MnzG/NR1BSL38isnJrO+gQ5uPSWt7BmTjQdQGIAA8RuQGTyA+2KSAS2owxJWgUNfnYRa ntq4n097UoWGUTMhNN8+JuX7cH9kZvA/Df9VxO9d8pfZmU1QCiG+AvON2UwuWIDbT6vI 7wYJ6wo/1JnfYEoHOTpCz9dO5DAYLMOp1UmmcE1dy9Y8W0NuiDRwk9VkQmUXecn93smF 1+nNQzVhEaGwfqC7mfKT+7qC5JxsLzk1huI8TX9U+abSMhuoeJrDw45kv1PiugQBVlu1 tbrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xNxYhem0EuQ2JquPD1NsnPM18dk9wo8PRLKLTEGEN8o=; b=53AQXAYDdJB60F+RheAV1eepiqHMCXTFYMeDtVfwNugjNcLA9+/aCRR/+2A+oHv/+F E4lSIc3eJ4yRtOPL/kwBly6bHcCLbvRsBxVHhclLls4SWmw0Drt9Gt1IhFP1madhsG26 a+v0om9dkCw5rhMX9f5ieTNDm7I5M7xvD6AcamWqBJqi/Oasv6BP2UbA9U7pMrE0uoY7 JJmsmZgzy8yeYq1HjtyadN55ca5Gk0KngfdhkIg3AmbnfDjSZuIRta1PD+0nke8t8xDk 4rgNVlkLwjImhmFLKeB98UMgk4w/f/zyxM72DDwgGXrv/vbiY2NtZHs0z1FBNQYRYk9h hauw== X-Gm-Message-State: AOAM532AHNjm+gF5L9xNs4b5I5CLWFMiv6+WETXTg9HMI+RpQVV1AREh KSpoPnILf0FFKIJyQHvBEx8Shefu7m8= X-Received: by 2002:aa7:95af:0:b0:44c:b07f:4970 with SMTP id a15-20020aa795af000000b0044cb07f4970mr26495572pfk.23.1633969398799; Mon, 11 Oct 2021 09:23:18 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k17sm8459152pfk.16.2021.10.11.09.23.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 09:23:18 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Oct 2021 00:23:10 +0800 Message-Id: <1633969392-17937-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> References: <1633515251-5156-5-git-send-email-lance.lmwang@gmail.com> <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 2/4] avformat/rtpdec_rfc4175: add support for TCS 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: h6w/PFYQByne From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpdec_rfc4175.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index 060f725..d45530e 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -94,6 +94,19 @@ static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream, else if (!strncmp(attr, "exactframerate", 14)) { if (av_parse_video_rate(&data->framerate, value) < 0) return AVERROR(EINVAL); + } else if (!strncmp(attr, "TCS", 3)) { + if (!strncmp(value, "SDR", 3)) + stream->codecpar->color_trc = AVCOL_TRC_BT709; + else if (!strncmp(value, "PQ", 2)) + stream->codecpar->color_trc = AVCOL_TRC_SMPTE2084; + else if (!strncmp(value, "HLG", 3)) + stream->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67; + else if (!strncmp(value, "LINEAR", 6)) + stream->codecpar->color_trc = AVCOL_TRC_LINEAR; + else if (!strncmp(value, "ST428-1", 7)) + stream->codecpar->color_trc = AVCOL_TRC_SMPTEST428_1; + else + stream->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; } return 0; From patchwork Mon Oct 11 16:23:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31066 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3871393ioa; Mon, 11 Oct 2021 09:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk7D+VeqFFdlWsTjfAHdePmkwq6EL88JGWrbOEuVICl/2Hb7FEOz2dLnEMf4TV/MR1aiPe X-Received: by 2002:a05:6402:90c:: with SMTP id g12mr3395026edz.140.1633969429396; Mon, 11 Oct 2021 09:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969429; cv=none; d=google.com; s=arc-20160816; b=wEOwKy0a5EpzdnuiWOUHu0MYn4qRs/RCxahL5f8ZGHGgEPVdmwKrYmWz+iMLAhdDEX 0bgbwNa63ZmMAfyP3wcovh1cBH9tHmgEyEoE48OvG0tSpnd82J2R8d+zXZK78MRjsLN9 9DTgSHl5UGkcXMOl3Gjb0fphtg1HBdYON/LWkdfkecAV7haqufqX/QsuqAZwzde9+oaR QmWzqa0bRVdR9Xl0hhrm23S+7xxukyQHkQNz+NpH+cTkZ0hR3MfNOMez7zV8GNbSfhX1 CKyehDLAU9qrTbwhjaeXkTzNmvHFUX0vLC0kvyFPLWfwg/+KFvxGcrlUc1lejfmDM2Cb GCNg== 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=QpNX09CRlNqT6jnpmlFSwg/IUAzK8cdgBMyvfRAZS3c=; b=nG1V8FMhW+NrXw/rvWhU7dNZ+eK9D82mBV4kl5FOSlFA08dYKcTrN3mzN0pnlx9bFv uJd0fLVcXEaiyAuQ6NVBkCPC265E1P1rbs4P6VAE8eg1hLWKR9V350uvdmai2oCNAyZL VN+JBhLvpibF50y0TNUw+8DJ+KEdd0CPkkxqvl/qKSc22YeQ0doYbj3N9Pa2SAxBzfvv NSchaecb5SYzDGqeUCvWsViDPZUI7w7Ng0HeebkTCeVkrRAi/lhUomegCHvTJUprbRlR dVjjNBKxPlAqnFuvSSYt6LtVBfRS6blhzEgHf+qtI+UNd/rZbzzrpaQ4FK5eOZHlCUAI QJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=NnvaQUGr; 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 23si10829424ejr.127.2021.10.11.09.23.48; Mon, 11 Oct 2021 09:23:49 -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=20210112 header.b=NnvaQUGr; 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 C660668A920; Mon, 11 Oct 2021 19:23:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD04668A8B4 for ; Mon, 11 Oct 2021 19:23:21 +0300 (EEST) Received: by mail-pg1-f172.google.com with SMTP id r201so11301237pgr.4 for ; Mon, 11 Oct 2021 09:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gnt7YN5mT1Ra046wIOVKswOiDdmfrmoWqh+WdrFZSSY=; b=NnvaQUGrkCJz6HvchIPQbBI3cCdenIgGBefzV9f96KpPQSPgVaIIav+ziCsK/1ekMU HhYVvfLNSOwWIpI4V3GSN5/turih2V3M4YEy1d4Pbd9Jok0YzC/U3CUp6CWjVurTQ8vc NE/Z6To7nqmG1JtMZq6Rgcf4sJF+iOX/MOZBnIK+Rf9q6dKLCewgMjy40aBLBkPp7ukV hrJ/a/hxF13mue7RcSykHKw5MP1TjR+S4SFXn+FHi/R0dZ3Y72+nIw8Up0dBh2RMkoMF q61IKzUocv96bC47OTCSBY+1mSpbg+oMRFYOzmXEefHGV2KJVPaXQgkIoucdpSWVf+Wu rXWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gnt7YN5mT1Ra046wIOVKswOiDdmfrmoWqh+WdrFZSSY=; b=SPDHf1E6Cmbi1SP7g6pmw4gC8rIjkAyU3jLVXHfmbdOI728GnnLFp54pt7xC5nMjvN WcEywT8XGTxGXOZGmNyi9wfEZIDWqu2ZhroOBsEq2i6U6G0mQ7ji3UrpCQBmcPdoTNRz sCOgXSkewnttZj+NGQUdvJ/HTnu+gLsCU0tajWLtUbOJTGW0orsdzRmFS2jne0gx06vJ OeW8zbMHCKReXdcaSZ0Xqv0LOBHCilhxeT8HFKqKClCcADc7LhwrSkXIJwgNTOmAXSSZ sVAfkASr6aHza93ZJc5MIS1kx20pm428wGE+E7mtSbv5JvCQf/Yply02KKZgRikZ3aSU 8UTQ== X-Gm-Message-State: AOAM531VJtiBeNOTe2KSQbFFxXGvi+iRl/r/+glTHt4USm8k62kmGrb9 vPD0dg2UcJHCar7jWOBXKqsUwRulQr8= X-Received: by 2002:a62:bd09:0:b0:44c:8a7e:77a1 with SMTP id a9-20020a62bd09000000b0044c8a7e77a1mr26449805pff.66.1633969400125; Mon, 11 Oct 2021 09:23:20 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k17sm8459152pfk.16.2021.10.11.09.23.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 09:23:19 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Oct 2021 00:23:11 +0800 Message-Id: <1633969392-17937-3-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> References: <1633515251-5156-5-git-send-email-lance.lmwang@gmail.com> <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 3/4] avformat/rtpdec_rfc4175: add support for colorimetry 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: cNJX/g28Yx9d From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpdec_rfc4175.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index d45530e..93607d7 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -107,6 +107,17 @@ static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream, stream->codecpar->color_trc = AVCOL_TRC_SMPTEST428_1; else stream->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; + } else if (!strncmp(attr, "colorimetry", 11)) { + if (!strncmp(value, "BT601", 5)) { + stream->codecpar->color_primaries = AVCOL_PRI_BT470BG; + stream->codecpar->color_space = AVCOL_SPC_BT470BG; + } else if (!strncmp(value, "BT709", 5)) { + stream->codecpar->color_primaries = AVCOL_PRI_BT709; + stream->codecpar->color_space = AVCOL_SPC_BT709; + } else if (!strncmp(value, "BT2020", 6)) { + stream->codecpar->color_primaries = AVCOL_PRI_BT2020; + stream->codecpar->color_space = AVCOL_SPC_BT2020_NCL; + } } return 0; From patchwork Mon Oct 11 16:23:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31065 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3871539ioa; Mon, 11 Oct 2021 09:23:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzInkNC746pEhyFtCUZ3aydsl3ACFfXek+/06w3HQa45WMLqvmO9QqftR5CkNgQ8oZAeJVU X-Received: by 2002:a05:6402:354c:: with SMTP id f12mr29605636edd.170.1633969439038; Mon, 11 Oct 2021 09:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969439; cv=none; d=google.com; s=arc-20160816; b=w7No5USgEYlqzfqC4ylSXvSc643WQmMs3pgcbFgbNdeXynEAW7W8ZNrmpFwt1jf1Gf IZagLYAJ/py6RilDfoD82Me9/5YIF9+DVOdo/qmKkVBhqhds3l3HeNp/GVeNwEXYfurB owCamyPWeIUh6W2LwY9zhi5pJsT0wV5cQKl1Uh3cjmePnwPrJ6vUzsbLZNSHc6niZK/p rcWkb+VanNmx2q3xZt5MFX8Vt1hsqF294f6jHvQsqjVT5r+p1sT+NrDiI0sTfWq1fQ/I DsDrhV7ukRxNkDitEDpQEkRKgRCx9UBfWsMkAbp4FEa5gwovGSZRmcjWzFA1KklSoFNh SM/g== 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=Wt8fL+MxSoD+W3+OLYCiTefAr95FAidTMFQg1CrhW6c=; b=ttmzUqeNClGVwaQRk4J0OXE722zaUx8alU7bcHdVzJXD5k6pAKugUuPnDFd901e63o nJtKtGTCGSJj+YCIgHo2RMe5+ZH/RbPNA2Ow+gL/vMVf5JT0+eB7N2RUONbMIAkP/+sM eum/ldJusSjCrwP167eqF0kwVPIcd2dYJvmWj+tYsvbFGZrL583+Rl+qIeQH7XOizE0m FrRc5hae5+VcBaNhhGaYSdMs1XSxH4O1SM7o5j8u0OnsqapsVsy5swuAVjuYH2WpEdIz BGGDhJPOgXwbnLaedK1KasDAAf+pl+00dkD+9JTL2WB45cWCKSxpMbxhxFVWf6WKEk9s CYyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=AOFmIhn6; 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 c23si3687728eje.22.2021.10.11.09.23.58; Mon, 11 Oct 2021 09:23:59 -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=20210112 header.b=AOFmIhn6; 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 9A27A68A8E6; Mon, 11 Oct 2021 19:23:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24C5F68A8DC for ; Mon, 11 Oct 2021 19:23:23 +0300 (EEST) Received: by mail-pl1-f182.google.com with SMTP id y1so11630806plk.10 for ; Mon, 11 Oct 2021 09:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q3NxTD/l6ly4Jrozo0Q4W8td9XHgkkw0c+N71eG0aYY=; b=AOFmIhn6tRDbvzqL/3gF7AHkcArh9+IbQd46zzmGEPVpD6//G3wLQ3qhqlMLYZc7SP EfFlbKCUCwZgNPXaI1TwfFOJWuyg4BVOISGLkkdDdVRDXWebJw8fjdgNplbFf7zQBekQ Kwjr5dBCTC5Olh7uEJ1KcI14gbJli8Qd5/k9I5UfNPCXgr7ORUy9uEvp84VIaFSckynd xruoqYN9BvA8DDS833Jy5vKmgVS5sn9rZzSTz8dFxjYKwKLErs6Uky2NgMJ5vpIbOFII 4BgSq86ACfiY46zac+DKJQ3x73Nto6+ym8MSVJ3rH9X4qQGvr5vq+MUgZLNk8l9PWodI eNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q3NxTD/l6ly4Jrozo0Q4W8td9XHgkkw0c+N71eG0aYY=; b=c08D6nEwQ+hjj/KzY5Zcobov74ZpGmfyiW7sG744LFopNc4uiNrE0PzY99/TOSc6av 4V6OQCUvNTPRooyQFQfcQu89QKYnR2N/Av6gOK59SNNiN5gdyLx5SKe1DCYl++xJncjq NWOGS+LkoMLLIi/plg6tM9KJeiT6G8j+UWY0v+7Q6ttW2FqhRmrtDP3QLI1HkBL5OtE+ 7vjNfaAqnOPAEpvlDsB0mCQotFmBIp/IPk7tdF0ek9j2ZFwpQEGqGwFcAYg5RbI4nMHo frG9Y07q8vhM41rPKxg8SKsNWYh3l5nJtWo63eOkll32XB5kdgH1C25jOVEba67Omlva +TVg== X-Gm-Message-State: AOAM5313+1e3eIcyjnNy4G5mZreP2ywyzfWtRmpGx0nrt197qjXdB3QS ZpQYUGVNinqgdP5TXSdnA09deSICtzE= X-Received: by 2002:a17:90a:4502:: with SMTP id u2mr31358091pjg.186.1633969401414; Mon, 11 Oct 2021 09:23:21 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id k17sm8459152pfk.16.2021.10.11.09.23.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 09:23:21 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Oct 2021 00:23:12 +0800 Message-Id: <1633969392-17937-4-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> References: <1633515251-5156-5-git-send-email-lance.lmwang@gmail.com> <1633969392-17937-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 4/4] avformat/rtpdec_rfc4175: add support for RANGE 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: Nt0w9rxpBAsG From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpdec_rfc4175.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index 93607d7..f50cad7 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -118,6 +118,11 @@ static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream, stream->codecpar->color_primaries = AVCOL_PRI_BT2020; stream->codecpar->color_space = AVCOL_SPC_BT2020_NCL; } + } else if (!strncmp(attr, "RANGE", 5)) { + if (!strncmp(value, "NARROW", 6)) + stream->codecpar->color_range = AVCOL_RANGE_MPEG; + else if (!strncmp(value, "FULL", 4)) + stream->codecpar->color_range = AVCOL_RANGE_JPEG; } return 0;