From 51f41252cf70ab0364a411648ed0aa2015e40162 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 20 Feb 2005 12:01:05 +0100 Subject: Added support for setting the video display mode --- device.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'device.c') 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(); } } -- cgit v1.2.3