From patchwork Mon Oct 24 03:16:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 38939 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1997729pzb; Sun, 23 Oct 2022 20:17:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HuFgWGbdElfaoj1mngKiU70NI/2KeBh6QysiXgEX9D7znTFdzejv6ROXVKmQIEhTVuYY3 X-Received: by 2002:a05:6402:194d:b0:461:8982:52b8 with SMTP id f13-20020a056402194d00b00461898252b8mr7784400edz.49.1666581475663; Sun, 23 Oct 2022 20:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666581475; cv=none; d=google.com; s=arc-20160816; b=mGb5Kj82CbPitgNCcLEVfBc17GXk2aKMe6rLDXninhHlYBeEvvzo0Q9JR1G+AJ8FoD 58Z1WJEFPO45lm+auLA0n3tDA0nGuzjTaVbMf0iY5STdhq1wofzlrbT8bNsgqEOTPgAm 0Ou0ttE8GoiB9qIPpfFV/PKSaa/5AiGr3HcHRtwHkhe0QV4wEjnmSt6PolxCy5U8xcjA 2dxeKeSB84l5NuLukThpiW8eYBiAX7MlRKtEWH2mIPBQChUNPs9euNlQEEr10utha8YX sHN9MuRI4NsJtfV7Hek8MQ2hc7Okk9vcXPbC+H1t4XwLT83HEvi5qezYwmSvsdEIXkW6 //NQ== 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=9fqsUNTcGRYKSZ9USRpuhFM77tQOYVzDEGlSIUGc69Q=; b=FGEn0GQBfBqLvu+xwhyOk3lqhxdnU8fLM8W5Rb8vbjh9nJf26CTSyFYb2NE5avZMfw DdViVgo1bnBIP510jc3J3WwXbNxvBMl5D1Za1avOs4l5e9sL5fRsbiup9I7UtXuMjNI+ GaCcVqwLkiqBkNfNjcjuUU9uftmPim6lhsaXOd98/45eS2aNBughDSpk674T4kyGoKLP CKTqc9YYQOM1enq9MFQ8WlBwTrt3zkNGok1l/Zrfc+L3sb/0UlA6uwD03q4OliD9MIZa Y9voEwPXgzY0XM78ZZ9e0w9g05X66QaitWsgEmgtCgMSfV1csw5qxgSGIvjKLiNfa+K7 B4sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=stcELmJG; 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 js4-20020a17090797c400b0078db70cc9b8si29038646ejc.606.2022.10.23.20.17.55; Sun, 23 Oct 2022 20:17:55 -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=stcELmJG; 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 221DF68BBAF; Mon, 24 Oct 2022 06:17:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4CB9F68BD0F for ; Mon, 24 Oct 2022 06:17:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1666581435; bh=Nk/ftF6Tg45G3EcdxHwzL07iX1oSf/CXMOpYtfIGhM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=stcELmJG190sxIxYhwXYvwyqIR3jhFo2shxLs3gXF5hvg01Nmv5yOI+T5pyqNgIoX KZ6K6+Z/OSzEGsdOT+Q1xS6CBLyDO0TMCjpz1Of82VCrXH47p/xE0NLFCSIRihVBFA EPzQQhCm9GQDQGgXN8ZZQL9daUn8olzBsBO+qeuM= Received: from localhost.localdomain ([59.37.125.102]) by newxmesmtplogicsvrsza31.qq.com (NewEsmtp) with SMTP id 44A14270; Mon, 24 Oct 2022 11:17:10 +0800 X-QQ-mid: xmsmtpt1666581431t1qki0mgf Message-ID: X-QQ-XMAILINFO: OZiGlmjmGvyhH3kI3GxFmDVD4v13C1Gsy2l8v4swa296wEr2I8P0vOEcXywBfZ PzvgoQ6ANYUs0JjXiMEqJTk90wW/NzGjJjCJ3xmfUbo9rjWtIMNHo+S35RYQ2QQj0VyLhNGblXAE M3vG9qcUb14+P3X9Nrrw34t00yhAprZE4keboNlZEGKBY9dJVKx4qmfEyaaoQ/LWDA60mThasCGH 2kzKO/43vq6ttvNbvWTzYr9APCATpuS7ioJv5IC/Rc5MuhjZI6qOQVkDzyHKTFAw+KW0x/NW2Mel e9i6oqdzbngoKEDc3F2iHb+/IYl7vNhNnClL6Ny65wElQ4WKgUDjFsrrRa6T6gVKKCuhYDfTXkJP IIgiQbZeYY0a52mP9hepR/CAxJaUSkkO/5D4bChxo0Z2M0LDk5Xs1J2EFURg3Px+4SFIXKAR1aHC DAZJ8PYQae8CcBgWh73mViJ0BkNV4O+OF1Y36Z01tc830sRB0KK0bY3Ti1cTi/z73KJsG0IneG+X r+PwtVP96S3pNm8KMBCWetJhyzZJyt8fYkHH6X/uk6xIkTzqDaz0A6ohwsg2ipqga7qkDXgGrZfw tom6Hwwhh2uiiYyZ5AqkkSluO1lkP9DWme1LxVIcEdqM+/VMzvm2IbJs5bCo95pREL8B64htql1i dxs4xILIaw07sjPut3PHBYjdBjMhmTbVVeaRZoWQOzy54bZ0aAIb4faXRGpaTqZEr0S78M463Cbv FLWwBUj5RIyxGZPJ1/WgqLseedRiwXaKTIOdk9E2mIB7EIuEf7ezdlnooTezuHJ/mvaXfJ8FJTUP G9zvbsMjRDtM/eDBSS2oM747OyPPXa2RdqxuMEg4mQKSRkaNGx45t5EWIto9AFE0LDo2ycpLjSXz Zh+/Kau1KO/TmB3oZSonfHMYik0zNYBfvyMVSwtMUdqhpqfNYBkYGjj+OSvTwr7g95vARYWbhoGj MBbSUA/EmUpnkLrSH0pl7gOJrsIx0r From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Oct 2022 11:16:47 +0800 X-OQ-MSGID: <20221024031658.1026118-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221024031658.1026118-1-quinkblack@foxmail.com> References: <20221024031658.1026118-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/12] avcodec/mediacodec: fix incorrect crop 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: matthieu.bouron@stupeflix.com, Zhao Zhili , aman@tmm1.net Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dALLiDi1Yeou From: Zhao Zhili The crop info is optional, but used unconditionally. Signed-off-by: Zhao Zhili --- libavcodec/mediacodecdec_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index 2a605e7f5b..c1cbb28488 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -487,6 +487,11 @@ static int mediacodec_dec_parse_format(AVCodecContext *avctx, MediaCodecDecConte AMEDIAFORMAT_GET_INT32(s->crop_left, "crop-left", 0); AMEDIAFORMAT_GET_INT32(s->crop_right, "crop-right", 0); + if (s->crop_bottom == 0 || s->crop_right == 0) { + s->crop_top = s->crop_left = 0; + s->crop_right = s->width - 1; + s->crop_bottom = s->height - 1; + } width = s->crop_right + 1 - s->crop_left; height = s->crop_bottom + 1 - s->crop_top;