mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Added play mode pmAudioOnlyBlack
This commit is contained in:
parent
706a6e1beb
commit
c40fdb05a3
@ -146,6 +146,7 @@ Stefan Huelswitt <huels@iname.com>
|
|||||||
for implementing several replay modes to allow players that play only audio
|
for implementing several replay modes to allow players that play only audio
|
||||||
for improving cCondVar::Wait() and implementing cCondVar::TimedWait()
|
for improving cCondVar::Wait() and implementing cCondVar::TimedWait()
|
||||||
for reporting a bug when entering an integer value outside the limit
|
for reporting a bug when entering an integer value outside the limit
|
||||||
|
for adding play mode pmAudioOnlyBlack
|
||||||
|
|
||||||
Ulrich Röder <roeder@efr-net.de>
|
Ulrich Röder <roeder@efr-net.de>
|
||||||
for pointing out that there are channels that have a symbol rate higher than
|
for pointing out that there are channels that have a symbol rate higher than
|
||||||
|
1
HISTORY
1
HISTORY
@ -1458,3 +1458,4 @@ Video Disk Recorder Revision History
|
|||||||
- Implemented an SPU decoder (thanks to Andreas Schultz).
|
- Implemented an SPU decoder (thanks to Andreas Schultz).
|
||||||
- Fixed a crash when entering an integer value outside the limits (thanks to
|
- Fixed a crash when entering an integer value outside the limits (thanks to
|
||||||
Stefan Huelswitt for reporting this one).
|
Stefan Huelswitt for reporting this one).
|
||||||
|
- Added play mode pmAudioOnlyBlack (thanks to Stefan Huelswitt).
|
||||||
|
3
device.h
3
device.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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
|
#ifndef __DEVICE_H
|
||||||
@ -29,6 +29,7 @@ enum eSetChannelResult { scrOk, scrNotAvailable, scrNoTransfer, scrFailed };
|
|||||||
enum ePlayMode { pmNone, // audio/video from decoder
|
enum ePlayMode { pmNone, // audio/video from decoder
|
||||||
pmAudioVideo, // audio/video from player
|
pmAudioVideo, // audio/video from player
|
||||||
pmAudioOnly, // audio only from player, video from decoder
|
pmAudioOnly, // audio only from player, video from decoder
|
||||||
|
pmAudioOnlyBlack, // audio only from player, no video (black screen)
|
||||||
pmExtern_THIS_SHOULD_BE_AVOIDED
|
pmExtern_THIS_SHOULD_BE_AVOIDED
|
||||||
// external player (e.g. MPlayer), release the device
|
// external player (e.g. MPlayer), release the device
|
||||||
// WARNING: USE THIS MODE ONLY AS A LAST RESORT, IF YOU
|
// WARNING: USE THIS MODE ONLY AS A LAST RESORT, IF YOU
|
||||||
|
21
dvbdevice.c
21
dvbdevice.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "dvbdevice.h"
|
||||||
@ -663,11 +663,12 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
|
|||||||
siProcessor->SetStatus(true);
|
siProcessor->SetStatus(true);
|
||||||
break;
|
break;
|
||||||
case pmAudioVideo:
|
case pmAudioVideo:
|
||||||
|
case pmAudioOnlyBlack:
|
||||||
if (siProcessor)
|
if (siProcessor)
|
||||||
siProcessor->SetStatus(false);
|
siProcessor->SetStatus(false);
|
||||||
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
|
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
|
||||||
CHECK(ioctl(fd_audio, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY));
|
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_audio, AUDIO_PLAY));
|
||||||
CHECK(ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY));
|
CHECK(ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY));
|
||||||
CHECK(ioctl(fd_video, VIDEO_PLAY));
|
CHECK(ioctl(fd_video, VIDEO_PLAY));
|
||||||
@ -711,19 +712,31 @@ void cDvbDevice::Clear(void)
|
|||||||
|
|
||||||
void cDvbDevice::Play(void)
|
void cDvbDevice::Play(void)
|
||||||
{
|
{
|
||||||
|
if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
|
||||||
|
if (fd_audio >= 0)
|
||||||
|
CHECK(ioctl(fd_audio, AUDIO_CONTINUE));
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (fd_audio >= 0)
|
if (fd_audio >= 0)
|
||||||
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
|
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
|
||||||
if (fd_video >= 0)
|
if (fd_video >= 0)
|
||||||
CHECK(ioctl(fd_video, VIDEO_CONTINUE));
|
CHECK(ioctl(fd_video, VIDEO_CONTINUE));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cDvbDevice::Freeze(void)
|
void cDvbDevice::Freeze(void)
|
||||||
{
|
{
|
||||||
|
if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
|
||||||
|
if (fd_audio >= 0)
|
||||||
|
CHECK(ioctl(fd_audio, AUDIO_PAUSE));
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (fd_audio >= 0)
|
if (fd_audio >= 0)
|
||||||
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
|
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
|
||||||
if (fd_video >= 0)
|
if (fd_video >= 0)
|
||||||
CHECK(ioctl(fd_video, VIDEO_FREEZE));
|
CHECK(ioctl(fd_video, VIDEO_FREEZE));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cDvbDevice::Mute(void)
|
void cDvbDevice::Mute(void)
|
||||||
{
|
{
|
||||||
@ -760,13 +773,13 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
|
|||||||
|
|
||||||
bool cDvbDevice::Poll(cPoller &Poller, int TimeoutMs)
|
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);
|
return Poller.Poll(TimeoutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cDvbDevice::PlayVideo(const uchar *Data, int Length)
|
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)
|
if (fd >= 0)
|
||||||
return write(fd, Data, Length);
|
return write(fd, Data, Length);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user