summaryrefslogtreecommitdiff
path: root/dxr3interface.c
diff options
context:
space:
mode:
authoraustriancoder <austriancoder>2004-08-11 01:33:28 +0000
committeraustriancoder <austriancoder>2004-08-11 01:33:28 +0000
commitea4d7c6dd0db6f0ed224a240a65bbbbaffedfb33 (patch)
treecf6f21ac937fcd2ef6f0e15565a3bcf2bfdffe2a /dxr3interface.c
parent9d027356d1e072f5fbdaa38e148647e29626c272 (diff)
downloadvdr-plugin-dxr3-ea4d7c6dd0db6f0ed224a240a65bbbbaffedfb33.tar.gz
vdr-plugin-dxr3-ea4d7c6dd0db6f0ed224a240a65bbbbaffedfb33.tar.bz2
added basic support to set brightness/contrast/saturation
Diffstat (limited to 'dxr3interface.c')
-rw-r--r--dxr3interface.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/dxr3interface.c b/dxr3interface.c
index efe1d46..052cd43 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -1,9 +1,9 @@
#include <assert.h>
#include <math.h>
#include <sys/soundcard.h>
+
#include "dxr3interface.h"
#include "dxr3syncbuffer.h"
-
#include "dxr3log.h"
#include "dxr3configdata.h"
@@ -36,6 +36,7 @@ static int Dxr3Open(const char *Name, int n, int Mode)
}
// ==================================
+// constr.
cDxr3Interface::cDxr3Interface()
{
// open control stream
@@ -88,6 +89,16 @@ cDxr3Interface::cDxr3Interface()
// configure device based on settings
ConfigureDevice();
+ // get bcs values from driver
+ ioctl(m_fdControl, EM8300_IOCTL_GETBCS, &m_bcs);
+
+ if (cDxr3ConfigData::Instance().GetDebug())
+ {
+ cLog::Instance() << "DXR3: brightness: " << m_bcs.brightness << "\n";
+ cLog::Instance() << "DXR3: contrast: " << m_bcs.contrast << "\n";
+ cLog::Instance() << "DXR3: saturation: " << m_bcs.saturation << "\n";
+ }
+
PlayBlackFrame();
SetChannelCount(1);
}
@@ -213,7 +224,7 @@ void cDxr3Interface::SetAudioSpeed(uint32_t speed)
{
if (m_audioMode != EM8300_AUDIOMODE_DIGITALAC3)
{
- if(ioctl(m_fdAudio, SNDCTL_DSP_SPEED, &speed) < 0)
+ if (ioctl(m_fdAudio, SNDCTL_DSP_SPEED, &speed) < 0)
{
cLog::Instance() << "cDxr3AbsDevice::SetAudioSpeed Unable to set dsp speed\n";
}
@@ -1069,5 +1080,42 @@ void cDxr3Interface::ResetHardware()
Unlock();
}
+// set brightness/contrast/saturation
+// ==================================
+// set brightness
+void cDxr3Interface::SetBrightness(int value)
+{
+ m_bcs.brightness = value;
+
+ if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0)
+ {
+ cLog::Instance() << "cDxr3Interface::SetBrightness: Unable to set brightness to " << value << "\n";
+ }
+}
+
+// ==================================
+// set contrast
+void cDxr3Interface::SetContrast(int value)
+{
+ m_bcs.contrast = value;
+
+ if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0)
+ {
+ cLog::Instance() << "cDxr3Interface::SetContrast: Unable to set contrast to " << value << "\n";
+ }
+}
+
+// ==================================
+// set saturation
+void cDxr3Interface::SetSaturation(int value)
+{
+ m_bcs.saturation = value;
+
+ if (ioctl(m_fdControl, EM8300_IOCTL_SETBCS, &m_bcs) < 0)
+ {
+ cLog::Instance() << "cDxr3Interface::SetSaturation: Unable to set saturation to " << value << "\n";
+ }
+}
+
// ==================================
cMutex* cDxr3Interface::m_pMutex = new cMutex;