diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2014-10-30 20:20:34 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2014-10-30 20:20:34 +0100 |
| commit | 438b5b0310c9b2e98aaeea9b92d2d3f2e0cd9158 (patch) | |
| tree | d4f44bb8da7e5045ea08ab83e338dc98e3872b7f | |
| parent | b112e37a36a184684d84e684b6648d57adcb9f59 (diff) | |
| download | vdr-plugin-rpihddevice-438b5b0310c9b2e98aaeea9b92d2d3f2e0cd9158.tar.gz vdr-plugin-rpihddevice-438b5b0310c9b2e98aaeea9b92d2d3f2e0cd9158.tar.bz2 | |
move initial video mode setup to plugin start and update OSD after mode changes
| -rw-r--r-- | display.c | 10 | ||||
| -rw-r--r-- | display.h | 2 | ||||
| -rw-r--r-- | omxdevice.c | 7 | ||||
| -rw-r--r-- | omxdevice.h | 2 |
4 files changed, 18 insertions, 3 deletions
@@ -9,6 +9,7 @@ #include "setup.h" #include <vdr/tools.h> +#include <vdr/osd.h> extern "C" { #include "interface/vmcs_host/vc_tvservice.h" @@ -205,7 +206,14 @@ int cRpiDisplay::Update(int width, int height, int frameRate, bool interlaced) break; } - return SetMode(newWidth, newHeight, newFrameRate, newInterlaced); + // set new mode only if necessary + if (newWidth != m_width || newHeight != m_height || + newFrameRate != m_frameRate || newInterlaced != m_interlaced) + { + if (!SetMode(newWidth, newHeight, newFrameRate, newInterlaced)) + cOsdProvider::UpdateOsdSize(true); + } + return 0; } /* ------------------------------------------------------------------------- */ @@ -37,7 +37,7 @@ protected: int Update(int width, int height, int frameRate, bool interlaced); virtual int SetMode(int width, int height, int frameRate, bool interlaced) { - return 0; + return -1; } int m_width; diff --git a/omxdevice.c b/omxdevice.c index 27d4036..8a3edb0 100644 --- a/omxdevice.c +++ b/omxdevice.c @@ -81,7 +81,6 @@ int cOmxDevice::Init(void) m_omx->SetStreamStartCallback(&OnStreamStart, this); cRpiSetup::SetVideoSetupChangedCallback(&OnVideoSetupChanged, this); - HandleVideoSetupChanged(); return 0; } @@ -103,6 +102,12 @@ int cOmxDevice::DeInit(void) return 0; } +bool cOmxDevice::Start(void) +{ + HandleVideoSetupChanged(); + return true; +} + void cOmxDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect) { cRpiDisplay::GetSize(Width, Height, PixelAspect); diff --git a/omxdevice.h b/omxdevice.h index 6070555..d66774a 100644 --- a/omxdevice.h +++ b/omxdevice.h @@ -26,6 +26,8 @@ public: virtual int Init(void); virtual int DeInit(void); + virtual bool Start(void); + virtual bool HasDecoder(void) const { return true; } virtual bool CanReplay(void) const { return true; } virtual bool HasIBPTrickSpeed(void); |
