vdr  1.7.27
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
cDvbSdFfDevice Class Reference

#include <dvbsdffdevice.h>

List of all members.

Public Member Functions

 cDvbSdFfDevice (int Adapter, int Frontend, bool OutputOnly)
virtual ~cDvbSdFfDevice ()
virtual bool HasDecoder (void) const
virtual bool AvoidRecording (void) const
virtual cSpuDecoderGetSpuDecoder (void)
virtual bool ProvidesSource (int Source) const
virtual ucharGrabImage (int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
virtual void SetVideoDisplayFormat (eVideoDisplayFormat VideoDisplayFormat)
virtual void SetVideoFormat (bool VideoFormat16_9)
virtual eVideoSystem GetVideoSystem (void)
virtual void GetVideoSize (int &Width, int &Height, double &VideoAspect)
virtual void GetOsdSize (int &Width, int &Height, double &PixelAspect)
virtual int64_t GetSTC (void)
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 bool Flush (int TimeoutMs=0)

Protected Member Functions

virtual void MakePrimaryDevice (bool On)
virtual bool SetChannelDevice (const cChannel *Channel, bool LiveView)
virtual bool SetPid (cPidHandle *Handle, int Type, bool On)
virtual void SetAudioTrackDevice (eTrackType Type)
virtual int GetAudioChannelDevice (void)
virtual void SetAudioChannelDevice (int AudioChannel)
virtual void SetVolumeDevice (int Volume)
virtual void SetDigitalAudioDevice (bool On)
virtual bool CanReplay (void) const
virtual bool SetPlayMode (ePlayMode PlayMode)
virtual int PlayVideo (const uchar *Data, int Length)
virtual int PlayAudio (const uchar *Data, int Length, uchar Id)
virtual int PlayTsVideo (const uchar *Data, int Length)
virtual int PlayTsAudio (const uchar *Data, int Length)

Protected Attributes

ePlayMode playMode

Private Member Functions

void TurnOffLiveMode (bool LiveView)
bool SetAudioBypass (bool On)

Private Attributes

int fd_osd
int fd_audio
int fd_video
int fd_stc
bool outputOnly
cDvbSpuDecoderspuDecoder
int devVideoIndex
bool digitalAudio

Static Private Attributes

static int devVideoOffset = -1

Detailed Description

The cDvbSdFfDevice implements a DVB device which can be accessed through the Linux DVB driver API.

Definition at line 17 of file dvbsdffdevice.h.


Constructor & Destructor Documentation

cDvbSdFfDevice::cDvbSdFfDevice ( int  Adapter,
int  Frontend,
bool  OutputOnly 
)

Definition at line 71 of file dvbsdffdevice.c.

References spuDecoder.


Member Function Documentation

bool cDvbSdFfDevice::AvoidRecording ( void  ) const [virtual]

Returns true if this device should only be used for recording if no other device is available.

Reimplemented from cDevice.

Definition at line 90 of file dvbsdffdevice.c.

bool cDvbSdFfDevice::CanReplay ( void  ) const [protected, virtual]

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

Reimplemented from cDevice.

Definition at line 504 of file dvbsdffdevice.c.

void cDvbSdFfDevice::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 595 of file dvbsdffdevice.c.

References CHECK, fd_audio, and fd_video.

bool cDvbSdFfDevice::Flush ( int  TimeoutMs = 0) [virtual]

Returns true if the device's output buffers are empty, i.

e. any data which was buffered so far has been processed. If TimeoutMs is not zero, the device will wait up to the given number of milliseconds before returning in case there is still data in the buffers.

Reimplemented from cDevice.

Definition at line 734 of file dvbsdffdevice.c.

void cDvbSdFfDevice::Freeze ( void  ) [virtual]

Puts the device into "freeze frame" mode.

Reimplemented from cDevice.

Definition at line 621 of file dvbsdffdevice.c.

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

int cDvbSdFfDevice::GetAudioChannelDevice ( void  ) [protected, virtual]

Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).

Reimplemented from cDevice.

Definition at line 445 of file dvbsdffdevice.c.

References CHECK, and fd_audio.

void cDvbSdFfDevice::GetOsdSize ( int &  Width,
int &  Height,
double &  PixelAspect 
) [virtual]

Returns the Width, Height and PixelAspect ratio the OSD should use to best fit the resolution of the output device.

