Added play mode pmAudioOnlyBlack

This commit is contained in:
Klaus Schmidinger 2002-09-08 15:04:33 +02:00
parent 706a6e1beb
commit c40fdb05a3
4 changed files with 32 additions and 16 deletions

View File

@ -146,6 +146,7 @@ Stefan Huelswitt <huels@iname.com>
for implementing several replay modes to allow players that play only audio
for improving cCondVar::Wait() and implementing cCondVar::TimedWait()
for reporting a bug when entering an integer value outside the limit
for adding play mode pmAudioOnlyBlack
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than

View File

@ -1458,3 +1458,4 @@ Video Disk Recorder Revision History
- Implemented an SPU decoder (thanks to Andreas Schultz).
- Fixed a crash when entering an integer value outside the limits (thanks to
Stefan Huelswitt for reporting this one).
- Added play mode pmAudioOnlyBlack (thanks to Stefan Huelswitt).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.h 1.15 2002/09/08 14:02:50 kls Exp $
* $Id: device.h 1.16 2002/09/08 14:56:21 kls Exp $
*/
#ifndef __DEVICE_H
@ -26,9 +26,10 @@
enum eSetChannelResult { scrOk, scrNotAvailable, scrNoTransfer, scrFailed };
enum ePlayMode { pmNone, // audio/video from decoder
pmAudioVideo, // audio/video from player
pmAudioOnly, // audio only from player, video from decoder
enum ePlayMode { pmNone, // audio/video from decoder
pmAudioVideo, // audio/video from player
pmAudioOnly, // audio only from player, video from decoder
pmAudioOnlyBlack, // audio only from player, no video (black screen)
pmExtern_THIS_SHOULD_BE_AVOIDED
// external player (e.g. MPlayer), release the device
// WARNING: USE THIS MODE ONLY AS A LAST RESORT, IF YOU

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbdevice.c 1.12 2002/09/08 14:07:08 kls Exp $
* $Id: dvbdevice.c 1.13 2002/09/08 15:00:46 kls Exp $
*/
#include "dvbdevice.h"
@ -663,11 +663,12 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
siProcessor->SetStatus(true);
break;
case pmAudioVideo:
case pmAudioOnlyBlack:
if (siProcessor)
siProcessor->SetStatus(false);
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
CHECK(ioctl(fd_audio, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY));
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, PlayMode == pmAudioVideo));
CHECK(ioctl(fd_audio, AUDIO_PLAY));
CHECK(ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY));
CHECK(ioctl(fd_video, VIDEO_PLAY));
@ -711,18 +712,30 @@ void cDvbDevice::Clear(void)
void cDvbDevice::Play(void)
{
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
if (fd_video >= 0)
CHECK(ioctl(fd_video, VIDEO_CONTINUE));
if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_CONTINUE));
}
else {
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
if (fd_video >= 0)
CHECK(ioctl(fd_video, VIDEO_CONTINUE));
}
}
void cDvbDevice::Freeze(void)
{
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
if (fd_video >= 0)
CHECK(ioctl(fd_video, VIDEO_FREEZE));
if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_PAUSE));
}
else {
if (fd_audio >= 0)
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
if (fd_video >= 0)
CHECK(ioctl(fd_video, VIDEO_FREEZE));
}
}
void cDvbDevice::Mute(void)
@ -760,13 +773,13 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
bool cDvbDevice::Poll(cPoller &Poller, int TimeoutMs)
{
Poller.Add(playMode == pmAudioOnly ? fd_audio : fd_video, true);
Poller.Add((playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) ? fd_audio : fd_video, true);
return Poller.Poll(TimeoutMs);
}
int cDvbDevice::PlayVideo(const uchar *Data, int Length)
{
int fd = playMode == pmAudioOnly ? fd_audio : fd_video;
int fd = (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) ? fd_audio : fd_video;
if (fd >= 0)
return write(fd, Data, Length);
return -1;