Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cDvbDevice Class Reference

#include <dvbdevice.h>

Inheritance diagram for cDvbDevice:

Inheritance graph
[legend]
Collaboration diagram for cDvbDevice:

Collaboration graph
[legend]

Detailed Description

Dvb device implementation.

Definition at line 31 of file dvbdevice.h.

Public Methods

 cDvbDevice (int n)
virtual ~cDvbDevice ()
virtual bool HasDecoder (void) const
cOsdBaseNewOsd (int x, int y)
virtual cSpuDecoderGetSpuDecoder (void)
virtual bool ProvidesSource (int Source) const
virtual bool ProvidesChannel (const cChannel *Channel, int Priority=-1, bool *NeedsDetachReceivers=NULL) const
virtual bool GrabImage (const char *FileName, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
virtual void SetVideoFormat (bool VideoFormat16_9)
virtual void TrickSpeed (int Speed)
virtual void Clear (void)
virtual void Play (void)
virtual void Freeze (void)
virtual void Mute (void)
virtual void StillPicture (const uchar *Data, int Length)
virtual bool Poll (cPoller &Poller, int TimeoutMs=0)
virtual int PlayVideo (const uchar *Data, int Length)
virtual void PlayAudio (const uchar *Data, int Length)

Static Public Methods

bool Initialize (void)

Protected Methods

virtual void MakePrimaryDevice (bool On)
virtual bool SetChannelDevice (const cChannel *Channel, bool LiveView)
virtual bool SetPid (cPidHandle *Handle, int Type, bool On)
virtual void SetVolumeDevice (int Volume)
virtual int NumAudioTracksDevice (void) const
virtual const char ** GetAudioTracksDevice (int *CurrentTrack=NULL) const
virtual void SetAudioTrackDevice (int Index)
virtual bool CanReplay (void) const
virtual bool SetPlayMode (ePlayMode PlayMode)
virtual bool OpenDvr (void)
virtual void CloseDvr (void)
virtual bool GetTSPacket (uchar *&Data)

Protected Attributes

ePlayMode playMode

Private Methods

int OsdDeviceHandle (void) const

Static Private Methods

bool Probe (const char *FileName)

Private Attributes

fe_type_t frontendType
int fd_osd
int fd_audio
int fd_video
int fd_dvr
cDvbSpuDecoderspuDecoder
cDvbTunerdvbTuner
int aPid1
int aPid2
cSIProcessorsiProcessor
cTSBuffertsBuffer

Friends

class cDvbOsd


Constructor & Destructor Documentation

cDvbDevice::cDvbDevice int    n
 

Definition at line 261 of file dvbdevice.c.

References aPid1, aPid2, cDevice::CardIndex(), DvbName(), DvbOpen(), dvbTuner, esyslog, fd_audio, fd_dvr, fd_osd, fd_video, frontendType, LOG_ERROR, playMode, pmNone, SetVideoFormat(), siProcessor, and spuDecoder.

Referenced by Initialize().

cDvbDevice::~cDvbDevice   [virtual]
 

Definition at line 305 of file dvbdevice.c.

References dvbTuner, siProcessor, and spuDecoder.


Member Function Documentation

bool cDvbDevice::CanReplay void    const [protected, virtual]
 

Returns true if this device can currently start a replay session.

Reimplemented from cDevice.

Definition at line 695 of file dvbdevice.c.

References cDevice::Ca(), cDevice::CanReplay(), and cDevice::Receiving().

void cDvbDevice::Clear void    [virtual]
 

Clears all video and audio data from the device. A derived class must call the base class function to make sure all registered cAudio objects are notified.

Reimplemented from cDevice.

Definition at line 771 of file dvbdevice.c.

References CHECK, fd_audio, and fd_video.

void cDvbDevice::CloseDvr void    [protected, virtual]
 

Closes driver ???

Reimplemented from cDevice.

Definition at line 869 of file dvbdevice.c.

References fd_dvr, and tsBuffer.

Referenced by OpenDvr().

void cDvbDevice::Freeze void    [virtual]
 

Puts the device into "freeze frame" mode.

Reimplemented from cDevice.

Definition at line 793 of file dvbdevice.c.

References CHECK, fd_audio, fd_video, playMode, pmAudioOnly, and pmAudioOnlyBlack.

const char ** cDvbDevice::GetAudioTracksDevice int *    CurrentTrack = NULL const [protected, virtual]
 

Returns a list of currently available audio tracks. The last entry in the list must be NULL. The number of entries does not necessarily have to be the same as returned by a previous call to NumAudioTracksDevice(). If CurrentTrack is given, it will be set to the index of the current track in the returned list. Note that the list must not be changed after it has been returned by a call to GetAudioTracksDevice()! The only time the list may change is *inside* the GetAudioTracksDevice() function. By default the return value is NULL and CurrentTrack, if given, will not have any meaning.

Reimplemented from cDevice.

Definition at line 674 of file dvbdevice.c.

References aPid1, NumAudioTracksDevice(), cDevice::pidHandles, and cDevice::ptAudio.

cSpuDecoder * cDvbDevice::GetSpuDecoder void    [virtual]
 

Returns a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder).