If PixelAspect is not 1.0, the OSD may take this as a hint to scale its graphics in a way that, e.g., a circle will actually show up as a circle on the screen, and not as an ellipse. Values greater than 1.0 mean to stretch the graphics in the vertical direction (or shrink it in the horizontal direction, depending on which dimension shall be fixed). Values less than 1.0 work the other way round. Note that the OSD is not guaranteed to actually use this hint.

Reimplemented from cDevice.

Definition at line 280 of file dvbsdffdevice.c.

References fd_video, LOG_ERROR, Setup, and cSetup::VideoFormat.

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 95 of file dvbsdffdevice.c.

References cDevice::IsPrimaryDevice(), and spuDecoder.

int64_t cDvbSdFfDevice::GetSTC ( void  ) [virtual]

Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.

If this device is able to replay, it must provide an STC. The value returned doesn't need to be an actual "clock" value, it is sufficient if it holds the PTS (Presentation Time Stamp) of the most recently presented frame. A proper value must be returned in normal replay mode as well as in any trick modes (like slow motion, fast forward/rewind). Only the lower 32 bit of this value are actually used, since some devices can't handle the msb correctly.

Reimplemented from cDevice.

Definition at line 575 of file dvbsdffdevice.c.

References cDevice::CardIndex(), esyslog, and fd_stc.

void cDvbSdFfDevice::GetVideoSize ( int &  Width,
int &  Height,
double &  VideoAspect 
) [virtual]

Returns the Width, Height and VideoAspect ratio of the currently displayed video material.

Width and Height are given in pixel (e.g. 720x576) and VideoAspect is e.g. 1.33333 for a 4:3 broadcast, or 1.77778 for 16:9. The default implementation returns 0 for Width and Height and 1.0 for VideoAspect.

Reimplemented from cDevice.

Definition at line 259 of file dvbsdffdevice.c.

References fd_video, and LOG_ERROR.

Returns the video system of the currently displayed material (default is PAL).

Reimplemented from cDevice.

Definition at line 244 of file dvbsdffdevice.c.

References fd_video, LOG_ERROR, vsNTSC, and vsPAL.

uchar * cDvbSdFfDevice::GrabImage ( int &  Size,
bool  Jpeg = true,
int  Quality = -1,
int  SizeX = -1,
int  SizeY = -1 
) [virtual]

Grabs the currently visible screen image.

Parameters:
SizeThe size of the returned data block.
JpegIf true will write a JPEG file. Otherwise a PNM file will be written.
QualityThe compression factor for JPEG. 1 will create a very blocky and small image, 70..80 will yield reasonable quality images while keeping the image file size around 50 KB for a full frame. The default will create a big but very high quality image.
SizeXThe number of horizontal pixels in the frame (default is the current screen width).
SizeYThe number of vertical pixels in the frame (default is the current screen height).
Returns:
A pointer to the grabbed image data, or NULL in case of an error. The caller takes ownership of the returned memory and must free() it once it isn't needed any more.

Reimplemented from cDevice.

Definition at line 102 of file dvbsdffdevice.c.

References DEV_VIDEO, devVideoIndex, dsyslog, esyslog, LOG_ERROR_STR, MALLOC, and RgbToJpeg().

bool cDvbSdFfDevice::HasDecoder ( void  ) const [virtual]

Tells whether this device has an MPEG decoder.

Reimplemented from cDevice.

Definition at line 85 of file dvbsdffdevice.c.

void cDvbSdFfDevice::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. A derived class must call the MakePrimaryDevice() function of its base class.

Reimplemented from cDevice.

Definition at line 78 of file dvbsdffdevice.c.

References fd_osd.

void cDvbSdFfDevice::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 638 of file dvbsdffdevice.c.

References CHECK, and fd_audio.

void cDvbSdFfDevice::Play ( void  ) [virtual]

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

Reimplemented from cDevice.

Definition at line 604 of file dvbsdffdevice.c.

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

int cDvbSdFfDevice::PlayAudio ( const uchar Data,
int  Length,
uchar  Id 
) [protected, virtual]

Plays the given data block as audio.

Data points to exactly one complete PES packet of the given Length. Id indicates the type of audio data this packet holds. PlayAudio() shall process the packet either as a whole (returning Length) or not at all (returning 0 or -1 and setting 'errno' accordingly).

