From patchwork Fri May 13 09:40:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 35757 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp209601pzb; Fri, 13 May 2022 02:41:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNB+CvDnDAXdP7qeRvINtUVNFNtL57NSE9WgKb5xGndJDvQF/r2mpmmMZA00Q/DK3OUlpS X-Received: by 2002:a05:6402:90c:b0:415:d340:4ae2 with SMTP id g12-20020a056402090c00b00415d3404ae2mr39532029edz.331.1652434887581; Fri, 13 May 2022 02:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652434887; cv=none; d=google.com; s=arc-20160816; b=mlLZFq4R18kYzv7FWi0dvgcAavBaP5FLx7cwQq5mnAaP+6J1S5fhQdJ4iZdPBh61Bg Ni+fTOOtjfBIvsXdtpqX9ifndMplObiBaPCm7exodOl6QTU5INcLUZjT+FHOPtrIx7eO 74qpP2GIYpdEF0ExlSuEMkhqxtYPO/5Hl5oW2OvUL52bIBaPpHIWdFnj+uHD/qmI3UTA gCtf3TVt2zh2qiOsBq7YWqnxKPZoPNZDLBuE2wYNzzmNSy6VEmzV5wjoWRYiFjt7b7K5 AxmY72ZtE0fjbO+oiMDDmgsyIvurPO0GGRIv0vK/aVcqvWqfYi5g4Dg8Kgxqo7q8t5Ra 6t7Q== 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:mime-version:references:in-reply-to:date :to:from:message-id:dkim-signature:delivered-to; bh=MWZPHDrO4ZIYJPsNAsY4VEWSXXY1RuBU6fnmw5Qz40E=; b=Lb5iLQAyNXVZuY5U+/5Vvb77Dt+/wLgHPRNR5LX43Hz9R3UDslowUoxD5zNFvBoEBX yFtcRQwbHvUGKwEDEVih5QzXrhDHN8RTuhOZbpsYzmLDT0jmy/0Y7lb9Vqc1VCT8zG37 9HviTIM2rNLySwrzKs4ufrBL0wxS9lzkUE0QxKjBgublIGAECAo7nioU76CDDURlDXCR i39x4fHwMOFWpg6dnI7LPNmzAW9DKD35kFjjS6DSmaBPxrJ30dNFHVo483mvaok1POq/ DMsHk0fmPbGi96uo2fVXXwfs4pstThHnOBUQrUwc+s1VN2c5MeeQaNeT3P9hVZKBSWGQ fOVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=JNV50hRY; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f22-20020a056402151600b0041d8586ad52si1367063edw.218.2022.05.13.02.41.27; Fri, 13 May 2022 02:41:27 -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=@foxmail.com header.s=s201512 header.b=JNV50hRY; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FBF068B485; Fri, 13 May 2022 12:41:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out162-62-57-137.mail.qq.com (out162-62-57-137.mail.qq.com [162.62.57.137]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D81968B344 for ; Fri, 13 May 2022 12:40:57 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1652434855; bh=OU3CNRTN4oYUmk7U0CqnewHln+AEKItij4D80WGclEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JNV50hRYKubTQjkPNMLr8jRf/aYqxCFV3gsrWQX4LA48W30X590nZJBcSd12hUoNu yQYFO04uyoyKKh11/ui4abNsJl5NGhtTGC8GZcDkW6r5ViUJzREID+r3K9kjLfHcO4 R4Juaz49QYg2UcKenxQiCfVRsnymrJViadRAwQRQ= Received: from ZHILIZHAO-MB2.tencent.com ([113.118.107.45]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id A34A9AFE; Fri, 13 May 2022 17:40:52 +0800 X-QQ-mid: xmsmtpt1652434854tp2hwily6 Message-ID: X-QQ-XMAILINFO: MW5hkHoBpWXyuN+E5Qcb/29IZepFk/IBvN1mYC1bvbLvHRIISPHxuoi38O3Gld qPS5BeqAFPkIVT75/e29DTelMjAas7qPGqILv1RdLl0U8xVTKahG23DwNjXwiJ/UGovpzOwFUsXp a2yHaK/YhndpIY73mKJ1rGJaB8tEUFnwtSNuGegyRtVIzzb4TMFVqo9GaxSJa/GE7p3zsyxpRigc Fy+3Xgh+fF2Lq4fkV50A2q9wp3D+Vn/94XnhQEQJk0lvPHh8p5t4e/WnyoSv6aE2qoAwypuV3iOn jQ2S3jMiZPVzhBjZOyPSkrRpEcAbCjdTsgeX3llN+GWFgETmf8xipI6ICn7WY7P5Z45mVJCb0aOl hU/BV+0gaon3hmwz7IJQLgf0+QE/FIcmwVruvuJlmhE7n391uhG3qvOTRMtqX10lJK/GfxQ1X9Nw gVgKP+SQzxzuw46Nq9S+0sqEBlRisOsxCoW/oGCj9Rp6t8mR7kuh4i13kQjo0lQM5sLh2FYMILIE tgkGDaY+BlLkaOuUpzb2v6RlulTH6Pvw+nvtTg599s0ggmhrYdJpJiNY5zvjENMSj5fbmXRNlCh5 0lBdrHeLwYvsxU4+eIQ0TUBlcERbODNVlclVDYcGrHeCM5aC3+0/cxw8GEklc0htnk90RmIXVRsp UjC8sprA1ad4QXOIw+aNRbF3MH1dibFv+tGs6xseYQ5FqQq3COzg+tunDyQSSfjDeI5UR8AKQrZy jKiuWnRXljL8vkXHV33zILZyriYniN+qyBpeB3ndRuVs2jH3rue2HTWB5s7JR8tV7ALTrVcsUki7 8ZZhbcejLTl6tHwU5rGgMNsxqWgDo/RKwgaqH0/3rBE3fRvdVmoziISTm02fMJFx8JmiZG5SdZe2 doON8sVLSChdyHdTMKoKLXlESFkzprEgOSgc58CUZhSU3CAoGpTbGN6CLIcVQeSB81huAUtMJH0g SOVmOz7nKrKWDzjxv0cAKJM4EKllR2s58AwmdD2BTQxoIzjGo7aw== From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 May 2022 17:40:49 +0800 X-OQ-MSGID: <20220513094049.86179-3-quinkblack@foxmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220513094049.86179-1-quinkblack@foxmail.com> References: <20220513094049.86179-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/libdavs2: export has_b_frames info 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3camUdI5jozP More precisely, we should use picture_reorder_delay, but it's unavailable yet. --- libavcodec/libdavs2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index a47027d300..bc31745a4f 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -78,6 +78,12 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, int *g avctx->height = headerset->height; avctx->pix_fmt = headerset->output_bit_depth == 10 ? AV_PIX_FMT_YUV420P10 : AV_PIX_FMT_YUV420P; + /* It should be picture_reorder_delay, but libdavs2 doesn't export that + * info. + * Use FFMAX since has_b_frames could be set by AVS2 parser in theory, + * which doesn't do it yet. + */ + avctx->has_b_frames = FFMAX(avctx->has_b_frames, !headerset->low_delay); avctx->framerate = av_d2q(headerset->frame_rate,4096); *got_frame = 0;