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;
16 enum { aMPEG, aAC3, aDTS, aAAC };
17 eDVBAudio(eDVBDemux *demux, int dev);
18 int startPid(int pid, int type);
19 enum { aMonoLeft, aStereo, aMonoRight };
20 void setChannel(int channel);
22 #if HAVE_DVB_API_VERSION < 3
29 int getPTS(pts_t &now);
33 class eDVBVideo: public iObject, public Object
35 DECLARE_REF(eDVBVideo);
37 ePtr<eDVBDemux> m_demux;
38 int m_fd, m_fd_demux, m_dev;
40 int m_is_slow_motion, m_is_fast_forward;
41 eSocketNotifier *m_sn;
42 void video_event(int what);
43 Signal1<void, struct iTSMPEGDecoder::videoEvent> m_event;
45 enum { MPEG2, MPEG4_H264 };
46 eDVBVideo(eDVBDemux *demux, int dev);
47 int startPid(int pid, int type=MPEG2);
49 #if HAVE_DVB_API_VERSION < 3
55 int setSlowMotion(int repeat);
56 int setFastForward(int skip);
58 int getPTS(pts_t &now);
60 RESULT connectEvent(const Slot1<void, struct iTSMPEGDecoder::videoEvent> &event, ePtr<eConnection> &conn);
63 class eDVBPCR: public iObject
67 ePtr<eDVBDemux> m_demux;
70 eDVBPCR(eDVBDemux *demux);
71 int startPid(int pid);
76 class eDVBTText: public iObject
78 DECLARE_REF(eDVBTText);
80 ePtr<eDVBDemux> m_demux;
83 eDVBTText(eDVBDemux *demux);
84 int startPid(int pid);
89 class eTSMPEGDecoder: public Object, public iTSMPEGDecoder
91 static int m_pcm_delay;
92 static int m_ac3_delay;
93 static int m_audio_channel;
94 DECLARE_REF(eTSMPEGDecoder);
95 std::string m_radio_pic;
97 ePtr<eDVBDemux> m_demux;
98 ePtr<eDVBAudio> m_audio;
99 ePtr<eDVBVideo> m_video;
101 ePtr<eDVBTText> m_text;
102 int m_vpid, m_vtype, m_apid, m_atype, m_pcrpid, m_textpid;
110 int m_changed, m_decoder;
111 int m_is_ff, m_is_sm, m_is_trickmode;
113 ePtr<eConnection> m_demux_event_conn;
114 ePtr<eConnection> m_video_event_conn;
116 void demux_event(int event);
117 void video_event(struct videoEvent);
118 Signal1<void, struct videoEvent> m_video_event;
120 enum { pidNone = -1 };
121 eTSMPEGDecoder(eDVBDemux *demux, int decoder);
122 virtual ~eTSMPEGDecoder();
123 RESULT setVideoPID(int vpid, int type);
124 RESULT setAudioPID(int apid, int type);
125 RESULT setAudioChannel(int channel);
126 int getAudioChannel();
127 RESULT setPCMDelay(int delay);
128 int getPCMDelay() { return m_pcm_delay; }
129 RESULT setAC3Delay(int delay);
130 int getAC3Delay() { return m_ac3_delay; }
131 RESULT setSyncPCR(int pcrpid);
132 RESULT setTextPID(int textpid);
133 RESULT setSyncMaster(int who);
135 RESULT freeze(int cont);
137 RESULT setSinglePictureMode(int when);
138 RESULT setPictureSkipMode(int what);
139 RESULT setFastForward(int frames_to_skip);
140 RESULT setSlowMotion(int repeat);
141 RESULT setZoom(int what);
143 RESULT setTrickmode(int what);
144 RESULT showSinglePic(const char *filename);
145 RESULT setRadioPic(const std::string &filename);
146 /* what 0=auto, 1=video, 2=audio. */
147 RESULT getPTS(int what, pts_t &pts);
148 RESULT connectVideoEvent(const Slot1<void, struct videoEvent> &event, ePtr<eConnection> &connection);