Returns:
Returns the number of bytes actually taken from Data, or -1 in case of an error.

Reimplemented from cDevice.

Definition at line 745 of file dvbsdffdevice.c.

References fd_audio, and WriteAllOrNothing().

int cDvbSdFfDevice::PlayTsAudio ( const uchar Data,
int  Length 
) [protected, virtual]

Plays the given data block as audio.

Data points to exactly one complete TS packet of the given Length (which is always TS_SIZE). PlayTsAudio() shall process the packet either as a whole (returning Length) or not at all (returning 0 or -1 and setting 'errno' accordingly). The default implementation collects all incoming TS payload belonging to one PES packet and calls PlayAudio() with the resulting packet.

Reimplemented from cDevice.

Definition at line 755 of file dvbsdffdevice.c.

References fd_audio, and WriteAllOrNothing().

int cDvbSdFfDevice::PlayTsVideo ( const uchar Data,
int  Length 
) [protected, virtual]

Plays the given data block as video.

Data points to exactly one complete TS packet of the given Length (which is always TS_SIZE). PlayTsVideo() shall process the packet either as a whole (returning Length) or not at all (returning 0 or -1 and setting 'errno' accordingly). The default implementation collects all incoming TS payload belonging to one PES packet and calls PlayVideo() with the resulting packet.

Reimplemented from cDevice.

Definition at line 750 of file dvbsdffdevice.c.

References fd_video, and WriteAllOrNothing().

int cDvbSdFfDevice::PlayVideo ( const uchar Data,
int  Length 
) [protected, virtual]

Plays the given data block as video.

Data points to exactly one complete PES packet of the given Length. PlayVideo() shall process the packet either as a whole (returning Length) or not at all (returning 0 or -1 and setting 'errno' accordingly).

Returns:
Returns the number of bytes actually taken from Data, or -1 in case of an error.

Reimplemented from cDevice.

Definition at line 740 of file dvbsdffdevice.c.

References fd_video, and WriteAllOrNothing().

bool cDvbSdFfDevice::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 milliseconds before returning in case it can't accept any data.

Reimplemented from cDevice.

Definition at line 728 of file dvbsdffdevice.c.

References cPoller::Add(), fd_audio, fd_video, playMode, pmAudioOnly, pmAudioOnlyBlack, and cPoller::Poll().

bool cDvbSdFfDevice::ProvidesSource ( int  Source) const [virtual]

Returns true if this device can provide the given source.

Reimplemented from cDvbDevice.

Definition at line 357 of file dvbsdffdevice.c.

References outputOnly.

bool cDvbSdFfDevice::SetAudioBypass ( bool  On) [private]

Definition at line 305 of file dvbsdffdevice.c.

References fd_audio, and cDvbDevice::setTransferModeForDolbyDigital.

Referenced by SetAudioTrackDevice(), and SetChannelDevice().

void cDvbSdFfDevice::SetAudioChannelDevice ( int  AudioChannel) [protected, virtual]

Sets the audio channel to stereo (0), mono left (1) or mono right (2).

Reimplemented from cDevice.

Definition at line 452 of file dvbsdffdevice.c.

References CHECK, and fd_audio.

void cDvbSdFfDevice::SetAudioTrackDevice ( eTrackType  Type) [protected, virtual]
bool cDvbSdFfDevice::SetChannelDevice ( const cChannel Channel,
bool  LiveView 
) [protected, virtual]
void cDvbSdFfDevice::SetDigitalAudioDevice ( bool  On) [protected, virtual]

Tells the actual device that digital audio output shall be switched on or off.

Reimplemented from cDevice.

Definition at line 467 of file dvbsdffdevice.c.

References cDevice::CurrentVolume(), digitalAudio, cDevice::IsMute(), SetVolumeDevice(), and cCondWait::SleepMs().

bool cDvbSdFfDevice::SetPid ( cPidHandle Handle,
int  Type,
bool  On 
) [protected, virtual]

Does the actual PID setting on this device.

On indicates whether the PID shall be added or deleted. Handle->handle can be used by the device to store information it needs to receive this PID (for instance a file handle). Handle->used indicates how many receivers are using this PID. Type indicates some special types of PIDs, which the device may need to set in a specific way.

Reimplemented from cDvbDevice.

Definition at line 315 of file dvbsdffdevice.c.

