diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-10-02 02:20:56 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-10-02 02:20:56 +0000 |
| commit | 809c14e3d31fab1d4224412cbfaa3c475a8f1808 (patch) | |
| tree | 2aba663cf68bbb2e3198ce80bc51cd81db63fd02 /lib/service/servicexine.h | |
| parent | 6ea51518b9a6196dea58078ac37ba084f7068202 (diff) | |
| download | enigma2-809c14e3d31fab1d4224412cbfaa3c475a8f1808.tar.gz enigma2-809c14e3d31fab1d4224412cbfaa3c475a8f1808.zip | |
alternative media decoder based on libxine
Diffstat (limited to 'lib/service/servicexine.h')
| -rw-r--r-- | lib/service/servicexine.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/lib/service/servicexine.h b/lib/service/servicexine.h new file mode 100644 index 00000000..4a50b11f --- /dev/null +++ b/lib/service/servicexine.h @@ -0,0 +1,117 @@ +#ifndef __servicemp3_h +#define __servicemp3_h + +#define HAVE_XINE +#ifdef HAVE_XINE +#include <lib/base/message.h> +#include <lib/service/iservice.h> + +#include <xine.h> +#include <xine/xineutils.h> + +class eStaticServiceXineInfo; + +class eServiceFactoryXine: public iServiceHandler +{ +DECLARE_REF(eServiceFactoryXine); +public: + eServiceFactoryXine(); + virtual ~eServiceFactoryXine(); + enum { id = 0x1010 }; + + // iServiceHandler + RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr); + RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr); + RESULT list(const eServiceReference &, ePtr<iListableService> &ptr); + RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr); + RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr); +private: + ePtr<eStaticServiceXineInfo> m_service_info; +}; + +class eStaticServiceXineInfo: public iStaticServiceInformation +{ + DECLARE_REF(eStaticServiceXineInfo); + friend class eServiceFactoryXine; + eStaticServiceXineInfo(); +public: + RESULT getName(const eServiceReference &ref, std::string &name); + int getLength(const eServiceReference &ref); +}; + +typedef struct _GstElement GstElement; + +class eServiceXine: public iPlayableService, public iPauseableService, + public iServiceInformation, public iSeekableService, public Object +{ +DECLARE_REF(eServiceXine); +public: + virtual ~eServiceXine(); + + // iPlayableService + RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); + RESULT start(); + RESULT stop(); + RESULT setTarget(int target); + + RESULT pause(ePtr<iPauseableService> &ptr); + RESULT setSlowMotion(int ratio); + RESULT setFastForward(int ratio); + + RESULT seek(ePtr<iSeekableService> &ptr); + + // not implemented (yet) + RESULT audioChannel(ePtr<iAudioChannelSelection> &ptr) { ptr = 0; return -1; } + RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr) { ptr = 0; return -1; } + RESULT frontendInfo(ePtr<iFrontendInformation> &ptr) { ptr = 0; return -1; } + RESULT subServices(ePtr<iSubserviceList> &ptr) { ptr = 0; return -1; } + RESULT timeshift(ePtr<iTimeshiftService> &ptr) { ptr = 0; return -1; } + RESULT cueSheet(ePtr<iCueSheet> &ptr) { ptr = 0; return -1; } + RESULT subtitle(ePtr<iSubtitleOutput> &ptr) { ptr = 0; return -1; } + RESULT audioDelay(ePtr<iAudioDelay> &ptr) { ptr = 0; return -1; } + RESULT radioText(ePtr<iRadioText> &ptr) { ptr = 0; return -1; } + + // iPausableService + RESULT pause(); + RESULT unpause(); + + RESULT info(ePtr<iServiceInformation>&); + + // iSeekableService + RESULT getLength(pts_t &SWIG_OUTPUT); + RESULT seekTo(pts_t to); + RESULT seekRelative(int direction, pts_t to); + RESULT getPlayPosition(pts_t &SWIG_OUTPUT); + RESULT setTrickmode(int trick); + RESULT isCurrentlySeekable(); + + // iServiceInformation + RESULT getName(std::string &name); + int getInfo(int w); + std::string getInfoString(int w); +private: + friend class eServiceFactoryXine; + std::string m_filename; + eServiceXine(const char *filename); + Signal2<void,iPlayableService*,int> m_event; + + xine_stream_t *stream; + xine_video_port_t *vo_port; + xine_audio_port_t *ao_port; + xine_event_queue_t *event_queue; + + enum + { + stError, stIdle, stRunning, stStopped, + }; + int m_state; + + static void eventListenerWrap(void *user_data, const xine_event_t *event); + void eventListener(const xine_event_t *event); + + + eFixedMessagePump<int> m_pump; +}; +#endif + +#endif |
