From patchwork Wed Nov 24 15:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 31626 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp10607722iob; Wed, 24 Nov 2021 07:29:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw80ZKtNaOssi9Isf8z148A8/mn8aGKJawacSu19CnF1Z2V6+AUOmFRsmI9rova3KnkyU8U X-Received: by 2002:a17:907:72d4:: with SMTP id du20mr22246589ejc.419.1637767755017; Wed, 24 Nov 2021 07:29:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637767755; cv=none; d=google.com; s=arc-20160816; b=wE9zp93TbJ1wgsjqmGSZ0yGvseLtx7efAVTiEQ/hbXqx+W8izO4ET6uVKXjeIEuHzR UCDMFoD5gZW14m4krEkOVDpsQkFAdZ/mkdUIzpExq2OuWHg9Y5U1PHJNdeRPG/7bUVrs 0tDGY0BugT+v44fCagtYauOLAw7dH6TONUbyzb8aIZU0az59B5R1eO20l6hDgLhVO3/J 263nIsOzjtgxkW5iNrFbZ5TQltI7Vg+CYyTkbhfb4ZbdT4wHI58ZXU0ogfIdhejpiirv 9Adwu/STFAQ4jDuoWRXBGEQbYcHNzZ2sY0oojKy9MHxUXzp/YCd3KKZrK27j4vV9QTDz P9pQ== 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=J6AgaSuGEXFFRZAQeAKt1kNJz2J6/YGFmcQCpHi/efU=; b=N9wlmpA5X9oAeviVmerHQPEKePqlhCXSgd4mct5J8ekci83sP3P6FlQ8Qp1l+gDVOW QRcctWzX/3VG4y4I/4Ql0tm3lSLWH/rDnq6hksVdt2RP0Gh8ynkrm8aaMM43OpjynVXq rtcfZizZYpwYqv2GGunzH00X0wy1emCnYKhH2bdF3sFIgimIJL5H01d5UG3EOtB1h3JA BqJHxRYKRCgjHtbJnLHfwlLED8BKXY97xRUDkHWE0Sj+TTnr2bBsT2p5j3HSL6XWNs+N BLbqj82F3wDrFxwfT7IOrA9CtawMFXoi+lpoeQXxx2uJES3u2+aPzTfcaG4wVhkXHirD toow== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=fq+eeIKY; 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 z6si503376edd.85.2021.11.24.07.29.14; Wed, 24 Nov 2021 07:29:15 -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=fq+eeIKY; 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 AF9B268A636; Wed, 24 Nov 2021 17:29:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8372E68A05B for ; Wed, 24 Nov 2021 17:28:52 +0200 (EET) Received: by mail-pf1-f175.google.com with SMTP id b68so2971587pfg.11 for ; Wed, 24 Nov 2021 07:28:52 -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=u+0cM0SW0M3cvko8JwlMmL+MFoVL8qfvYm+Vrznu7lQ=; b=fq+eeIKYrgv0/hkwwwY3swpeggTalgzmSRxvqdZVxrHXHJ6g8+K2kyT5qwYJF7dLYF 3Ol9pkbU9zM2WmXmdOsLRL3nNqAUhGK8Vc5e5XsNwrENC6ucLKpFATr7p3FkT8g+QROT dJaSVLBpJWzZe9NhpxJkFMXqc0v4HI2gaY4TZH7DxxkZLcj/aZFg1GYuPlr06b0WC3m+ Q84CmIfsujbvLXOI4PdcPxt/SkpszhBcJlxNmXc8zPa+htBStE8b1z8116rApH2T/vtx sr/ePgZ8nVj9Vs6qCK+aGK+e8se/azFhrmMX/7ldG/an/qVPlYNTjq5iMcxX/WI++82D QAEQ== 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=u+0cM0SW0M3cvko8JwlMmL+MFoVL8qfvYm+Vrznu7lQ=; b=ktwnS2Hoj7Y9G2eYvzcY9taVEzjjtuDeRl7/XqCGK+ungeG3Go4C7R77tWnuWibrg7 JSrBM59MvPaaXzenDQ08a5f/+ZB4yFIOS5bEJK9a7pQ4PHx1Ddo90Amh5R9v6GGJdA8P gW4yG6gy5P93YgCI7dZNvokST3EvgBOOxCps3t+ClAxjUIPhxDsZEmv7gs9OrbKlGvOP BwwDdhfb4LZfNI+ZpY14Nt/i8dPoJJ3uFPTjXZo6I5naYSOrGp3Y0wYj1ihSbN2CUoWY LCo6GoI6fBq0JFo6tbkGDWUmk3YkRsDLdlJbE4/c1WuauOZbsv4vQ6f6/r9R9ojcCeos AMew== X-Gm-Message-State: AOAM531CVEtQC+7a4UOFKkMEQDmMVwXWjqubHCrbdbZJg7n+C+WcmPSI uX8bYJbC5M4THETdXyimmP6uvaTy0ds= X-Received: by 2002:a63:9e01:: with SMTP id s1mr10813670pgd.66.1637767729939; Wed, 24 Nov 2021 07:28:49 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id b6sm83842pfm.170.2021.11.24.07.28.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 07:28:49 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Nov 2021 23:27:40 +0800 Message-Id: <1637767665-6777-2-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 2/7] avformat/rtpdec_rfc4175: support for yuv420p format 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: plw4eRQX8KhI 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 f13736b..5a7058b 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -63,6 +63,17 @@ static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) } else { return AVERROR_INVALIDDATA; } + } else if (!strncmp(data->sampling, "YCbCr-4:2:0", 11)) { + tag = MKTAG('I', '4', '2', '0'); + data->xinc = 4; + + if (data->depth == 8) { + data->pgroup = 6; + pixfmt = AV_PIX_FMT_YUV420P; + stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; + } else { + return AVERROR_INVALIDDATA; + } } else { return AVERROR_INVALIDDATA; }