Reimplemented from cDevice.

Definition at line 370 of file dvbdevice.c.

References cDevice::IsPrimaryDevice(), and spuDecoder.

bool cDvbDevice::GetTSPacket uchar *&    Data [protected, virtual]
 

Reception od TS package

Reimplemented from cDevice.

Definition at line 879 of file dvbdevice.c.

References cDevice::CardIndex(), esyslog, cTSBuffer::Get(), LOG_ERROR, cTSBuffer::Read(), and tsBuffer.

bool cDvbDevice::GrabImage const char *    FileName,
bool    Jpeg = true,
int    Quality = -1,
int    SizeX = -1,
int    SizeY = -1
[virtual]
 

Image Grab facilities

Reimplemented from cDevice.

Definition at line 377 of file dvbdevice.c.

References cDevice::CardIndex(), isyslog, and LOG_ERROR_STR.

bool cDvbDevice::HasDecoder void    const [virtual]
 

Tells whether this device has an MPEG decoder.

Reimplemented from cDevice.

Definition at line 360 of file dvbdevice.c.

References fd_audio, and fd_video.

Referenced by SetChannelDevice(), SetVideoFormat(), and SetVolumeDevice().

bool cDvbDevice::Initialize void    [static]
 

Initializes the DVB devices. Must be called before accessing any DVB functions.

Returns:
True if any devices are available.

Definition at line 331 of file dvbdevice.c.

References cDvbDevice(), DvbName(), isyslog, MAXDVBDEVICES, cDevice::NextCardIndex(), Probe(), and cDevice::UseDevice().

Referenced by main().

void cDvbDevice::MakePrimaryDevice bool    On [protected, virtual]
 

Informs a device that it will be the primary device. If there is anything the device needs to set up when it becomes the primary device (On = true) or to shut down when it no longer is the primary device (On = false), it should do so in this function.

Reimplemented from cDevice.

Definition at line 355 of file dvbdevice.c.

References cDvbOsd::SetDvbDevice().

void cDvbDevice::Mute void    [virtual]
 

Turns off audio while replaying. A derived class must call the base class function to make sure all registered cAudio objects are notified.

Reimplemented from cDevice.

Definition at line 807 of file dvbdevice.c.

References CHECK, and fd_audio.

Referenced by StillPicture().

cOsdBase * cDvbDevice::NewOsd int    x,
int    y
[virtual]
 

Intializes a new osd at coordintes x and y

Reimplemented from cDevice.

Definition at line 365 of file dvbdevice.c.

References cDvbOsd.

int cDvbDevice::NumAudioTracksDevice void    const [protected, virtual]
 

Returns the number of audio tracks that are currently available on this device. The default return value is 0, meaning that this device doesn't have multiple audio track capabilities. The return value may change with every call and need not necessarily be the number of list entries returned by GetAudioTracksDevice(). This function is mainly called to decide whether there should be an "Audio" button in a menu.

Reimplemented from cDevice.

Definition at line 664 of file dvbdevice.c.

References aPid1, aPid2, and cDevice::Ca().

Referenced by GetAudioTracksDevice(), and SetAudioTrackDevice().

bool cDvbDevice::OpenDvr void    [protected, virtual]
 

Opens driver ???

Reimplemented from cDevice.

Definition at line 860 of file dvbdevice.c.

References cDevice::CardIndex(), CloseDvr(), DvbOpen(), fd_dvr, MEGABYTE, and tsBuffer.

int cDvbDevice::OsdDeviceHandle void    const [inline, private]
 

Definition at line 52 of file dvbdevice.h.

Referenced by cDvbOsd::cDvbOsd().

void cDvbDevice::Play void    [virtual]
 

Sets the device into play mode (after a previous trick mode).

Reimplemented from cDevice.

Definition at line 779 of file dvbdevice.c.

References CHECK, fd_audio, fd_video, playMode, pmAudioOnly, and pmAudioOnlyBlack.

void cDvbDevice::PlayAudio const uchar   Data,
int    Length
[virtual]
 

Plays additional audio streams, like Dolby Digital. A derived class must call the base class function to make sure data is distributed to all registered cAudio objects.

Reimplemented from cDevice.

Definition at line 854 of file dvbdevice.c.

References cDevice::PlayAudio().

