From 0604936163f999fd86789e7d1c8bf25810829943 Mon Sep 17 00:00:00 2001 From: phintuka Date: Wed, 21 Aug 2013 09:40:22 +0000 Subject: Support for cDevice::ScaleVideo() --- HISTORY | 1 + device.c | 15 ++++++++++++++- device.h | 7 ++++++- osd.c | 7 ++++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index 67193f6a..72140794 100644 --- a/HISTORY +++ b/HISTORY @@ -3,6 +3,7 @@ VDR Plugin 'xineliboutput' Revision History ????-??-??: Version 2.0.0 +- Support for cDevice::ScaleVideo() - Dropped support for vdr < 2.0 2013-08-20: Version 1.1.0 diff --git a/device.c b/device.c index 151ee98e..081fb64d 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.126 2013-08-21 09:14:36 phintuka Exp $ + * $Id: device.c,v 1.127 2013-08-21 09:40:22 phintuka Exp $ * */ @@ -1518,6 +1518,19 @@ bool cXinelibDevice::SupportsTrueColorOSD(void) return m_server && (m_server->SupportsTrueColorOSD() == 1); } +cRect cXinelibDevice::CanScaleVideo(const cRect &Rect, int Alignment) +{ + return Rect; +} + +void cXinelibDevice::ScaleVideo(const cRect &Rect) +{ + if (m_VideoWindow != Rect) { + m_VideoWindow = Rect; + cXinelibOsdProvider::RefreshOsd(); + } +} + // // SPU decoder // diff --git a/device.h b/device.h index cd5379c1..5e2ef5b2 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.h,v 1.64 2013-08-21 09:14:36 phintuka Exp $ + * $Id: device.h,v 1.65 2013-08-21 09:40:22 phintuka Exp $ * */ @@ -90,6 +90,7 @@ class cXinelibDevice : public cDevice virtual bool HasDecoder(void) const { return true; }; virtual bool CanReplay(void) const { return true; }; virtual bool HasIBPTrickSpeed(void) { return xc.ibp_trickspeed; } + virtual cRect CanScaleVideo(const cRect &Rect, int Alignment = taCenter); bool SupportsTrueColorOSD(void); @@ -99,11 +100,14 @@ class cXinelibDevice : public cDevice ePlayMode m_PlayMode; int m_TrickSpeed; int m_TrickSpeedMode; + cRect m_VideoWindow; public: virtual bool SetPlayMode(ePlayMode PlayMode); ePlayMode GetPlayMode(void) const { return m_PlayMode; }; + const cRect& GetVideoWindow(void) { return m_VideoWindow; } + protected: virtual void Clear(void); virtual void Play(void); @@ -111,6 +115,7 @@ class cXinelibDevice : public cDevice virtual void Freeze(void); virtual bool Flush(int TimeoutMs = 0); virtual int64_t GetSTC(void); + virtual void ScaleVideo(const cRect &Rect = cRect::Null); // Video format facilities diff --git a/osd.c b/osd.c index 70a2d1bf..b66b153c 100644 --- a/osd.c +++ b/osd.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd.c,v 1.49 2013-08-21 09:14:36 phintuka Exp $ + * $Id: osd.c,v 1.50 2013-08-21 09:40:22 phintuka Exp $ * */ @@ -506,6 +506,11 @@ void cXinelibOsd::Flush(void) if(!m_IsVisible) return; + const cRect& videoWindow = m_Device->GetVideoWindow(); + if (videoWindow != cRect::Null) { + CmdVideoWindow(videoWindow.X(), videoWindow.Y(), videoWindow.Width(), videoWindow.Height()); + } + if (IsTrueColor()) { LOCK_PIXMAPS; -- cgit v1.2.3