a34be984fa69bf74972b4a49ca8166914ff884fb
[vuplus_dvbapp] / lib / dvb / idvb.h
1 #ifndef __dvb_idvb_h
2 #define __dvb_idvb_h
3
4 #ifndef SWIG
5
6 #if HAVE_DVB_API_VERSION < 3
7 #include <ost/frontend.h>
8 #define FRONTENDPARAMETERS FrontendParameters
9 #else
10 #include <linux/dvb/frontend.h>
11 #include <linux/dvb/video.h>
12 #define FRONTENDPARAMETERS struct dvb_frontend_parameters
13 #endif
14 #include <lib/dvb/frontendparms.h>
15 #include <lib/base/object.h>
16 #include <lib/base/ebase.h>
17 #include <lib/base/elock.h>
18 #include <lib/service/service.h>
19 #include <libsig_comp.h>
20 #include <connection.h>
21
22 #if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ == 4 )  // check if gcc version >= 3.1
23 #include <ext/slist>
24 #define CAID_LIST __gnu_cxx::slist<uint16_t>
25 #else
26 #include <slist>
27 #define CAID_LIST std::slist<uint16_t>
28 #endif
29
30 struct eBouquet
31 {
32         std::string m_bouquet_name;
33         std::string m_filename;  // without path.. just name
34         typedef std::list<eServiceReference> list;
35         list m_services;
36 // the following five methods are implemented in db.cpp
37         RESULT flushChanges();
38         RESULT addService(const eServiceReference &, eServiceReference before=eServiceReference());
39         RESULT removeService(const eServiceReference &);
40         RESULT moveService(const eServiceReference &, unsigned int);
41         RESULT setListName(const std::string &name);
42 };
43
44                 /* these structures have by intention no operator int() defined.
45                    the reason of these structures is to avoid mixing for example
46                    a onid and a tsid (as there's no general order for them).
47                    
48                    defining an operator int() would implicitely convert values
49                    between them over the constructor with the int argument.
50                    
51                    'explicit' doesn't here - eTransportStreamID(eOriginalNetworkID(n)) 
52                    would still work. */
53
54 struct eTransportStreamID
55 {
56 private:
57         int v;
58 public:
59         int get() const { return v; }
60         eTransportStreamID(int i): v(i) { }
61         eTransportStreamID(): v(-1) { }
62         bool operator == (const eTransportStreamID &c) const { return v == c.v; }
63         bool operator != (const eTransportStreamID &c) const { return v != c.v; }
64         bool operator < (const eTransportStreamID &c) const { return v < c.v; }
65         bool operator > (const eTransportStreamID &c) const { return v > c.v; }
66 };
67
68 struct eServiceID
69 {
70 private:
71         int v;
72 public:
73         int get() const { return v; }
74         eServiceID(int i): v(i) { }
75         eServiceID(): v(-1) { }
76         bool operator == (const eServiceID &c) const { return v == c.v; }
77         bool operator != (const eServiceID &c) const { return v != c.v; }
78         bool operator < (const eServiceID &c) const { return v < c.v; }
79         bool operator > (const eServiceID &c) const { return v > c.v; }
80 };
81
82 struct eOriginalNetworkID
83 {
84 private:
85         int v;
86 public:
87         int get() const { return v; }
88         eOriginalNetworkID(int i): v(i) { }
89         eOriginalNetworkID(): v(-1) { }
90         bool operator == (const eOriginalNetworkID &c) const { return v == c.v; }
91         bool operator != (const eOriginalNetworkID &c) const { return v != c.v; }
92         bool operator < (const eOriginalNetworkID &c) const { return v < c.v; }
93         bool operator > (const eOriginalNetworkID &c) const { return v > c.v; }
94 };
95
96 struct eDVBNamespace
97 {
98 private:
99         int v;
100 public:
101         int get() const { return v; }
102         eDVBNamespace(int i): v(i) { }
103         eDVBNamespace(): v(-1) { }
104         bool operator == (const eDVBNamespace &c) const { return v == c.v; }
105         bool operator != (const eDVBNamespace &c) const { return v != c.v; }
106         bool operator < (const eDVBNamespace &c) const { return v < c.v; }
107         bool operator > (const eDVBNamespace &c) const { return v > c.v; }
108 };
109
110 struct eDVBChannelID
111 {
112         eDVBNamespace dvbnamespace;
113         eTransportStreamID transport_stream_id;
114         eOriginalNetworkID original_network_id;
115         
116         bool operator==(const eDVBChannelID &c) const
117         {
118                 return dvbnamespace == c.dvbnamespace &&
119                         transport_stream_id == c.transport_stream_id &&
120                         original_network_id == c.original_network_id;
121         }
122         
123         bool operator<(const eDVBChannelID &c) const
124         {
125                 if (dvbnamespace < c.dvbnamespace)
126                         return 1;
127                 else if (dvbnamespace == c.dvbnamespace)
128                 {
129                         if (original_network_id < c.original_network_id)
130                                 return 1;
131                         else if (original_network_id == c.original_network_id)
132                                 if (transport_stream_id < c.transport_stream_id)
133                                         return 1;
134                 }
135                 return 0;
136         }
137         eDVBChannelID(eDVBNamespace dvbnamespace, eTransportStreamID tsid, eOriginalNetworkID onid): 
138                         dvbnamespace(dvbnamespace), transport_stream_id(tsid), original_network_id(onid)
139         {
140         }
141         eDVBChannelID():
142                         dvbnamespace(-1), transport_stream_id(-1), original_network_id(-1)
143         {
144         }
145         operator bool() const
146         {
147                 return (dvbnamespace != -1) && (transport_stream_id != -1) && (original_network_id != -1);
148         }
149 };
150
151 struct eServiceReferenceDVB: public eServiceReference
152 {
153         int getServiceType() const { return data[0]; }
154         void setServiceType(int service_type) { data[0]=service_type; }
155
156         eServiceID getServiceID() const { return eServiceID(data[1]); }
157         void setServiceID(eServiceID service_id) { data[1]=service_id.get(); }
158
159         eTransportStreamID getTransportStreamID() const { return eTransportStreamID(data[2]); }
160         void setTransportStreamID(eTransportStreamID transport_stream_id) { data[2]=transport_stream_id.get(); }
161
162         eOriginalNetworkID getOriginalNetworkID() const { return eOriginalNetworkID(data[3]); }
163         void setOriginalNetworkID(eOriginalNetworkID original_network_id) { data[3]=original_network_id.get(); }
164
165         eDVBNamespace getDVBNamespace() const { return eDVBNamespace(data[4]); }
166         void setDVBNamespace(eDVBNamespace dvbnamespace) { data[4]=dvbnamespace.get(); }
167
168         eServiceID getParentServiceID() const { return eServiceID(data[5]); }
169         void setParentServiceID( eServiceID sid ) { data[5]=sid.get(); }
170
171         eTransportStreamID getParentTransportStreamID() const { return eTransportStreamID(data[6]); }
172         void setParentTransportStreamID( eTransportStreamID tsid ) { data[6]=tsid.get(); }
173
174         eServiceReferenceDVB getParentServiceReference() const
175         {
176                 eServiceReferenceDVB tmp(*this);
177                 if (data[5] && data[6])
178                 {
179                         tmp.data[1] = data[5];
180                         tmp.data[2] = data[6];
181                         tmp.data[5] = tmp.data[6] = 0;
182                 }
183                 else
184                         tmp.type = idInvalid;
185                 return tmp;
186         }
187
188         eServiceReferenceDVB(eDVBNamespace dvbnamespace, eTransportStreamID transport_stream_id, eOriginalNetworkID original_network_id, eServiceID service_id, int service_type)
189                 :eServiceReference(eServiceReference::idDVB, 0)
190         {
191                 setTransportStreamID(transport_stream_id);
192                 setOriginalNetworkID(original_network_id);
193                 setDVBNamespace(dvbnamespace);
194                 setServiceID(service_id);
195                 setServiceType(service_type);
196         }
197         
198         void set(const eDVBChannelID &chid)
199         {
200                 setDVBNamespace(chid.dvbnamespace);
201                 setOriginalNetworkID(chid.original_network_id);
202                 setTransportStreamID(chid.transport_stream_id);
203         }
204         
205         void getChannelID(eDVBChannelID &chid) const
206         {
207                 chid = eDVBChannelID(getDVBNamespace(), getTransportStreamID(), getOriginalNetworkID());
208         }
209
210         eServiceReferenceDVB()
211                 :eServiceReference(eServiceReference::idDVB, 0)
212         {
213         }
214
215         eServiceReferenceDVB(const std::string &string)
216                 :eServiceReference(string)
217         {
218         }
219 };
220
221
222 ////////////////// TODO: we need an interface here, but what exactly?
223
224 #include <set>
225 // btw, still implemented in db.cpp. FIX THIS, TOO.
226
227 class eDVBChannelQuery;
228
229 class eDVBService: public iStaticServiceInformation
230 {
231         DECLARE_REF(eDVBService);
232         int *m_cache;
233         void initCache();
234         void copyCache(int *source);
235 public:
236         enum cacheID
237         {
238                 cVPID, cAPID, cTPID, cPCRPID, cAC3PID,
239                 cVTYPE, cACHANNEL, cAC3DELAY, cPCMDELAY,
240                 cSUBTITLE, cacheMax
241         };
242
243         int getCacheEntry(cacheID);
244         void setCacheEntry(cacheID, int);
245
246         bool cacheEmpty();
247
248         eDVBService();
249                 /* m_service_name_sort is uppercase, with special chars removed, to increase sort performance. */
250         std::string m_service_name, m_service_name_sort;
251         std::string m_provider_name;
252         
253         void genSortName();
254
255         int m_flags;
256         enum
257         {
258                 dxNoSDT=1,    // don't get SDT
259 //nyi   dxDontshow=2,
260                 dxNoDVB=4,  // dont use PMT for this service ( use cached pids )
261                 dxHoldName=8,
262                 dxNewFound=64,
263         };
264
265         bool usePMT() const { return !(m_flags & dxNoDVB); }
266
267         CAID_LIST m_ca;
268
269         virtual ~eDVBService();
270         
271         eDVBService &operator=(const eDVBService &);
272         
273         // iStaticServiceInformation
274         RESULT getName(const eServiceReference &ref, std::string &name);
275         RESULT getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &ptr, time_t start_time);
276         int isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
277         PyObject *getInfoObject(const eServiceReference &ref, int);  // implemented in lib/service/servicedvb.h
278
279                 /* for filtering: */
280         int checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQuery &query);
281 };
282
283 //////////////////
284
285 class iDVBChannel;
286 class iDVBDemux;
287 class iDVBFrontendParameters;
288
289 class iDVBChannelListQuery: public iObject
290 {
291 public:
292         virtual RESULT getNextResult(eServiceReferenceDVB &ref)=0;
293         virtual int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b)=0;
294 };
295
296 class eDVBChannelQuery: public iObject
297 {
298         DECLARE_REF(eDVBChannelQuery);
299 public:
300         enum
301         {
302                 tName,
303                 tProvider,
304                 tType,
305                 tBouquet,
306                 tSatellitePosition,
307                 tChannelID,
308                 tAND,
309                 tOR,
310                 tAny,
311                 tFlags
312         };
313         
314         int m_type;
315         int m_inverse;
316         
317         std::string m_string;
318         int m_int;
319         eDVBChannelID m_channelid;
320         
321                 /* sort is only valid in root, and must be from the enum above. */
322         int m_sort;
323         std::string m_bouquet_name;
324         
325         static RESULT compile(ePtr<eDVBChannelQuery> &res, std::string query);
326         
327         ePtr<eDVBChannelQuery> m_p1, m_p2;
328 };
329
330 class iDVBChannelList: public iObject
331 {
332 public:
333         virtual RESULT removeService(const eServiceReference &service)=0;
334         virtual RESULT removeServices(eDVBChannelID chid=eDVBChannelID(), unsigned int orb_pos=0xFFFFFFFF)=0;
335         virtual RESULT removeServices(int dvb_namespace=-1, int tsid=-1, int onid=-1, unsigned int orb_pos=0xFFFFFFFF)=0;
336         virtual RESULT addFlag(const eServiceReference &service, unsigned int flagmask=0xFFFFFFFF)=0;
337         virtual RESULT removeFlag(const eServiceReference &service, unsigned int flagmask=0xFFFFFFFF)=0;
338         virtual RESULT removeFlags(unsigned int flagmask, eDVBChannelID chid=eDVBChannelID(), unsigned int orb_pos=0xFFFFFFFF)=0;
339         virtual RESULT removeFlags(unsigned int flagmask, int dvb_namespace=-1, int tsid=-1, int onid=-1, unsigned int orb_pos=0xFFFFFFFF)=0;
340         virtual RESULT addChannelToList(const eDVBChannelID &id, iDVBFrontendParameters *feparm)=0;
341         virtual RESULT removeChannel(const eDVBChannelID &id)=0;
342         
343         virtual RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm)=0;
344         
345         virtual RESULT addService(const eServiceReferenceDVB &service, eDVBService *service)=0;
346         virtual RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service)=0;
347         virtual RESULT flush()=0;
348
349         virtual RESULT getBouquet(const eServiceReference &ref,  eBouquet* &bouquet)=0;
350
351         virtual RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *query, const eServiceReference &source)=0;
352 };
353
354 #endif  // SWIG
355
356 class iDVBFrontendParameters: public iObject
357 {
358 #ifdef SWIG
359         iDVBFrontendParameters();
360         ~iDVBFrontendParameters();
361 #endif
362 public:
363         virtual RESULT getSystem(int &SWIG_OUTPUT) const = 0;
364         virtual RESULT getDVBS(eDVBFrontendParametersSatellite &SWIG_OUTPUT) const = 0;
365         virtual RESULT getDVBC(eDVBFrontendParametersCable &SWIG_OUTPUT) const = 0;
366         virtual RESULT getDVBT(eDVBFrontendParametersTerrestrial &SWIG_OUTPUT) const = 0;
367         
368         virtual RESULT calculateDifference(const iDVBFrontendParameters *parm, int &SWIG_OUTPUT, bool exact) const = 0;
369         virtual RESULT getHash(unsigned long &SWIG_OUTPUT) const = 0;
370 };
371
372 #define MAX_DISEQC_LENGTH  16
373
374 class eDVBDiseqcCommand
375 {
376 #ifndef SWIG
377 public:
378 #endif
379         int len;
380         __u8 data[MAX_DISEQC_LENGTH];
381 #if HAVE_DVB_API_VERSION < 3
382         int tone;
383         int voltage;
384 #endif
385 #ifdef SWIG
386 public:
387 #endif
388         void setCommandString(const char *str);
389 };
390
391 class iDVBSatelliteEquipmentControl;
392 class eSecCommandList;
393
394 class iDVBFrontend_ENUMS
395 {
396 #ifdef SWIG
397         iDVBFrontend_ENUMS();
398         ~iDVBFrontend_ENUMS();
399 #endif
400 public:
401         enum { feSatellite, feCable, feTerrestrial };
402         enum { stateIdle, stateTuning, stateFailed, stateLock, stateLostLock };
403         enum { toneOff, toneOn };
404         enum { voltageOff, voltage13, voltage18, voltage13_5, voltage18_5 };
405         enum { bitErrorRate, signalPower, signalQuality, locked, synced, frontendNumber };
406 };
407
408 SWIG_IGNORE(iDVBFrontend);
409 class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
410 {
411 public:
412         virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
413         virtual RESULT tune(const iDVBFrontendParameters &where)=0;
414 #ifndef SWIG
415         virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
416 #endif
417         virtual RESULT getState(int &SWIG_OUTPUT)=0;
418         virtual RESULT setTone(int tone)=0;
419         virtual RESULT setVoltage(int voltage)=0;
420         virtual RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc)=0;
421         virtual RESULT sendToneburst(int burst)=0;
422 #ifndef SWIG
423         virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
424         virtual RESULT setSecSequence(const eSecCommandList &list)=0;
425 #endif
426         virtual int readFrontendData(int type)=0;
427         virtual PyObject *readTransponderData(bool original)=0;
428 #ifndef SWIG
429         virtual RESULT getData(int num, int &data)=0;
430         virtual RESULT setData(int num, int val)=0;
431                 /* 0 means: not compatible. other values are a priority. */
432         virtual int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm)=0;
433 #endif
434 };
435 SWIG_TEMPLATE_TYPEDEF(ePtr<iDVBFrontend>, iDVBFrontendPtr);
436
437 #ifndef SWIG
438 class iDVBSatelliteEquipmentControl: public iObject
439 {
440 public:
441         virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id)=0;
442         virtual int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *fe, int frontend_id)=0;
443         virtual void setRotorMoving(bool)=0;
444 };
445
446 struct eDVBCIRouting
447 {
448         int enabled;
449 };
450 #endif // SWIG
451
452 SWIG_IGNORE(iDVBChannel);
453 class iDVBChannel: public iObject
454 {
455 public:
456                 /* direct frontend access for raw channels and/or status inquiries. */
457         virtual SWIG_VOID(RESULT) getFrontend(ePtr<iDVBFrontend> &SWIG_OUTPUT)=0;
458 #ifndef SWIG
459         enum
460         {
461                 state_idle,        /* not yet tuned */
462                 state_tuning,      /* currently tuning (first time) */
463                 state_failed,      /* tuning failed. */
464                 state_unavailable, /* currently unavailable, will be back without further interaction */
465                 state_ok,          /* ok */
466                 state_last_instance, /* just one reference to this channel is left */
467                 state_release      /* channel is being shut down. */
468         };
469         virtual RESULT getState(int &SWIG_OUTPUT)=0;
470
471         virtual RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &)=0;
472         enum 
473         {
474                 evtEOF, evtSOF, evtFailed
475         };
476         virtual RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection)=0;
477         virtual RESULT connectEvent(const Slot2<void,iDVBChannel*,int> &eventChange, ePtr<eConnection> &connection)=0;
478
479                 /* demux capabilities */
480         enum
481         {
482                 capDecode = 1,
483                 /* capCI = 2 */
484         };
485         virtual RESULT setCIRouting(const eDVBCIRouting &routing)=0;
486         virtual RESULT getDemux(ePtr<iDVBDemux> &demux, int cap=0)=0;
487         
488                 /* use count handling */
489         virtual void AddUse() = 0;
490         virtual void ReleaseUse() = 0;
491 #endif
492 };
493 SWIG_TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
494
495 #ifndef SWIG
496         /* signed, so we can express deltas. */
497         
498 typedef long long pts_t;
499
500 class iFilePushScatterGather;
501 class iTSMPEGDecoder;
502
503         /* note that a cue sheet describes the logical positions. thus 
504            everything is specified in pts and not file positions */
505
506         /* implemented in dvb.cpp */
507 class eCueSheet: public iObject, public Object
508 {
509         DECLARE_REF(eCueSheet);
510 public:
511         eCueSheet();
512         
513                         /* frontend */
514         void seekTo(int relative, const pts_t &pts);
515         
516         void clear();
517         void addSourceSpan(const pts_t &begin, const pts_t &end);
518         void commitSpans();
519         
520         void setSkipmode(const pts_t &ratio); /* 90000 is 1:1 */
521         void setDecodingDemux(iDVBDemux *demux, iTSMPEGDecoder *decoder);
522         
523                         /* frontend and backend */
524         eSingleLock m_lock;
525         
526                         /* backend */
527         enum { evtSeek, evtSkipmode, evtSpanChanged };
528         RESULT connectEvent(const Slot1<void, int> &event, ePtr<eConnection> &connection);
529
530         std::list<std::pair<pts_t,pts_t> > m_spans;     /* begin, end */
531         std::list<std::pair<int, pts_t> > m_seek_requests; /* relative, delta */
532         pts_t m_skipmode_ratio;
533         Signal1<void,int> m_event;
534         ePtr<iDVBDemux> m_decoding_demux;
535         ePtr<iTSMPEGDecoder> m_decoder;
536 };
537
538 class iDVBPVRChannel: public iDVBChannel
539 {
540 public:
541         enum
542         {
543                 state_eof = state_release + 1  /* end-of-file reached. */
544         };
545         
546                 /* FIXME: there are some very ugly buffer-end and ... related problems */
547                 /* so this is VERY UGLY. 
548                 
549                    ok, it's going to get better. but still...*/
550         virtual RESULT playFile(const char *file) = 0;
551         virtual void stopFile() = 0;
552         
553         virtual void setCueSheet(eCueSheet *cuesheet) = 0;
554         
555         virtual RESULT getLength(pts_t &pts) = 0;
556         
557                 /* we explicitely ask for the decoding demux here because a channel
558                    can be shared between multiple decoders.
559                 */
560         virtual RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode) = 0;
561                 /* skipping must be done with a cue sheet */
562 };
563
564 class iDVBSectionReader;
565 class iDVBPESReader;
566 class iDVBTSRecorder;
567 class iTSMPEGDecoder;
568
569 class iDVBDemux: public iObject
570 {
571 public:
572         virtual RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader)=0;
573         virtual RESULT createPESReader(eMainloop *context, ePtr<iDVBPESReader> &reader)=0;
574         virtual RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder)=0;
575         virtual RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader, int primary=1)=0;
576         virtual RESULT getSTC(pts_t &pts, int num=0)=0;
577         virtual RESULT getCADemuxID(uint8_t &id)=0;
578         virtual RESULT flush()=0;
579 };
580
581 class iTSMPEGDecoder: public iObject
582 {
583 public:
584         enum { pidDisabled = -1 };
585                 /** Set Displayed Video PID and type */
586         virtual RESULT setVideoPID(int vpid, int type)=0;
587
588         enum { af_MPEG, af_AC3, af_DTS, af_AAC };
589                 /** Set Displayed Audio PID and type */
590         virtual RESULT setAudioPID(int apid, int type)=0;
591
592         enum { ac_left, ac_stereo, ac_right };
593                 /** Set Displayed Audio Channel */
594         virtual RESULT setAudioChannel(int channel)=0;
595         virtual int getAudioChannel()=0;
596
597         virtual RESULT setPCMDelay(int delay)=0;
598         virtual int getPCMDelay()=0;
599         virtual RESULT setAC3Delay(int delay)=0;
600         virtual int getAC3Delay()=0;
601
602                 /** Set Displayed Videotext PID */
603         virtual RESULT setTextPID(int vpid)=0;
604
605                 /** Set Sync mode to PCR */
606         virtual RESULT setSyncPCR(int pcrpid)=0;
607         enum { sm_Audio, sm_Video };
608                 /** Set Sync mode to either audio or video master */
609         virtual RESULT setSyncMaster(int who)=0;
610
611                 /** Apply settings */
612         virtual RESULT start()=0;
613         
614                 /** Freeze frame. Either continue decoding (without display) or halt. */
615         virtual RESULT freeze(int cont)=0;
616                 /** Continue after freeze. */
617         virtual RESULT unfreeze()=0;
618         
619                 /** fast forward by skipping frames. 0 is disabled, 2 is twice-the-speed, ... */
620         virtual RESULT setFastForward(int skip=0)=0;
621         
622                 // stop on .. Picture
623         enum { spm_I, spm_Ref, spm_Any };
624                 /** Stop on specific decoded picture. For I-Frame display. */
625         virtual RESULT setSinglePictureMode(int when)=0;
626         
627         enum { pkm_B, pkm_PB };
628                 /** Fast forward by skipping either B or P/B pictures */
629         virtual RESULT setPictureSkipMode(int what)=0;
630         
631                 /** Slow Motion by repeating pictures */
632         virtual RESULT setSlowMotion(int repeat)=0;
633         
634         enum { zoom_Normal, zoom_PanScan, zoom_Letterbox, zoom_Fullscreen };
635                 /** Set Zoom. mode *must* be fitting. */
636         virtual RESULT setZoom(int what)=0;
637         
638         virtual RESULT setTrickmode(int what) = 0;
639         
640         virtual RESULT getPTS(int what, pts_t &pts) = 0;
641
642         virtual RESULT showSinglePic(const char *filename) = 0;
643
644         virtual RESULT setRadioPic(const std::string &filename) = 0;
645
646         struct videoEvent
647         {
648                 enum { eventUnknown = 0, eventSizeChanged = VIDEO_EVENT_SIZE_CHANGED } type;
649                 unsigned char aspect;
650                 unsigned short height;
651                 unsigned short width;
652         };
653
654         virtual RESULT connectVideoEvent(const Slot1<void, struct videoEvent> &event, ePtr<eConnection> &connection) = 0;
655 };
656
657 #endif //SWIG
658 #endif