summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2014-10-30 20:20:34 +0100
committerThomas Reufer <thomas@reufer.ch>2014-11-14 23:16:13 +0100
commit5fe31d61f26e8f92706629a50a34ff89add1b839 (patch)
treee63ca369c88a4401140ba893aaa8b922e76cead6
parent77a07b1449eb8492abd70befe00ed152a1e68d43 (diff)
downloadvdr-plugin-rpihddevice-5fe31d61f26e8f92706629a50a34ff89add1b839.tar.gz
vdr-plugin-rpihddevice-5fe31d61f26e8f92706629a50a34ff89add1b839.tar.bz2
move initial video mode setup to plugin start and update OSD after mode changes
-rw-r--r--HISTORY1
-rw-r--r--display.c10
-rw-r--r--display.h2
-rw-r--r--omxdevice.c7
-rw-r--r--omxdevice.h2
5 files changed, 19 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index b7a490a..eb6e204 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3,6 +3,7 @@ VDR Plugin 'rpihddevice' Revision History
- new:
- added DTS audio codec support
+ - add setup options to control video mode and its behaviour on stream changes
- set HDMI speaker layout to fix channel mapping for multi channel PCM output
- support building against external ffmpeg/libav by setting EXT_LIBAV
- support for >=ffmpeg-1.2 and >=libav-0.8 with resampling
diff --git a/display.c b/display.c
index 9c3c513..72bb54a 100644
--- a/display.c
+++ b/display.c
@@ -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;
}
/* ------------------------------------------------------------------------- */
diff --git a/display.h b/display.h
index 2fc5c37..85e428c 100644
--- a/display.h
+++ b/display.h
@@ -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);