vdr  2.0.5
dvbhdffdevice.h
Go to the documentation of this file.
1 /*
2  * dvbhdffdevice.h: The DVB HD Full Featured device interface
3  *
4  * See the README file for copyright information and how to reach the author.
5  */
6 
7 #ifndef __DVBHDFFDEVICE_H
8 #define __DVBHDFFDEVICE_H
9 
10 #include "hdffcmd.h"
11 #include <vdr/dvbdevice.h>
12 #include <vdr/dvbspu.h>
13 
15 
16 class cDvbHdFfDevice : public cDvbDevice {
17 private:
19 protected:
20  virtual void MakePrimaryDevice(bool On);
21 public:
22  static bool Probe(int Adapter, int Frontend);
24  virtual ~cDvbHdFfDevice();
25  virtual bool HasDecoder(void) const;
26 
27 // SPU facilities
28 
29 private:
31 public:
32  virtual cSpuDecoder *GetSpuDecoder(void);
33 
34 // Channel facilities
35 
36 private:
37  void TurnOffLiveMode(bool LiveView);
38 protected:
39  virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
40 
41 // PID handle facilities
42 
43 protected:
44  virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
45 
46 // Image Grab facilities
47 
48 public:
49  virtual uchar *GrabImage(int &Size, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
50 
51 // Video format facilities
52 
53 public:
54  virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat);
55  virtual void SetVideoFormat(bool VideoFormat16_9);
56  virtual eVideoSystem GetVideoSystem(void);
57  virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect);
58  virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect);
59 
60 // Track facilities
61 
62 protected:
63  virtual void SetAudioTrackDevice(eTrackType Type);
64 
65 // Audio facilities
66 
67 private:
69 protected:
70  virtual int GetAudioChannelDevice(void);
71  virtual void SetAudioChannelDevice(int AudioChannel);
72  virtual void SetVolumeDevice(int Volume);
73  virtual void SetDigitalAudioDevice(bool On);
74 
75 // Player facilities
76 
77 private:
80  bool freezed;
81  bool trickMode;
83 
84  // Pes2Ts conversion stuff
85  uint8_t videoCounter;
86  uint8_t audioCounter;
87  void BuildTsPacket(uint8_t * TsBuffer, bool PusiSet, uint16_t Pid, uint8_t Counter, const uint8_t * Data, uint32_t Length);
88  uint32_t PesToTs(uint8_t * TsBuffer, uint16_t Pid, uint8_t & Counter, const uint8_t * Data, uint32_t Length);
89 
90 protected:
92  virtual bool CanReplay(void) const;
93  virtual bool SetPlayMode(ePlayMode PlayMode);
94  virtual int PlayVideo(const uchar *Data, int Length);
95  virtual int PlayAudio(const uchar *Data, int Length, uchar Id);
96  virtual int PlayTsVideo(const uchar *Data, int Length);
97  virtual int PlayTsAudio(const uchar *Data, int Length);
98 public:
99  virtual int64_t GetSTC(void);
100  virtual cRect CanScaleVideo(const cRect &Rect, int Alignment = taCenter);
101  virtual void ScaleVideo(const cRect &Rect = cRect::Null);
102  virtual void TrickSpeed(int Speed);
103  virtual void Clear(void);
104  virtual void Play(void);
105  virtual void Freeze(void);
106  virtual void Mute(void);
107  virtual void StillPicture(const uchar *Data, int Length);
108  virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
109  virtual bool Flush(int TimeoutMs = 0);
110 
111 // HDFF specific things
112 
113 public:
114  static HDFF::cHdffCmdIf *GetHdffCmdHandler(void);
115 private:
116  static int devHdffOffset;//TODO
117  bool isHdffPrimary;//TODO implicit!
119 };
120 
122 public:
123  virtual bool Probe(int Adapter, int Frontend);
124  };
125 
126 #endif //__DVBHDFFDEVICE_H
virtual void MakePrimaryDevice(bool On)
Informs a device that it will be the primary device.
unsigned char uchar
Definition: tools.h:30
virtual int PlayTsVideo(const uchar *Data, int Length)
Plays the given data block as video.
virtual cRect CanScaleVideo(const cRect &Rect, int Alignment=taCenter)
Asks the output device whether it can scale the currently shown video in such a way that it fits into...
uint8_t videoCounter
Definition: dvbhdffdevice.h:85
virtual int64_t GetSTC(void)
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles...
virtual void StillPicture(const uchar *Data, int Length)
Displays the given I-frame as a still picture.
virtual void SetDigitalAudioDevice(bool On)
Tells the actual device that digital audio output shall be switched on or off.
virtual void TrickSpeed(int Speed)
Sets the device into a mode where replay is done slower.
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 ...
int Adapter(void) const
Definition: dvbdevice.h:187
virtual bool HasDecoder(void) const
Tells whether this device has an MPEG decoder.
virtual void Freeze(void)
Puts the device into "freeze frame" mode.
virtual int GetAudioChannelDevice(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
virtual bool CanReplay(void) const
Returns true if this device can currently start a replay session.
ePlayMode playMode
Definition: dvbhdffdevice.h:91
virtual void Clear(void)
Clears all video and audio data from the device.
virtual void ScaleVideo(const cRect &Rect=cRect::Null)
Scales the currently shown video in such a way that it fits into the given Rect.
virtual int PlayVideo(const uchar *Data, int Length)
Plays the given data block as video.
eTrackType
Definition: device.h:65
virtual void Play(void)
Sets the device into play mode (after a previous trick mode).
Definition: osd.h:158
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder)...
uint32_t PesToTs(uint8_t *TsBuffer, uint16_t Pid, uint8_t &Counter, const uint8_t *Data, uint32_t Length)
int Frontend(void) const
Definition: dvbdevice.h:188
cDvbHdFfDevice(int Adapter, int Frontend)
Definition: dvbhdffdevice.c:32
virtual eVideoSystem GetVideoSystem(void)
Returns the video system of the currently displayed material (default is PAL).
HDFF::cHdffCmdIf * mHdffCmdIf
Definition: osd.h:348
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView)
Sets the device to the given channel (actual physical setup).
void BuildTsPacket(uint8_t *TsBuffer, bool PusiSet, uint16_t Pid, uint8_t Counter, const uint8_t *Data, uint32_t Length)
virtual ~cDvbHdFfDevice()
Definition: dvbhdffdevice.c:92
virtual bool SetPlayMode(ePlayMode PlayMode)
Sets the device into the given play mode.
eVideoDisplayFormat
Definition: device.h:60
virtual int PlayTsAudio(const uchar *Data, int Length)
Plays the given data block as audio.
virtual int PlayAudio(const uchar *Data, int Length, uchar Id)
Plays the given data block as audio.
ePlayMode
Definition: device.h:37
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect)
Returns the Width, Height and VideoAspect ratio of the currently displayed video material.
static const cRect Null
Definition: osd.h:353
eVideoSystem
Definition: device.h:56
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 bool Flush(int TimeoutMs=0)
Returns true if the device's output buffers are empty, i.
cDvbSpuDecoder * spuDecoder
Definition: dvbhdffdevice.h:30
virtual void SetAudioChannelDevice(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
The cDvbHdFfDevice implements a DVB device which can be accessed through the Linux DVB driver API...
Definition: dvbhdffdevice.h:16
virtual uchar * GrabImage(int &Size, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
Grabs the currently visible screen image.
The cDvbDevice implements a DVB device which can be accessed through the Linux DVB driver API...
Definition: dvbdevice.h:158
void TurnOffLiveMode(bool LiveView)
virtual void SetAudioTrackDevice(eTrackType Type)
Sets the current audio track to the given value.
virtual bool Probe(int Adapter, int Frontend)
Probes for a DVB device at the given Adapter and creates the appropriate object derived from cDvbDevi...
static HDFF::cHdffCmdIf * GetHdffCmdHandler(void)
static bool Probe(int Adapter, int Frontend)
virtual void SetVolumeDevice(int Volume)
Sets the audio volume on this device (Volume = 0...255).
static int devHdffOffset
virtual cSpuDecoder * GetSpuDecoder(void)
Returns a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder)...
Definition: tools.h:347
virtual bool SetPid(cPidHandle *Handle, int Type, bool On)
Does the actual PID setting on this device.
uint8_t audioCounter
Definition: dvbhdffdevice.h:86
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 void Mute(void)
Turns off audio while replaying.