diff options
author | Johns <johns98@gmx.net> | 2012-01-20 15:33:37 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-01-20 15:33:37 +0100 |
commit | 0422b6aa5aad384dac6eea345219a5bec32e9d78 (patch) | |
tree | 73428935c0956c8e739c804fb8cc134bd0fdf146 /softhddevice.cpp | |
parent | eb024558dece3d93b44f329da8626c358b7f4ace (diff) | |
download | vdr-plugin-softhddevice-0422b6aa5aad384dac6eea345219a5bec32e9d78.tar.gz vdr-plugin-softhddevice-0422b6aa5aad384dac6eea345219a5bec32e9d78.tar.bz2 |
VDPAU: Add auto-crop support.
Diffstat (limited to 'softhddevice.cpp')
-rw-r--r-- | softhddevice.cpp | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/softhddevice.cpp b/softhddevice.cpp index 764595b..2e5ef41 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -42,7 +42,7 @@ extern "C" ////////////////////////////////////////////////////////////////////////////// -static const char *const VERSION = "0.3.5"; +static const char *const VERSION = "0.4.0"; static const char *const DESCRIPTION = trNOOP("A software and GPU emulated HD device"); @@ -79,6 +79,9 @@ static int ConfigVideoScaling[RESOLUTIONS]; static int ConfigVideoAudioDelay; ///< config audio delay static int ConfigAudioPassthrough; ///< config audio pass-through +static int ConfigAutoCropInterval; ///< auto crop detection interval +static int ConfigAutoCropDelay; ///< auto crop detection delay + static volatile char DoMakePrimary; ///< flag switch primary ////////////////////////////////////////////////////////////////////////////// @@ -362,6 +365,8 @@ class cMenuSetupSoft:public cMenuSetupPage int Sharpen[RESOLUTIONS]; int AudioDelay; int AudioPassthrough; + int AutoCropInterval; + int AutoCropDelay; protected: virtual void Store(void); public: @@ -370,6 +375,8 @@ class cMenuSetupSoft:public cMenuSetupPage /** ** Create a seperator item. +** +** @param label text inside separator */ static inline cOsdItem *SeparatorItem(const char *label) { @@ -439,6 +446,16 @@ cMenuSetupSoft::cMenuSetupSoft(void) AudioPassthrough = ConfigAudioPassthrough; Add(new cMenuEditStraItem(tr("Audio pass-through"), &AudioPassthrough, 2, passthrough)); + // + // auto-crop + // + Add(SeparatorItem(tr("Auto-crop"))); + AutoCropInterval = ConfigAutoCropInterval; + Add(new cMenuEditIntItem(tr("autocrop interval (frames)"), + &AutoCropInterval, 0, 200)); + AutoCropDelay = ConfigAutoCropDelay; + Add(new cMenuEditIntItem(tr("autocrop delay (n * interval)"), + &AutoCropDelay, 0, 200)); } /** @@ -478,6 +495,11 @@ void cMenuSetupSoft::Store(void) VideoSetAudioDelay(ConfigVideoAudioDelay); SetupStore("AudioPassthrough", ConfigAudioPassthrough = AudioPassthrough); CodecSetAudioPassthrough(ConfigAudioPassthrough); + + SetupStore("AutoCrop.Interval", ConfigAutoCropInterval = AutoCropInterval); + SetupStore("AutoCrop.Delay", ConfigAutoCropDelay = AutoCropDelay); + + VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay); } ////////////////////////////////////////////////////////////////////////////// @@ -1001,11 +1023,15 @@ cMenuSetupPage *cPluginSoftHdDevice::SetupMenu(void) /** ** Parse setup parameters +** +** @param name paramter name (case sensetive) +** @param value value as string +** +** @returns true if the parameter is supported. */ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) { int i; - char buf[128]; //dsyslog("[softhddev]%s: '%s' = '%s'\n", __FUNCTION__, name, value); @@ -1018,6 +1044,8 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) return true; } for (i = 0; i < RESOLUTIONS; ++i) { + char buf[128]; + snprintf(buf, sizeof(buf), "%s.%s", Resolution[i], "Scaling"); if (!strcmp(name, buf)) { ConfigVideoScaling[i] = atoi(value); @@ -1050,6 +1078,7 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) return true; } } + if (!strcmp(name, "AudioDelay")) { VideoSetAudioDelay(ConfigVideoAudioDelay = atoi(value)); return true; @@ -1059,6 +1088,17 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) return true; } + if (!strcmp(name, "AutoCrop.Interval")) { + VideoSetAutoCrop(ConfigAutoCropInterval = + atoi(value), ConfigAutoCropDelay); + return true; + } + if (!strcmp(name, "AutoCrop.Delay")) { + VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay = + atoi(value)); + return true; + } + return false; } |