From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0872F44322 for ; Tue, 6 Sep 2022 06:38:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A163768BA39; Tue, 6 Sep 2022 09:38:26 +0300 (EEST) Received: from out162-62-57-64.mail.qq.com (out162-62-57-64.mail.qq.com [162.62.57.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0BD4968B5F7 for ; Tue, 6 Sep 2022 09:38:19 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662446293; bh=IVt9E++gsumku05fDIqXPc3EMbUUqKt+n1SAjjzjMp0=; h=Subject:From:To:Date:In-Reply-To:References; b=DAYiwVubvCDDIl7O0vlsKCmAVxJQcwLMR+sE8fXuDXi9S7RhXrr6TChbV9XADnZOI xneBJUduPeCAS747ncRZUKbWpjOTw7V17inPxp/sYsREKMK04tLuHffFFU5rXEc7Hf CNAbMLZfxlZavlE4A7hygl2yZcfjXlXkyN/uybe8= Received: from zhilizhao-LC3 ([59.37.125.102]) by newxmesmtplogicsvrsza30.qq.com (NewEsmtp) with SMTP id 98CAA8C8; Tue, 06 Sep 2022 14:38:12 +0800 X-QQ-mid: xmsmtpt1662446292tloqfr7de Message-ID: X-QQ-XMAILINFO: NXIgjbYudVAchZvvVaopoeknHh7LV0+UNlLddzuzEjgJUxNIBqTaNEUcy1qTBY frV3iK5YxFOiDjFBhW/qsFmY6zfWdSiFeWjbGWunSTRSINOy9lCShjnBVomhs3irUZwZjRbxnY3z RgJOVn4cPQsrnFEwjdAteyXdukiz6c/zVg+XFxGnW2KS9cxTSTEGZCokvSagBB7+FyaPBG1cGi32 1MUmyuO1y8vBIgYBa/D3iAQ+5qLQ4iOvhLuSec3dY+dSR6dHmSOIHhG0C1pcEd7vP6NfyraEnmqw unAYLMQnjXSD6Br42ANqizFFXEEJRVeiK0eiXuBzUwyzMX2cpUNEFvvx8C40HdSq6MVqOs3n2tmU 8NZ4hfqKTh9Gk6tuNu4k+BivC4B7cscNFL9blvmw00k4bmOVf5dFYq/+1LL801yh2q4PLBKKOXcq LieSNSHq7NvsD54MnOTO6sSdmS0hpjwAwFaK4jKLb3ovpsX+VU6f7t2DbICdP2BQLDQDWf7duDBl mdVjcFjWdGB3SJpjsap3QjOtinInEUsHHk/mB9SuRfypVF6Il5+E+WAxBMwuxarJkyxhdI2Nto1l S9W9zRqxB3iyeZt7id2xAgPO+MYgB1GdWQZ1/Bs4i7rN70uBmeEJ971MyBOukJU24BUfbURqYAzt HLor/wVb40b+jEIPwsz8N5kwFe13JRglzAidvf0FVLb6YJJZWhBplyLzssBs9p9xeSIvgQzBrWJW wOyoHUt9eUPQPkg1V4zAdBOm4IccfKeqMpu4fehbd7z/jmE0HIjNdSA3OP5ldD+PhigF17L6gsNV v/o1GsvxO0YGF4bfoBD8iKyZx7PAGQai0gMZgSVjRD457v50FkM7eSvvei6fTRT0j38HY2c2xrql DEAyCjjejLkzb2+1EOHhRd0hSuxJFXWazG+FKPuDHHUDs1tdZ5KOgipIxtSCdRzb1HYO3PZqV5 X-OQ-MSGID: From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Tue, 06 Sep 2022 14:38:17 +0800 In-Reply-To: References: User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v3] fftools/ffplay: fix rotation incorrect when frame contains the displaymatrix 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 2022-09-05 at 18:40 +0800, 1035567130@qq.com wrote: > From: Wang Yaqiang > > For example, if the jpeg contains exif information > and the rotation direction is included in the exif, > the displaymatrix will be set on the side_data of the frame when > decoding. > However, when ffplay is used to play the image, > only the side data in the stream will be determined. > It does not check whether the frame also contains rotation > information, > causing it to play in the wrong direction > > Signed-off-by: Wang Yaqiang > --- > fftools/ffplay.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/fftools/ffplay.c b/fftools/ffplay.c > index 9242047f5c..bcc00afe31 100644 > --- a/fftools/ffplay.c > +++ b/fftools/ffplay.c > @@ -1915,8 +1915,14 @@ static int > configure_video_filters(AVFilterGraph *graph, VideoState *is, const c > } while (0) > > if (autorotate) { > - int32_t *displaymatrix = (int32_t > *)av_stream_get_side_data(is->video_st, AV_PKT_DATA_DISPLAYMATRIX, > NULL); > - double theta = get_rotation(displaymatrix); > + double theta = 0.0; > + int32_t *displaymatrix = NULL; > + AVFrameSideData *sd = av_frame_get_side_data(frame, > AV_FRAME_DATA_DISPLAYMATRIX); > + if (sd) > + displaymatrix = (int32_t *)sd->data; > + if (!displaymatrix) > + displaymatrix = (int32_t *)av_stream_get_side_data(is- > >video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); > + theta = get_rotation(displaymatrix); > > if (fabs(theta - 90) < 1.0) { > INSERT_FILT("transpose", "clock"); LGTM. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".