summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-02-20 12:01:05 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-02-20 12:01:05 +0100
commit51f41252cf70ab0364a411648ed0aa2015e40162 (patch)
tree81e4ad59e2d6b1d948e0f3b716b7a7194e050a4f /device.c
parentf038aaefc84aa0695102dca7c30537b20fd2fa21 (diff)
downloadvdr-51f41252cf70ab0364a411648ed0aa2015e40162.tar.gz
vdr-51f41252cf70ab0364a411648ed0aa2015e40162.tar.bz2
Added support for setting the video display mode
Diffstat (limited to 'device.c')
-rw-r--r--device.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/device.c b/device.c
index 8685e3c0..629ad8eb 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.93 2005/02/19 12:20:39 kls Exp $
+ * $Id: device.c 1.94 2005/02/20 11:41:03 kls Exp $
*/
#include "device.h"
@@ -235,6 +235,7 @@ bool cDevice::SetPrimaryDevice(int n)
primaryDevice->MakePrimaryDevice(false);
primaryDevice = device[n];
primaryDevice->MakePrimaryDevice(true);
+ primaryDevice->SetVideoFormat(Setup.VideoFormat);
return true;
}
esyslog("ERROR: invalid primary device number: %d", n + 1);
@@ -327,6 +328,28 @@ bool cDevice::GrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX,
return false;
}
+void cDevice::SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
+{
+ cSpuDecoder *spuDecoder = GetSpuDecoder();
+ if (spuDecoder) {
+ if (Setup.VideoFormat)
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuNormal);
+ else {
+ switch (VideoDisplayFormat) {
+ case vdfPanAndScan:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuPanAndScan);
+ break;
+ case vdfLetterBox:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuLetterBox);
+ break;
+ case vdfCenterCutOut:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuNormal);
+ break;
+ }
+ }
+ }
+}
+
void cDevice::SetVideoFormat(bool VideoFormat16_9)
{
}
@@ -836,6 +859,7 @@ void cDevice::Detach(cPlayer *Player)
player->device = NULL;
player = NULL;
SetPlayMode(pmNone);
+ SetVideoDisplayFormat(vdfLetterBox);
Audios.ClearAudio();
}
}