From patchwork Fri Apr 5 17:37:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucian Muresan X-Patchwork-Id: 17770 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UOAZa-0002Nm-Hk; Fri, 05 Apr 2013 19:37:10 +0200 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UOAZY-0002Nh-EZ for vdr@linuxtv.org; Fri, 05 Apr 2013 19:37:08 +0200 X-tubIT-Incoming-IP: 74.125.83.41 Received: from mail-ee0-f41.google.com ([74.125.83.41]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtps [TLSv1:RC4-SHA:128] for id 1UOAZY-0002BU-GK; Fri, 05 Apr 2013 19:37:08 +0200 Received: by mail-ee0-f41.google.com with SMTP id c1so1530310eek.28 for ; Fri, 05 Apr 2013 10:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :subject:content-type; bh=nGu7td+7uoD0IkXgqKx2hSG56G0SD7szYwlMiw10Nxs=; b=ff7kmqhLzG6O+YM4fHKr0s9sX1ABSCoodjtzKqWzGwKR3OFPmGkrV+QbnDAdofO8fI YyLH9ji0jgexGXimC2bM318h2xOfPlkYjRlPzk+iOWfCdETTGZMam6tv5ZJvtusIHWxS xd0QMyJaEXWIkuRsXxcTD82O52jE0ebatE0FrvSoxKVukVbCuIyWE6j1P+Fo6Rjnoedc 3pFTWPYh78hEnoSlmD8nN1VlCvhFgaOT2FxuUDxE7YKmmXotkBvNKTZntemgHrW4t+uF kvyJxQu5c9kfWIIU8W0s09ICini8vyUejb8Pm/N5xoTcBOsOv1Ol+d+PxTU9o7bnNTZ3 MeaQ== X-Received: by 10.15.43.132 with SMTP id x4mr21529784eev.31.1365183427027; Fri, 05 Apr 2013 10:37:07 -0700 (PDT) Received: from [192.168.178.21] (p54955396.dip.t-dialin.net. [84.149.83.150]) by mx.google.com with ESMTPS id q42sm16631768eem.14.2013.04.05.10.37.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Apr 2013 10:37:06 -0700 (PDT) Message-ID: <515F0BC3.3060005@users.sourceforge.net> Date: Fri, 05 Apr 2013 19:37:07 +0200 From: Lucian Muresan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: vdr@linuxtv.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.4.5.173031 X-PMX-Spam: Gauge=X, Probability=10%, Report=' WEBMAIL_REPLYTO_NOT_FROM 0.5, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, RATWARE_LC_DIGITS_MSGID 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __BAT_BOUNDARY 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_SENDER 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __RDNS_GMAIL 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NS , __USER_AGENT 0, __YOUTUBE_RCVD 0' X-LSpam-Score: -0.8 (/) X-LSpam-Report: No, score=-0.8 required=5.0 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RDNS_NONE=0.793, T_DKIM_INVALID=0.01 autolearn=no Subject: [vdr] [PATCH] TT6400 dvbhddevice ScaleVideo aspect ratio correction X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org Hi, I wrote a patch for the ScaleVideo implementation in the dvbhddevice, for keeping the actual aspect ratio of the video material when scaling. It was tested by users at vdr-portal.de which also reported the distortions (I don't own such a device), and they said it works [1]. You can test it with the nOpacity skin and/or with the upcoming yaepghd-0.0.4 plugin [2]. Regards, Lucian [1] http://www.vdr-portal.de/board1-news/board2-vdr-news/p1137059-announce-nopacity-0-1-0/#post1137059 [2] http://sourceforge.net/projects/vdryaepghd/files/ From 1591c4cdc50dda35c52902ce46851ab57291351c Mon Sep 17 00:00:00 2001 From: Lucian Muresan Date: Fri, 5 Apr 2013 11:21:25 +0200 Subject: [PATCH] vdr-2.0.0 dvbhdffdevice ScaleVideo Aspect v3 --- PLUGINS/src/dvbhddevice/dvbhdffdevice.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c index dd7ace5..7a05ccb 100644 --- a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c +++ b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c @@ -579,9 +579,24 @@ void cDvbHdFfDevice::ScaleVideo(const cRect &Rect) double osdPixelAspect; GetOsdSize(osdWidth, osdHeight, osdPixelAspect); + + // make corrections + double osdAspect = double(osdWidth) / double(osdHeight); + cRect corRect(Rect); + corRect.SetWidth(Rect.Height() * osdAspect); + corRect.SetHeight(Rect.Width() / osdAspect); + if (double(Rect.Width())/double(Rect.Height()) > osdAspect) { + corRect.SetHeight(Rect.Height()); + corRect.SetX(Rect.X() + (Rect.Width() - corRect.Width()) / 2); + } + else if (double(Rect.Width())/double(Rect.Height()) < osdAspect) { + corRect.SetWidth(Rect.Width()); + corRect.SetY(Rect.Y() + (Rect.Height() - corRect.Height()) / 2); + } + mHdffCmdIf->CmdAvSetVideoWindow(0, true, - Rect.X() * 1000 / osdWidth, Rect.Y() * 1000 / osdHeight, - Rect.Width() * 1000 / osdWidth, Rect.Height() * 1000 / osdHeight); + corRect.X() * 1000 / osdWidth, corRect.Y() * 1000 / osdHeight, + corRect.Width() * 1000 / osdWidth, corRect.Height() * 1000 / osdHeight); } }