vdr  2.2.0
dvbsdffdevice.h
Go to the documentation of this file.
1 /*
2  * dvbsdffdevice.h: The DVB SD Full Featured device interface
3  *
4  * See the README file for copyright information and how to reach the author.
5  *
6  * $Id: dvbsdffdevice.h 3.2 2014/03/15 12:36:35 kls Exp $
7  */
8 
9 #ifndef __DVBSDFFDEVICE_H
10 #define __DVBSDFFDEVICE_H
11 
12 #include <vdr/dvbdevice.h>
13 #include <vdr/dvbspu.h>
14 
16 
17 class cDvbSdFfDevice : public cDvbDevice {
18 private:
20  bool outputOnly;
21 protected:
22  virtual void MakePrimaryDevice(bool On);
23 public:
24  cDvbSdFfDevice(int Adapter, int Frontend, bool OutputOnly);
25  virtual ~cDvbSdFfDevice();
26  virtual bool HasDecoder(void) const;
27  virtual bool AvoidRecording(void) const;
28 
29 // SPU facilities
30 
31 private:
33 public:
34  virtual cSpuDecoder *GetSpuDecoder(void);
35 
36 // Channel facilities
37 
38 public:
39  virtual bool ProvidesSource(int Source) const;
40  virtual int NumProvidedSystems(void) const;
41 private:
42  void TurnOffLiveMode(bool LiveView);
43 protected:
44  virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
45 
46 // PID handle facilities
47 
48 private:
49  bool SetAudioBypass(bool On);
50 protected:
51  virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
52 
53 // Image Grab facilities
54 
55 private:
56  static int devVideoOffset;
58 public:
59  virtual uchar *GrabImage(int &Size, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
60 
61 // Video format facilities
62 
63 public:
64  virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat);
65  virtual void SetVideoFormat(bool VideoFormat16_9);
66  virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect);
67  virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect);
68 
69 // Track facilities
70 
71 protected:
72  virtual void SetAudioTrackDevice(eTrackType Type);
73 
74 // Audio facilities
75 
76 private:
78 protected:
79  virtual int GetAudioChannelDevice(void);
80  virtual void SetAudioChannelDevice(int AudioChannel);
81  virtual void SetVolumeDevice(int Volume);
82  virtual void SetDigitalAudioDevice(bool On);
83 
84 // Player facilities
85 
86 protected:
88  virtual bool CanReplay(void) const;
89  virtual bool SetPlayMode(ePlayMode PlayMode);
90  virtual int PlayVideo(const uchar *Data, int Length);
91  virtual int PlayAudio(const uchar *Data, int Length, uchar Id);
92  virtual int PlayTsVideo(const uchar *Data, int Length);
93  virtual int PlayTsAudio(const uchar *Data, int Length);
94 public:
95  virtual int64_t GetSTC(void);
96  virtual void TrickSpeed(int Speed, bool Forward);
97  virtual void Clear(void);
98  virtual void Play(void);
99  virtual void Freeze(void);
100  virtual void Mute(void);
101  virtual void StillPicture(const uchar *Data, int Length);
102  virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
103  virtual bool Flush(int TimeoutMs = 0);
104  };
105 
107 private:
109 public:
110  cDvbSdFfDeviceProbe(void);
111  void SetOutputOnly(bool On) { outputOnly = On; }
112  virtual bool Probe(int Adapter, int Frontend);
113  };
114 
115 #endif //__DVBSDFFDEVICE_H
unsigned char uchar
Definition: tools.h:30
virtual void Clear(void)
Clears all video and audio data from the device.
virtual void SetAudioTrackDevice(eTrackType Type)
Sets the current audio track to the given value.
virtual int PlayTsAudio(const uchar *Data, int Length)
Plays the given data block as audio.
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
virtual void SetVideoFormat(bool VideoFormat16_9)
Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder)...
virtual int PlayTsVideo(const uchar *Data, int Length)
Plays the given data block as video.
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
int Adapter(void) const
Definition: dvbdevice.h:199
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
virtual void TrickSpeed(int Speed, bool Forward)
Sets the device into a mode where replay is done slower.
virtual ~cDvbSdFfDevice()
Definition: dvbsdffdevice.c:71
virtual int PlayAudio(const uchar *Data, int Length, uchar Id)
Plays the given data block as audio.
virtual void Mute(void)
Turns off audio while replaying.
virtual bool AvoidRecording(void) const
Returns true if this device should only be used for recording if no other device is available...
Definition: dvbsdffdevice.c:90
eTrackType
Definition: device.h:70
cDvbSpuDecoder * spuDecoder
Definition: dvbsdffdevice.h:32
virtual int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles...
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary device.
Definition: dvbsdffdevice.c:78
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect)
Returns the Width, Height and PixelAspect ratio the OSD should use to best fit the resolution of the ...
virtual void Play(void)
Sets the device into play mode (after a previous trick mode).
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
Definition: dvbsdffdevice.c:85
virtual void SetDigitalAudioDevice(bool On)
Tells the output device that the current audio track is Dolby Digital.
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
virtual void SetAudioChannelDevice(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
The cDvbSdFfDevice implements a DVB device which can be accessed through the Linux DVB driver API...
Definition: dvbsdffdevice.h:17
int Frontend(void) const
Definition: dvbdevice.h:200
virtual bool Poll(cPoller &Poller, int TimeoutMs=0)
Returns true if the device itself or any of the file handles in Poller is ready for further action...
virtual int NumProvidedSystems(void) const
Returns the number of individual "delivery systems" this device provides.
static bool Probe(int Adapter, int Frontend)
Probes for existing DVB devices.
Definition: dvbdevice.c:1174
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
eVideoDisplayFormat
Definition: device.h:65
bool SetAudioBypass(bool On)
virtual cSpuDecoder * GetSpuDecoder(void)
Returns a pointer to the device&#39;s SPU decoder (or NULL, if this device doesn&#39;t have an SPU decoder)...
Definition: dvbsdffdevice.c:95
ePlayMode
Definition: device.h:39
virtual bool Flush(int TimeoutMs=0)
Returns true if the device&#39;s output buffers are empty, i.
cDvbSdFfDevice(int Adapter, int Frontend, bool OutputOnly)
Definition: dvbsdffdevice.c:26
ePlayMode playMode
Definition: dvbsdffdevice.h:87
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
void SetOutputOnly(bool On)
void TurnOffLiveMode(bool LiveView)
virtual uchar * GrabImage(int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Grabs the currently visible screen image.
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder)...
The cDvbDevice implements a DVB device which can be accessed through the Linux DVB driver API...
Definition: dvbdevice.h:170
static int devVideoOffset
Definition: dvbsdffdevice.h:56
virtual bool SetPid(cPidHandle *Handle, int Type, bool On)
Does the actual PID setting on this device.
virtual bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
Definition: tools.h:357
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect)
Returns the Width, Height and VideoAspect ratio of the currently displayed video material.
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).