int cDvbDevice::PlayVideo const uchar   Data,
int    Length
[virtual]
 

Actually plays the given data block as video. The data must be part of a PES (Packetized Elementary Stream) which can contain one video and one audio strem.

Reimplemented from cDevice.

Definition at line 846 of file dvbdevice.c.

References fd_audio, fd_video, playMode, pmAudioOnly, and pmAudioOnlyBlack.

bool cDvbDevice::Poll cPoller   Poller,
int    TimeoutMs = 0
[virtual]
 

Returns true if the device itself or any of the file handles in Poller is ready for further action. If TimeoutMs is not zero, the device will wait up to the given number of milleseconds before returning in case there is no immediate need for data.

Reimplemented from cDevice.

Definition at line 840 of file dvbdevice.c.

References cPoller::Add(), and cPoller::Poll().

bool cDvbDevice::Probe const char *    FileName [static, private]
 

Probes for existing DVB devices.

Definition at line 314 of file dvbdevice.c.

References dsyslog, and LOG_ERROR_STR.

Referenced by Initialize().

bool cDvbDevice::ProvidesChannel const cChannel   Channel,
int    Priority = -1,
bool *    NeedsDetachReceivers = NULL
const [virtual]
 

Returns true if this device can provide the given channel. In case the device has cReceivers attached to it or it is the primary device, Priority is used to decide whether the caller's request can be honored. The special Priority value -1 will tell the caller whether this device is principally able to provide the given Channel, regardless of any attached cReceivers. If NeedsDetachReceivers is given, the resulting value in it will tell the caller whether or not it will have to detach any currently attached receivers from this device before calling SwitchChannel. Note that the return value in NeedsDetachReceivers is only meaningful if the function itself actually returns true. The default implementation always returns false, so a derived cDevice class that can provide channels must implement this function.

Reimplemented from cDevice.

Definition at line 533 of file dvbdevice.c.

References cChannel::Ca(), CACONFBASE, dvbTuner, cDevice::HasPid(), cDevice::IsPrimaryDevice(), cDvbTuner::IsTunedTo(), cDevice::Priority(), cDevice::ProvidesCa(), ProvidesSource(), cDevice::Receiving(), cChannel::Source(), and cChannel::Vpid().

bool cDvbDevice::ProvidesSource int    Source const [virtual]
 

Returns true if this device can provide the given source.

Reimplemented from cDevice.

Definition at line 523 of file dvbdevice.c.

References frontendType, cSource::st_Mask, cSource::stCable, cSource::stNone, cSource::stSat, and cSource::stTerr.

Referenced by ProvidesChannel().

void cDvbDevice::SetAudioTrackDevice int    Index [protected, virtual]
 

Sets the current audio track to the given value, which should be within the range of the list returned by a previous call to GetAudioTracksDevice() (otherwise nothing will happen).

Reimplemented from cDevice.

Definition at line 686 of file dvbdevice.c.

References aPid1, aPid2, NumAudioTracksDevice(), cDevice::pidHandles, cDevice::ptAudio, and SetPid().

bool cDvbDevice::SetChannelDevice const cChannel   Channel,
bool    LiveView
[protected, virtual]
 

Sets the device to the given channel (actual physical setup).

Reimplemented from cDevice.

Definition at line 566 of file dvbdevice.c.

References cDevice::AddPid(), cChannel::Apid1(), aPid1, cChannel::Apid2(), aPid2, cChannel::Ca(), CACONFBASE, cDevice::CardIndex(), CHECK, cDevice::DelPid(), cChannel::Dpid1(), cChannel::Dpid2(), dvbTuner, esyslog, cChannel::Frequency(), HasDecoder(), cDevice::HasPid(), cDevice::IsPrimaryDevice(), cDvbTuner::IsTunedTo(), cControl::Launch(), cChannel::Number(), cDevice::pidHandles, cDevice::ptAudio, cDevice::ptTeletext, cDevice::ptVideo, cDvbTuner::Set(), cSIProcessor::SetCurrentTransponder(), siProcessor, cChannel::Source(), cChannel::Tpid(), and cChannel::Vpid().

bool cDvbDevice::SetPid cPidHandle *    Handle,
int    Type,
bool    On
[protected, virtual]
 

Sets PID

Reimplemented from cDevice.

Definition at line 483 of file dvbdevice.c.

References cDevice::CardIndex(), CHECK, DvbOpen(), LOG_ERROR, PesTypes, cDevice::ptOther, cDevice::ptTeletext, and SetPlayMode().

Referenced by SetAudioTrackDevice().

bool cDvbDevice::SetPlayMode ePlayMode    PlayMode [protected, virtual]
 

Sets play mode, which is defined in ePlayMode, it can be chosen from four different posibilities

Reimplemented from cDevice.

