From patchwork Wed Nov 24 15:27:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31624 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp10608993iob; Wed, 24 Nov 2021 07:30:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxGeFum2wivr9pJzXhiD171GRGHh0aRxhZmP7nOL10PuZStnzaLC6kPeu7zo4drzpYCWe3 X-Received: by 2002:a50:8d47:: with SMTP id t7mr26307542edt.14.1637767802533; Wed, 24 Nov 2021 07:30:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637767802; cv=none; d=google.com; s=arc-20160816; b=0NatlGV9tRqDaCWb8emLx46nXKvutgxCfWxS7oDVUrcwVsTPN3znb0oIhZWJNxDuRn J12gEjDGzzIaz+aqFP9RiWrR8pRGSXQAx3hTdJShrxWKMqNiG0ivMXqxwBwO/0yaimK8 L53zw9mjVe5X4+juzaGKQHCRmJWD9AZnPeLuB5dLcUjFfIH+0aF3cx4azPzgzBSqT7zt oa+Y4tf7OzapF/txPQ+2S5tPejbGcqJC+HzAXCsUyaP5UHEWGsukfQRXmymBtfZ+8Ytz BNsKf56JaxHAubYVW/cYSSuQzLinkj/4NFNLKto2gq1BxupP4TC20alugJxLcqgeXO16 7HUg== 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=5eRfnHY5Kz3YWWd0zeTHfhdfgKp9Ovsqc/ewN0yPkIM=; b=q9vfxNoQMCwXzj+/Qr9POcijjlxGzg1M7tluZTdgv/c1poeZbQxQhqJRAoGhbMdGeo 9tQEltes8KTL23iilX2RrTHtCJOJyHQWBiktYhlJ+J4TvlbR+DJtqHADst+pxnJaMor5 4eNO9l0MRx1sGzCEIji/bP7JfDFo2GIOQfWP7E5SyjestUJCQCuWhwzy7GT2MINZM2N9 HC7H0Px1XDgSY4mC5osOCtvz53FVdX/dM7cyX/IhMqYdzBWnLpUejn6zlCb6QqDyEguu Vkw4Pv5YrezuJBbP8wi5ieh2p+0+b+AaFF7A0RczQ5CP4Wjd2jbApYcC1qAi1rdrwDOg CUPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=i7orGvq4; 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 n8si501875edx.93.2021.11.24.07.30.02; Wed, 24 Nov 2021 07:30:02 -0800 (PST) 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=i7orGvq4; 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 4E5FC68AD5F; Wed, 24 Nov 2021 17:29:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB622689DEB for ; Wed, 24 Nov 2021 17:28:57 +0200 (EET) Received: by mail-pl1-f177.google.com with SMTP id k4so2128576plx.8 for ; Wed, 24 Nov 2021 07:28:57 -0800 (PST) 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=74PvtctsdkBFsmMIv/HdMD7HdlOjHjGqhgVw+O6hknM=; b=i7orGvq4xtw0FQbFiJPvYLcG/rPc6HMwv7Ttp/hQm4yhjDRTpCn/lU9+qr1LFcyct7 Une39DxBwGdJCz+NDJKhlndWZWy4Hc1QyI7s8fZ1xlKOh/M9yWEGph/5BG4nhfdFayO4 6KrYRoIl+czYWh3qVDK+tOvJaQ/f6m+BmNpEm0+8fl5qX2vgNDkJMHN7PPRCC/5694+d uPOeQyFB4Ft0cBasqiYPW8hzndyLyOqyokRFDsoHHV8fSWzIdlq8bkNIFBO70Gs7Ts3r wzv9ALwqJ2BQIjXgld4GhrTsG2urQyFOcDqq4uVRUawt7WCh+jSYY+WtY2QYnFepdHlJ SNTQ== 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=74PvtctsdkBFsmMIv/HdMD7HdlOjHjGqhgVw+O6hknM=; b=QhBZsdmRARf6gtA1iD7Hm4kNmH9AIy+sV5W0I9GSt7n//mCYjKZtESKTjPNmc0Q2Ac t+UvB2Kh/Ql8C6MoPhmrUtE3eDUbdqPtWrS69LGgZKId8xWZQ1yVSLC8YoI5IGB6gBFW O9GzhveelShZZ6K2zIxfnW3xSg2xKojiqFKUj+Tmox8DZkNdwwavLw8OL5Cz9Rcn5V3o 4knoJjpnQysLXZ4sfFsgdvoIOdctDm+/8drw7Dhbisl8e4VRatBt5De+fsJc2Eyl9HpF cwmUSfoUgMtzgxttf8b7n0Or8emCIMWKk1+CmWKAaSG2oGILJgUP/VO+0rSRxHqtdamj 1cyA== X-Gm-Message-State: AOAM533X/zjz2HDoCfbVqPIaZ0JPqnrGdMdhvpMnITi3h6l9v92Pcn/L NvjF9QPls2tuyE1v2cN9lWPOvfIuAdk= X-Received: by 2002:a17:902:e5d0:b0:141:cdfe:97d7 with SMTP id u16-20020a170902e5d000b00141cdfe97d7mr19234388plf.65.1637767736016; Wed, 24 Nov 2021 07:28:56 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id b6sm83842pfm.170.2021.11.24.07.28.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 07:28:55 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Nov 2021 23:27:44 +0800 Message-Id: <1637767665-6777-6-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1637767665-6777-1-git-send-email-lance.lmwang@gmail.com> References: <1636712536-13114-1-git-send-email-lance.lmwang@gmail.com> <1637767665-6777-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 6/7] avformat: suppport for 4:2:2 10-bit for rfc4175 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: OSnJlFejamT4 From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpenc.c | 2 ++ libavformat/rtpenc_rfc4175.c | 4 ++++ libavformat/sdp.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 4f115cc..17f5d9d 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -85,6 +85,7 @@ static int is_supported(enum AVCodecID id) case AV_CODEC_ID_SPEEX: case AV_CODEC_ID_OPUS: case AV_CODEC_ID_RAWVIDEO: + case AV_CODEC_ID_BITPACKED: return 1; default: return 0; @@ -620,6 +621,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) case AV_CODEC_ID_MJPEG: ff_rtp_send_jpeg(s1, pkt->data, size); break; + case AV_CODEC_ID_BITPACKED: case AV_CODEC_ID_RAWVIDEO: ff_rtp_send_raw_rfc4175 (s1, pkt->data, size); break; diff --git a/libavformat/rtpenc_rfc4175.c b/libavformat/rtpenc_rfc4175.c index 6fa34b6..4623b4a 100644 --- a/libavformat/rtpenc_rfc4175.c +++ b/libavformat/rtpenc_rfc4175.c @@ -37,6 +37,10 @@ void ff_rtp_send_raw_rfc4175(AVFormatContext *s1, const uint8_t *buf, int size) xinc = yinc = 2; pgroup = 4; break; + case AV_PIX_FMT_YUV422P10: + xinc = yinc = 2; + pgroup = 5; + break; case AV_PIX_FMT_YUV420P: xinc = yinc = 4; pgroup = 6; diff --git a/libavformat/sdp.c b/libavformat/sdp.c index cc04d70..5ad2a54 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -660,6 +660,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int p->width, p->height, pix_fmt, config); break; } + case AV_CODEC_ID_BITPACKED: case AV_CODEC_ID_RAWVIDEO: { const char *pix_fmt; int bit_depth = 8; @@ -668,6 +669,10 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int case AV_PIX_FMT_UYVY422: pix_fmt = "YCbCr-4:2:2"; break; + case AV_PIX_FMT_YUV422P10: + pix_fmt = "YCbCr-4:2:2"; + bit_depth = 10; + break; case AV_PIX_FMT_YUV420P: pix_fmt = "YCbCr-4:2:0"; break;