From a98a4adc7eb3542ef246b10381863ae386d069a1 Mon Sep 17 00:00:00 2001 From: Johns Date: Mon, 13 Feb 2012 14:13:24 +0100 Subject: [PATCH] Studio levels could be configured in setup menu. --- ChangeLog | 1 + Todo | 8 ++------ softhddevice.cpp | 11 +++++++++++ video.c | 15 +++++++++++---- video.h | 3 +++ 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 853e3d2..154ed98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ User johns Date: Release Version 0.4.7 + VDPAU: Studio levels could be configured in the setup menu. Window size defaults to fullscreen, if no geometry is given. User m.Rcu diff --git a/Todo b/Todo index ae6a387..16c8b79 100644 --- a/Todo +++ b/Todo @@ -24,7 +24,7 @@ missing: suspend output / energie saver: stop and restart X11 suspend plugin didn't restore full-screen (is this wanted?) Option deinterlace off / deinterlace force! - ColorSpace and StudioLevels aren't configurable with the gui. + ColorSpace aren't configurable with the gui. crash: AudioPlayHandlerThread -> pthread_cond_wait @@ -37,7 +37,6 @@ video: hard channel switch OSD can only be shown after some stream could be shown yaepghd changed position is lost on channel switch - use x11 screen size without geometry configuration pause (live tv) has sometime problems with SAT1 HD Pro7 HD vdpau: @@ -81,7 +80,6 @@ audio: Make alsa thread/polled and oss thread/polled output module runtime selectable. software volume support (could be done with asound.conf) - add pause support for replay pause Mute should do a real mute and not only set volume to zero. Starting suspended and muted, didn't register the mute. @@ -98,8 +96,6 @@ audio/oss: HDMI/SPDIF Passthrough: only AC-3 written - Channels are wrong setup, if changing setting during operation. - support oss pass-through playback of recording pause is not reset, when replay exit @@ -127,4 +123,4 @@ future features (not planed for 1.0 - 1.5) pip support save and use auto-crop with channel zapping - upmix stereo to AC-3 + upmix stereo to AC-3 (supported by alsa plugin) diff --git a/softhddevice.cpp b/softhddevice.cpp index a579bd3..783bec4 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -62,6 +62,7 @@ static char ConfigMakePrimary; ///< config primary wanted static char ConfigHideMainMenuEntry; ///< config hide main menu entry static int ConfigVideoSkipLines; ///< config skip lines top/bottom +static int ConfigVideoStudioLevels; ///< config use studio levels /// config deinterlace static int ConfigVideoDeinterlace[RESOLUTIONS]; @@ -384,6 +385,7 @@ class cMenuSetupSoft:public cMenuSetupPage int MakePrimary; int HideMainMenuEntry; int SkipLines; + int StudioLevels; int Scaling[RESOLUTIONS]; int Deinterlace[RESOLUTIONS]; int SkipChromaDeinterlace[RESOLUTIONS]; @@ -453,6 +455,9 @@ cMenuSetupSoft::cMenuSetupSoft(void) SkipLines = ConfigVideoSkipLines; Add(new cMenuEditIntItem(tr("Skip lines top+bot (pixel)"), &SkipLines, 0, 64)); + StudioLevels = ConfigVideoStudioLevels; + Add(new cMenuEditBoolItem(tr("Use studio levels (vdpau only)"), + &StudioLevels, trVDR("no"), trVDR("yes"))); for (i = 0; i < RESOLUTIONS; ++i) { Add(SeparatorItem(resolution[i])); @@ -519,6 +524,8 @@ void cMenuSetupSoft::Store(void) SetupStore("SkipLines", ConfigVideoSkipLines = SkipLines); VideoSetSkipLines(ConfigVideoSkipLines); + SetupStore("StudioLevels", ConfigVideoStudioLevels = StudioLevels); + VideoSetStudioLevels(ConfigVideoStudioLevels); for (i = 0; i < RESOLUTIONS; ++i) { char buf[128]; @@ -1259,6 +1266,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) VideoSetSkipLines(ConfigVideoSkipLines = atoi(value)); return true; } + if (!strcmp(name, "StudioLevels")) { + VideoSetStudioLevels(ConfigVideoStudioLevels = atoi(value)); + return true; + } for (i = 0; i < RESOLUTIONS; ++i) { char buf[128]; diff --git a/video.c b/video.c index bacc158..66e5356 100644 --- a/video.c +++ b/video.c @@ -283,6 +283,7 @@ static char VideoSurfaceModesChanged; ///< flag surface modes changed static const char VideoTransparentOsd = 1; static int VideoSkipLines; ///< skip video lines top/bottom +static char VideoStudioLevels; ///< flag use studio levels /// Default deinterlace mode. static VideoDeinterlaceModes VideoDeinterlace[VideoResolutionMax]; @@ -308,9 +309,6 @@ static const VideoColorSpace VideoColorSpaces[VideoResolutionMax] = { VideoColorSpaceBt709 }; - /// Flag use studio levels -static char VideoStudioLevels; - /// Default scaling mode static VideoScalingModes VideoScaling[VideoResolutionMax]; @@ -9108,6 +9106,16 @@ void VideoSetSkipLines(int lines) VideoSkipLines = lines; } +/// +/// Set studio levels. +/// +/// @param onoff flag on/off +/// +void VideoSetStudioLevels(int onoff) +{ + VideoStudioLevels = onoff; +} + /// /// Set audio delay. /// @@ -9261,7 +9269,6 @@ void VideoInit(const char *display_name) if (getenv("NO_HW")) { VideoHardwareDecoder = 0; } - VideoStudioLevels = 0; if (getenv("STUDIO_LEVELS")) { VideoStudioLevels = 1; } diff --git a/video.h b/video.h index c8a1f46..b391205 100644 --- a/video.h +++ b/video.h @@ -104,6 +104,9 @@ extern void VideoSetSharpen(int[]); /// Set skip lines. extern void VideoSetSkipLines(int); + /// Set studio levels. +extern void VideoSetStudioLevels(int); + /// Set audio delay. extern void VideoSetAudioDelay(int);