4 #include <lib/base/object.h>
5 #include <lib/dvb/demux.h>
9 class eDVBAudio: public iObject
11 DECLARE_REF(eDVBAudio);
13 ePtr<eDVBDemux> m_demux;
14 int m_fd, m_fd_demux, m_dev, m_is_freezed;
16 enum { aMPEG, aAC3, aDTS, aAAC, aAACHE };
17 eDVBAudio(eDVBDemux *demux, int dev);
18 enum { aMonoLeft, aStereo, aMonoRight };
19 void setChannel(int channel);
21 #if HAVE_DVB_API_VERSION < 3
22 int setPid(int pid, int type);
26 int setAVSync(int val);
28 int startPid(int pid, int type);
33 int getPTS(pts_t &now);
37 class eDVBVideo: public iObject, public Object
39 DECLARE_REF(eDVBVideo);
41 ePtr<eDVBDemux> m_demux;
42 int m_fd, m_fd_demux, m_dev;
43 #if HAVE_DVB_API_VERSION < 3
46 int m_is_slow_motion, m_is_fast_forward, m_is_freezed;
47 ePtr<eSocketNotifier> m_sn;
48 void video_event(int what);
49 Signal1<void, struct iTSMPEGDecoder::videoEvent> m_event;
50 int m_width, m_height, m_framerate, m_aspect, m_progressive;
52 enum { MPEG2, MPEG4_H264, MPEG1, MPEG4_Part2, VC1, VC1_SM };
53 eDVBVideo(eDVBDemux *demux, int dev);
55 #if HAVE_DVB_API_VERSION < 3
61 int startPid(int pid, int type=MPEG2);
65 int setSlowMotion(int repeat);
66 int setFastForward(int skip);
68 int getPTS(pts_t &now);
70 RESULT connectEvent(const Slot1<void, struct iTSMPEGDecoder::videoEvent> &event, ePtr<eConnection> &conn);
78 class eDVBPCR: public iObject
82 ePtr<eDVBDemux> m_demux;
83 int m_fd_demux, m_dev;
85 eDVBPCR(eDVBDemux *demux, int dev);
86 #if HAVE_DVB_API_VERSION < 3
90 int startPid(int pid);
96 class eDVBTText: public iObject
98 DECLARE_REF(eDVBTText);
100 ePtr<eDVBDemux> m_demux;
101 int m_fd_demux, m_dev;
103 eDVBTText(eDVBDemux *demux, int dev);
104 int startPid(int pid);
106 virtual ~eDVBTText();
109 class eTSMPEGDecoder: public Object, public iTSMPEGDecoder
111 DECLARE_REF(eTSMPEGDecoder);
113 static int m_pcm_delay;
114 static int m_ac3_delay;
115 static int m_audio_channel;
116 std::string m_radio_pic;
117 ePtr<eDVBDemux> m_demux;
118 ePtr<eDVBAudio> m_audio;
119 ePtr<eDVBVideo> m_video;
121 ePtr<eDVBTText> m_text;
122 int m_vpid, m_vtype, m_apid, m_atype, m_pcrpid, m_textpid;
131 int m_changed, m_decoder;
135 ePtr<eConnection> m_demux_event_conn;
136 ePtr<eConnection> m_video_event_conn;
138 void demux_event(int event);
139 void video_event(struct videoEvent);
140 Signal1<void, struct videoEvent> m_video_event;
142 ePtr<eTimer> m_showSinglePicTimer;
143 void finishShowSinglePic(); // called by timer
145 enum { pidNone = -1 };
146 eTSMPEGDecoder(eDVBDemux *demux, int decoder);
147 virtual ~eTSMPEGDecoder();
148 RESULT setVideoPID(int vpid, int type);
149 RESULT setAudioPID(int apid, int type);
150 RESULT setAudioChannel(int channel);
151 int getAudioChannel();
152 RESULT setPCMDelay(int delay);
153 int getPCMDelay() { return m_pcm_delay; }
154 RESULT setAC3Delay(int delay);
155 int getAC3Delay() { return m_ac3_delay; }
156 RESULT setSyncPCR(int pcrpid);
157 RESULT setTextPID(int textpid);
158 RESULT setSyncMaster(int who);
161 The following states exist:
163 - stop: data source closed, no playback
164 - pause: data source active, decoder paused
165 - play: data source active, decoder consuming
166 - decoder fast forward: data source linear, decoder drops frames
167 - trickmode, highspeed reverse: data source fast forwards / reverses, decoder just displays frames as fast as it can
168 - slow motion: decoder displays frames multiple times
174 stateDecoderFastForward,
178 RESULT set(); /* just apply settings, keep state */
179 RESULT play(); /* -> play */
180 RESULT pause(); /* -> pause */
181 RESULT setFastForward(int frames_to_skip); /* -> decoder fast forward */
182 RESULT setSlowMotion(int repeat); /* -> slow motion **/
183 RESULT setTrickmode(); /* -> highspeed fast forward */
186 RESULT showSinglePic(const char *filename);
187 RESULT setRadioPic(const std::string &filename);
188 /* what 0=auto, 1=video, 2=audio. */
189 RESULT getPTS(int what, pts_t &pts);
190 RESULT connectVideoEvent(const Slot1<void, struct videoEvent> &event, ePtr<eConnection> &connection);
192 int getVideoHeight();
193 int getVideoProgressive();
194 int getVideoFrameRate();
195 int getVideoAspect();