From patchwork Fri May 12 03:59:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 41595 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp5097453pzb; Thu, 11 May 2023 21:00:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+DPGMwXx2lsFnqsnTkT9Xl/SjMFm2S57Y9AbV+ma6DVHxdVJ7tFbKTV2kUguWm8o7QxRx X-Received: by 2002:a17:907:3686:b0:94a:56ec:7f12 with SMTP id bi6-20020a170907368600b0094a56ec7f12mr22405333ejc.30.1683864020979; Thu, 11 May 2023 21:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683864020; cv=none; d=google.com; s=arc-20160816; b=IFw2vPF5rORQzxlMXZKobSAI2eVTp4I6hMEvUCM17HJfzvzoBqsGHxQVFExZlRYWrx LzlYz+NbouQFfyew04h6nrjG+hA6rVT4xnmuT5zOeliHvKTANT6afNAuZW1v98KzkMEG zcQ9ovN7+hLLYD5e/HhALZZ8VabvDnOgGbnM5UsrVJVcq+378AAKlhch38oON2hCBi5y LOK1Xxk5L+nrTEeQckXQP6sDOePDArz55qbGlUn0/oPzaW9yiI+WEMWA80qCfOFhgl9Z zNGe531PHxj2puLKGuFmqWyovRjmXLwftUXAOZSmiHUg+IwqYbSNNbCkVsd7sGLwSy3f FFGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:mime-version:references :in-reply-to:message-id:date:to:from:delivered-to; bh=JKU2GCg8MIz+NYvT9yX+LbjxXAX2E8wJ+FoCmlNhztU=; b=NakM8ce+HacANsQHThdgaKpQuGUEnFBfLPZ3X5ryRnZSqVxWgLN7OYK3ptx9USqgpG /nZVGl4ChtMgfiroZbZU2bJneh8qV7tY94mnLJcIKSO1vNJ9mrBh9pVHkdBsyUEUAaUs /kHpyukXCGs7BNFkF0/VV+9Xd0UizKea5k1xWeD4y9wzitt+k44JuoPt+1nQnDtE8e/f 8Cxtk0y189BhNg5Sz2Hp7HzY5iEHebjKjfBcOezONzmxoXdWRm2EZmINKnrWrKi4TgzT Y6EcH0MVXGmNIS6s6ISH6vEJ7InArVHTVp1iSUDijpEE8p3UbeA0Tv+fCSWIc7Df1dHo ztBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id vh11-20020a170907d38b00b0094edce87118si7938301ejc.1042.2023.05.11.21.00.20; Thu, 11 May 2023 21:00:20 -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; 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 4B2F468C1B0; Fri, 12 May 2023 06:59:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E554D68C1A1 for ; Fri, 12 May 2023 06:59:51 +0300 (EEST) X-QQ-mid: bizesmtp62t1683863986t1ad3wfo Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 12 May 2023 11:59:44 +0800 (CST) X-QQ-SSF: 01100000000000Z0Z000000A0000000 X-QQ-FEAT: v2TBAhtyi5HvYXmZKwpusWfSkwBwQDEy1NSybO51ZTByKDgED58rvVRnoUeNI mhDcjsT48XmLwWlK4TIib70j0/u/zmiyTqiLOmiJZUXmqi9KVo+0Fy00RmSF1sQu+i15Onw uZ6YPm0I8dx1KNCrxsOlRKVOUn6TuL+ZmiauMXUzyXWzqWBWmQwEpsBzqrKclgHg0TSFHRW FgGyzP0UU8cDy4lZyxH5QsjQ2SZaJhsxi2u7wb9rP1o3fBv6S2gG456hbpqxEBQYyQO+tXX +xixobR6UStRJy30w2bS/ajOHtGqwrwDPpCfKyUM0R26uYGLJ5QO/MC2AJWL8WARPmKJg0R G4daqCFRwmcCl4uGxMaLBWzEMMiELadnVKAH33c5M2DG5mYMmE= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9651354155845394256 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 12 May 2023 11:59:01 +0800 Message-Id: <20230512035901.22731-7-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230512035901.22731-1-lq@chinaffmpeg.org> References: <20230512035901.22731-1-lq@chinaffmpeg.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 Subject: [FFmpeg-devel] [PATCH v9 6/6] avformat/flvenc: support demux vp9 in enhanced flv 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: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uh17yvvT9FLQ Signed-off-by: Steven Liu --- libavformat/flvdec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 98a2231559..bc93c23166 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -320,6 +320,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int return vpar->codec_id == AV_CODEC_ID_HEVC; case MKBETAG('a', 'v', '0', '1'): return vpar->codec_id == AV_CODEC_ID_AV1; + case MKBETAG('v', 'p', '0', '9'): + return vpar->codec_id == AV_CODEC_ID_VP9; default: break; } @@ -365,6 +367,10 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, par->codec_id = AV_CODEC_ID_AV1; vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; return 4; + case MKBETAG('v', 'p', '0', '9'): + par->codec_id = AV_CODEC_ID_VP9; + vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; + return 4; default: break; } @@ -1285,7 +1291,8 @@ retry_duration: st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || - st->codecpar->codec_id == AV_CODEC_ID_AV1) { + st->codecpar->codec_id == AV_CODEC_ID_AV1 || + st->codecpar->codec_id == AV_CODEC_ID_VP9) { int type = 0; if (flv->exheader) { type = flags & 0x0F; @@ -1317,7 +1324,7 @@ retry_duration: } if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || - st->codecpar->codec_id == AV_CODEC_ID_AV1)) { + st->codecpar->codec_id == AV_CODEC_ID_AV1 || st->codecpar->codec_id == AV_CODEC_ID_VP9)) { AVDictionaryEntry *t; if (st->codecpar->extradata) {