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 0A897455EE for ; Thu, 9 Mar 2023 14:00:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F13A868BD00; Thu, 9 Mar 2023 16:00:46 +0200 (EET) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E66FC68A23A for ; Thu, 9 Mar 2023 16:00:39 +0200 (EET) Received: by mail-io1-f48.google.com with SMTP id q6so727796iot.2 for ; Thu, 09 Mar 2023 06:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678370438; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=GllFRnZx4qTGctIUDVmS6SITaXTbB8A70TfN6ZHWpu8=; b=Uje8LuzOTp0aHB18a5AnAysZFLXYtHKtSlpleAZym3bHzW5YYt+tW2fWHRjNuAawFX NEs6UUtLZ5S6VMxw0Zo/5IfgWFF6w4pUbvbG2I59sMTL8RbLQ2GDp+3Y1hxCM5PXDxvy Od59L/t5uVcn7eD6mrnENxVe/w9Dm/B17NGYAvEwROA8mlmIZs1G3ZaZLBEF6S3ZseL5 4FKg2BqD4QeKnoGWuOKdul6WGECQkI01GYli35SPWhiYxI7FtI/20HUHgRdPLiSzXYkB uEj5BNveP38/1OEJnROylGxPr08gnWlfxySOXJj97d/IyhdLZWfs2Cyk7X3oBXHIwZqU pOeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678370438; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GllFRnZx4qTGctIUDVmS6SITaXTbB8A70TfN6ZHWpu8=; b=kFoxRT5tNyPIa8nse6gRj55khgA0lu99IT4WAybXqzJnxYvYPPovv2calDK2ehuGMM faJvVO+7ITHQAH6C7Yq4FBZ2rF/96xavr82rsaG9JBKghChsowaXj+tsTHehh4E3CyLt O1ycdmHiY+WB5QIBfw31hwyqtBYq5lb6Klsfz2RFJQk/yVv0Csb3+T+hsM/Qxy2q3Ggp 7SrtZSzoEtTsPwPVFrLTF+6PqyjWAb/68TUvC07KU+/K3EeIMasTW0KUlxkct1FStRjk PThm/zfLL+7uyggrwMQ7xMxdW9RDP+s1+KhLuJL8qhdImpJ/gHFfOFuqa1PhUXGctCbV IFgg== X-Gm-Message-State: AO0yUKXgCBm9mvnfmaeIlBvc2yaaH1w4ozYBuzQI3UfJs/m76Z2Z0P3S 5YzWm8rl/kO9itjgtQFaxxDPho2Jz4Cojw== X-Google-Smtp-Source: AK7set8TFSrAiCwrmZ1sZ7FHwijSXSOOYJ4AgUki845PqRcDIODKQnOLSZxK/fiIgkZcHWx5Vup2dQ== X-Received: by 2002:a05:6602:2407:b0:74c:83ab:280c with SMTP id s7-20020a056602240700b0074c83ab280cmr11974269ioa.1.1678370438097; Thu, 09 Mar 2023 06:00:38 -0800 (PST) Received: from [192.168.1.35] (c-98-224-219-15.hsd1.mi.comcast.net. [98.224.219.15]) by smtp.gmail.com with ESMTPSA id z26-20020a056638001a00b003c2c5f13596sm5741989jao.59.2023.03.09.06.00.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Mar 2023 06:00:37 -0800 (PST) Message-ID: Date: Thu, 9 Mar 2023 09:00:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US-large From: Leo Izen In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffplay.c: fix rotate error when displaymatrix contains flip 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/9/23 04:49, 1035567130@qq.com wrote: > From: Wang Yaqiang > > The angle is calculated by the get_rotation function, > but it needs to be combined with the displaymatrix to determine whether flip or rotate, > which is consistent with the processing logic in ffmpeg_filter.c > > Signed-off-by: Wang Yaqiang > --- > fftools/ffplay.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/fftools/ffplay.c b/fftools/ffplay.c > index d6479aef5f..860bac367a 100644 > --- a/fftools/ffplay.c > +++ b/fftools/ffplay.c > @@ -1925,16 +1925,24 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c > theta = get_rotation(displaymatrix); > > if (fabs(theta - 90) < 1.0) { > - INSERT_FILT("transpose", "clock"); > + INSERT_FILT("transpose", displaymatrix[3] > 0 ? "cclock_flip" : "clock"); > } else if (fabs(theta - 180) < 1.0) { > - INSERT_FILT("hflip", NULL); > - INSERT_FILT("vflip", NULL); > + if (displaymatrix[0] < 0) { > + INSERT_FILT("hflip", NULL); > + } > + if (displaymatrix[4] < 0) { > + INSERT_FILT("vflip", NULL); > + } Minor code style point, we don't use {} if there's only one line inside the braces. > } else if (fabs(theta - 270) < 1.0) { > - INSERT_FILT("transpose", "cclock"); > + INSERT_FILT("transpose", displaymatrix[3] < 0 ? "clock_flip" : "cclock"); > } else if (fabs(theta) > 1.0) { > char rotate_buf[64]; > snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta); > INSERT_FILT("rotate", rotate_buf); > + } else if (fabs(theta) < 1.0) { > + if (displaymatrix && displaymatrix[4] < 0) { > + INSERT_FILT("vflip", NULL); > + } > } > } > Otherwise looks mathematically sound. - Leo Izen (thebombzen) _______________________________________________ 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".