Definition at line 704 of file dvbdevice.c.

References cDevice::CardIndex(), CHECK, DvbOpen(), fd_audio, fd_video, playMode, pmAudioOnly, pmAudioOnlyBlack, pmAudioVideo, pmExtern_THIS_SHOULD_BE_AVOIDED, pmNone, cSIProcessor::SetStatus(), SetVideoFormat(), and siProcessor.

Referenced by SetPid().

void cDvbDevice::SetVideoFormat bool    VideoFormat16_9 [virtual]
 

Sets video format to 16:9

Reimplemented from cDevice.

Definition at line 474 of file dvbdevice.c.

References CHECK, and HasDecoder().

Referenced by cDvbDevice(), and SetPlayMode().

void cDvbDevice::SetVolumeDevice int    Volume [protected, virtual]
 

Sets the audio volume on this device (Volume = 0...255).

Reimplemented from cDevice.

Definition at line 655 of file dvbdevice.c.

References CHECK, and HasDecoder().

void cDvbDevice::StillPicture const uchar   Data,
int    Length
[virtual]
 

Displays the given I-frame as a still picture.

Reimplemented from cDevice.

Definition at line 815 of file dvbdevice.c.

References CHECK, Mute(), and safe_write().

void cDvbDevice::TrickSpeed int    Speed [virtual]
 

Sets the device into a mode where replay is done slower. Every single frame shall then be displayed the given number of times.

Reimplemented from cDevice.

Definition at line 765 of file dvbdevice.c.

References CHECK, and fd_video.


Friends And Related Function Documentation

friend class cDvbOsd [friend]
 

Definition at line 32 of file dvbdevice.h.

Referenced by NewOsd().


Field Documentation

int cDvbDevice::aPid1 [private]
 

Audio facilities

Definition at line 114 of file dvbdevice.h.

Referenced by cDvbDevice(), GetAudioTracksDevice(), NumAudioTracksDevice(), SetAudioTrackDevice(), and SetChannelDevice().

int cDvbDevice::aPid2 [private]
 

Audio facilities

Definition at line 114 of file dvbdevice.h.

Referenced by cDvbDevice(), NumAudioTracksDevice(), SetAudioTrackDevice(), and SetChannelDevice().

cDvbTuner* cDvbDevice::dvbTuner [private]
 

Channel facilities

Definition at line 77 of file dvbdevice.h.

Referenced by cDvbDevice(), ProvidesChannel(), SetChannelDevice(), and ~cDvbDevice().

int cDvbDevice::fd_audio [private]
 

Definition at line 51 of file dvbdevice.h.

Referenced by cDvbDevice(), Clear(), Freeze(), HasDecoder(), Mute(), Play(), PlayVideo(), and SetPlayMode().

int cDvbDevice::fd_dvr [private]
 

Definition at line 51 of file dvbdevice.h.

Referenced by cDvbDevice(), CloseDvr(), and OpenDvr().

int cDvbDevice::fd_osd [private]
 

Definition at line 51 of file dvbdevice.h.

Referenced by cDvbDevice().

int cDvbDevice::fd_video [private]
 

Definition at line 51 of file dvbdevice.h.

Referenced by cDvbDevice(), Clear(), Freeze(), HasDecoder(), Play(), PlayVideo(), SetPlayMode(), and TrickSpeed().

fe_type_t cDvbDevice::frontendType [private]
 

Definition at line 50 of file dvbdevice.h.

Referenced by cDvbDevice(), and ProvidesSource().

ePlayMode cDvbDevice::playMode [protected]
 

Player facilities

Definition at line 132 of file dvbdevice.h.

Referenced by cDvbDevice(), Freeze(), Play(), PlayVideo(), and SetPlayMode().

cSIProcessor* cDvbDevice::siProcessor [private]
 

EIT facilities

Definition at line 126 of file dvbdevice.h.

Referenced by cDvbDevice(), SetChannelDevice(), SetPlayMode(), and ~cDvbDevice().

cDvbSpuDecoder* cDvbDevice::spuDecoder [private]
 

OSD facilities

Definition at line 64 of file dvbdevice.h.

Referenced by cDvbDevice(), GetSpuDecoder(), and ~cDvbDevice().

cTSBuffer* cDvbDevice::tsBuffer [private]
 

cTSBuffer implements a simple buffer that allows the device to read a larger amount of data from the driver with each call to Read(), thus avoiding the overhead of getting each TS packet separately from the driver. It also makes sure the returned data points to a TS packet and automatically re-synchronizes after broken packet.

Definition at line 163 of file dvbdevice.h.

Referenced by CloseDvr(), GetTSPacket(), and OpenDvr().


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 23:31:09 2003 for VDR by doxygen1.3-rc2