References cDvbDevice::adapter, CHECK, DEV_DVB_DEMUX, cDvbDevice::DvbOpen(), cDvbDevice::frontend, cDevice::cPidHandle::handle, LOG_ERROR, PesTypes, cDevice::cPidHandle::pid, pmNone, cDevice::ptOther, cDevice::ptTeletext, SetPlayMode(), and cDevice::cPidHandle::used.

Referenced by SetAudioTrackDevice().

bool cDvbSdFfDevice::SetPlayMode ( ePlayMode  PlayMode) [protected, virtual]

Sets the device into the given play mode.

Returns:
true if the operation was successful.

Reimplemented from cDevice.

Definition at line 509 of file dvbsdffdevice.c.

References cDvbDevice::adapter, CHECK, DEV_DVB_AUDIO, DEV_DVB_VIDEO, cDvbDevice::DvbOpen(), esyslog, fd_audio, fd_video, cDvbDevice::frontend, playMode, pmAudioOnly, pmAudioOnlyBlack, pmAudioVideo, pmExtern_THIS_SHOULD_BE_AVOIDED, pmNone, pmVideoOnly, Setup, SetVideoFormat(), TurnOffLiveMode(), and cSetup::VideoFormat.

Referenced by SetPid().

void cDvbSdFfDevice::SetVideoDisplayFormat ( eVideoDisplayFormat  VideoDisplayFormat) [virtual]

Sets the video display format to the given one (only useful if this device has an MPEG decoder).

A derived class must first call the base class function!

Reimplemented from cDevice.

Definition at line 216 of file dvbsdffdevice.c.

References CHECK, esyslog, fd_video, Setup, vdfCenterCutOut, vdfLetterBox, vdfPanAndScan, and cSetup::VideoFormat.

Referenced by SetVideoFormat().

void cDvbSdFfDevice::SetVideoFormat ( bool  VideoFormat16_9) [virtual]

Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder).

Reimplemented from cDevice.

Definition at line 238 of file dvbsdffdevice.c.

References CHECK, fd_video, Setup, SetVideoDisplayFormat(), and cSetup::VideoDisplayFormat.

Referenced by SetPlayMode().

void cDvbSdFfDevice::SetVolumeDevice ( int  Volume) [protected, virtual]

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

Reimplemented from cDevice.

Definition at line 457 of file dvbsdffdevice.c.

References CHECK, digitalAudio, and fd_audio.

Referenced by SetDigitalAudioDevice().

void cDvbSdFfDevice::StillPicture ( const uchar Data,
int  Length 
) [virtual]

Displays the given I-frame as a still picture.

Data points either to TS (first byte is 0x47) or PES (first byte is 0x00) data of the given Length. The default implementation converts TS to PES and calls itself again, allowing a derived class to display PES if it can't handle TS directly.

Reimplemented from cDevice.

Definition at line 647 of file dvbsdffdevice.c.

References CHECK, fd_video, MALLOC, and TS_SIZE.

void cDvbSdFfDevice::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. The cDvbPlayer uses the following values for the various speeds: 1x 2x 3x Fast Forward 6 3 1 Fast Reverse 6 3 1 Slow Forward 8 4 2 Slow Reverse 63 48 24

Reimplemented from cDevice.

Definition at line 589 of file dvbsdffdevice.c.

References CHECK, and fd_video.

void cDvbSdFfDevice::TurnOffLiveMode ( bool  LiveView) [private]

Member Data Documentation

Definition at line 56 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice(), and GrabImage().

int cDvbSdFfDevice::devVideoOffset = -1 [static, private]

Definition at line 55 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice().

Definition at line 77 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice(), SetDigitalAudioDevice(), and SetVolumeDevice().

int cDvbSdFfDevice::fd_audio [private]
int cDvbSdFfDevice::fd_osd [private]

Definition at line 19 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice(), and MakePrimaryDevice().

int cDvbSdFfDevice::fd_stc [private]

Definition at line 19 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice(), and GetSTC().

int cDvbSdFfDevice::fd_video [private]

Definition at line 87 of file dvbsdffdevice.h.

Referenced by cDvbSdFfDevice(), Freeze(), Play(), Poll(), and SetPlayMode().

Definition at line 32 of file dvbsdffdevice.h.

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


The documentation for this class was generated from the following files: