From aa349cfc73290a096d53f4fb65205cc8369cbc40 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 19 Jan 2014 17:24:52 +0100 Subject: [PATCH] [spark] fix setting psi controls Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/cf8f9bc8afded68f9e9e5781edb33da19a3b93f5 Author: martii Date: 2014-01-19 (Sun, 19 Jan 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libspark/video.cpp | 20 +++++++++++++++++++- libspark/video_lib.h | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libspark/video.cpp b/libspark/video.cpp index 7d6a8cf..5ffc559 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -175,6 +175,11 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) { lt_debug("%s unit %u\n", __func__, unit); + brightness = -1; + contrast = -1; + saturation = -1; + hue = -1; + //croppingMode = VID_DISPMODE_NORM; //outputformat = VID_OUTFMT_RGBC_SVIDEO; scartvoltage = -1; @@ -298,7 +303,16 @@ int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned sho #endif playstate = VIDEO_PLAYING; fop(ioctl, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX); - return fop(ioctl, VIDEO_PLAY); + int res = fop(ioctl, VIDEO_PLAY); + if (brightness > -1) + SetControl(VIDEO_CONTROL_BRIGHTNESS, brightness); + if (contrast > -1) + SetControl(VIDEO_CONTROL_CONTRAST, contrast); + if (saturation > -1) + SetControl(VIDEO_CONTROL_SATURATION, saturation); + if (hue > -1) + SetControl(VIDEO_CONTROL_HUE, hue); + return res; } int cVideo::Stop(bool blank) @@ -719,15 +733,19 @@ void cVideo::SetControl(int control, int value) { const char *p = NULL; switch (control) { case VIDEO_CONTROL_BRIGHTNESS: + brightness = value; p = "/proc/stb/video/plane/psi_brightness"; break; case VIDEO_CONTROL_CONTRAST: + contrast = value; p = "/proc/stb/video/plane/psi_contrast"; break; case VIDEO_CONTROL_SATURATION: + saturation = value; p = "/proc/stb/video/plane/psi_saturation"; break; case VIDEO_CONTROL_HUE: + hue = value; p = "/proc/stb/video/plane/psi_tint"; break; } diff --git a/libspark/video_lib.h b/libspark/video_lib.h index a371dc1..5b4e1af 100644 --- a/libspark/video_lib.h +++ b/libspark/video_lib.h @@ -149,6 +149,8 @@ class cVideo int video_standby; int64_t GetPTS(void); + int brightness, contrast, saturation, hue; + void openDevice(void); void closeDevice(void); public: