diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2015-03-21 23:19:07 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2015-03-21 23:19:07 +0100 |
| commit | 2bf30066fa1fef65f0abe1330c398fca54b2e717 (patch) | |
| tree | 508b8065307d98abefe35909c95ea813b98e82e1 | |
| parent | ec274bbfabaab8fb306975ace7774c75c6d63461 (diff) | |
| download | vdr-plugin-rpihddevice-2bf30066fa1fef65f0abe1330c398fca54b2e717.tar.gz vdr-plugin-rpihddevice-2bf30066fa1fef65f0abe1330c398fca54b2e717.tar.bz2 | |
added command line argument to disable OSD
| -rw-r--r-- | HISTORY | 1 | ||||
| -rw-r--r-- | rpihddevice.c | 20 | ||||
| -rw-r--r-- | setup.c | 27 | ||||
| -rw-r--r-- | setup.h | 22 |
4 files changed, 64 insertions, 6 deletions
@@ -2,6 +2,7 @@ VDR Plugin 'rpihddevice' Revision History ----------------------------------------- - new: + - added command line argument to disable OSD - combined digital audio format options to one single setup option - added font kerning - support for GPU accelerated pixmaps diff --git a/rpihddevice.c b/rpihddevice.c index 19a1f64..32b0b90 100644 --- a/rpihddevice.c +++ b/rpihddevice.c @@ -22,15 +22,19 @@ private: cOmxDevice *m_device; - static void OnPrimaryDevice(void) { new cRpiOsdProvider(); } + static void OnPrimaryDevice(void) + { + if (cRpiSetup::HasOsd()) + new cRpiOsdProvider(); + } public: cPluginRpiHdDevice(void); virtual ~cPluginRpiHdDevice(); virtual const char *Version(void) { return VERSION; } virtual const char *Description(void) { return tr(DESCRIPTION); } - virtual const char *CommandLineHelp(void) { return NULL; } - virtual bool ProcessArgs(int argc, char *argv[]) { return true; } + virtual const char *CommandLineHelp(void); + virtual bool ProcessArgs(int argc, char *argv[]); virtual bool Initialize(void); virtual bool Start(void); virtual void Stop(void); @@ -88,4 +92,14 @@ bool cPluginRpiHdDevice::SetupParse(const char *Name, const char *Value) return cRpiSetup::GetInstance()->Parse(Name, Value); } +bool cPluginRpiHdDevice::ProcessArgs(int argc, char *argv[]) +{ + return cRpiSetup::GetInstance()->ProcessArgs(argc, argv); +} + +const char *cPluginRpiHdDevice::CommandLineHelp(void) +{ + return cRpiSetup::GetInstance()->CommandLineHelp(); +} + VDRPLUGINCREATOR(cPluginRpiHdDevice); // Don't touch this! okay. @@ -11,6 +11,8 @@ #include <vdr/tools.h> #include <vdr/menuitems.h> +#include <getopt.h> + #include <bcm_host.h> #include "interface/vchiq_arm/vchiq_if.h" #include "interface/vmcs_host/vc_tvservice.h" @@ -325,3 +327,28 @@ void cRpiSetup::Set(AudioParameters audio, VideoParameters video, cRpiOsdProvider::ResetOsd(false); } } + +bool cRpiSetup::ProcessArgs(int argc, char *argv[]) +{ + static struct option long_options[] = { + { "disable-osd", no_argument, NULL, 'd' }, + }; + int c; + while ((c = getopt_long(argc, argv, "d", long_options, NULL)) != -1) + { + switch (c) + { + case 'd': + m_plugin.hasOsd = false; + break; + default: + return false; + } + } + return true; +} + +const char *cRpiSetup::CommandLineHelp(void) +{ + return " -d, --disable-osd disable OSD\n"; +} @@ -58,6 +58,14 @@ public: } }; + struct PluginParameters + { + PluginParameters() : + hasOsd(true) { } + + bool hasOsd; + }; + static bool HwInit(void); static cRpiAudioPort::ePort GetAudioPort(void) { @@ -109,6 +117,10 @@ public: return GetInstance()->m_osd.accelerated != 0; } + static bool HasOsd(void) { + return GetInstance()->m_plugin.hasOsd; + } + static void SetHDMIChannelMapping(bool passthrough, int channels); static cRpiSetup* GetInstance(void); @@ -122,6 +134,9 @@ public: static void SetAudioSetupChangedCallback(void (*callback)(void*), void* data = 0); static void SetVideoSetupChangedCallback(void (*callback)(void*), void* data = 0); + bool ProcessArgs(int argc, char *argv[]); + const char *CommandLineHelp(void); + private: cRpiSetup() : @@ -136,9 +151,10 @@ private: static cRpiSetup* s_instance; - AudioParameters m_audio; - VideoParameters m_video; - OsdParameters m_osd; + AudioParameters m_audio; + VideoParameters m_video; + OsdParameters m_osd; + PluginParameters m_plugin; bool m_mpeg2Enabled; |
