X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fservice%2Fservicemp3.h;h=985179f65642143902bb0a9a5ef7df6bef8fd762;hp=f4d657cab785d7f7eeedabf1f2fff3c2d0e8da4e;hb=ec24491e3d4fa41b316d3399e4af56a6a9f9f67f;hpb=c5bb99fa2019da12a8fbaa1766189af520b9e79a diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index f4d657c..985179f 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -49,8 +49,9 @@ typedef enum { atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFL typedef enum { stPlainText, stSSA, stSRT } subtype_t; typedef enum { ctNone, ctMPEGTS, ctMPEGPS, ctMKV, ctAVI, ctMP4, ctVCD, ctCDA } containertype_t; -class eServiceMP3: public iPlayableService, public iPauseableService, - public iServiceInformation, public iSeekableService, public iAudioTrackSelection, public iAudioChannelSelection, public iSubtitleOutput, public Object +class eServiceMP3: public iPlayableService, public iPauseableService, + public iServiceInformation, public iSeekableService, public iAudioTrackSelection, public iAudioChannelSelection, + public iSubtitleOutput, public iStreamedService, public iAudioDelay, public Object { DECLARE_REF(eServiceMP3); public: @@ -70,16 +71,17 @@ public: RESULT audioTracks(ePtr &ptr); RESULT audioChannel(ePtr &ptr); RESULT subtitle(ePtr &ptr); + RESULT audioDelay(ePtr &ptr); // not implemented (yet) RESULT frontendInfo(ePtr &ptr) { ptr = 0; return -1; } RESULT subServices(ePtr &ptr) { ptr = 0; return -1; } RESULT timeshift(ePtr &ptr) { ptr = 0; return -1; } RESULT cueSheet(ePtr &ptr) { ptr = 0; return -1; } - RESULT audioDelay(ePtr &ptr) { ptr = 0; return -1; } + RESULT rdsDecoder(ePtr &ptr) { ptr = 0; return -1; } - RESULT stream(ePtr &ptr) { ptr = 0; return -1; } RESULT keys(ePtr &ptr) { ptr = 0; return -1; } + RESULT stream(ePtr &ptr) { ptr = 0; return -1; } // iPausableService RESULT pause(); @@ -117,6 +119,17 @@ public: PyObject *getSubtitleList(); PyObject *getCachedSubtitle(); + // iStreamedService + RESULT streamed(ePtr &ptr); + PyObject *getBufferCharge(); + int setBufferSize(int size); + + // iAudioDelay + int getAC3Delay(); + int getPCMDelay(); + void setAC3Delay(int); + void setPCMDelay(int); + struct audioStream { GstPad* pad; @@ -149,7 +162,20 @@ public: { } }; + struct bufferInfo + { + int bufferPercent; + int avgInRate; + int avgOutRate; + long long bufferingLeft; + bufferInfo() + :bufferPercent(0), avgInRate(0), avgOutRate(0), bufferingLeft(-1) + { + } + }; private: + static int pcm_delay; + static int ac3_delay; int m_currentAudioStream; int m_currentSubtitleStream; int selectAudioStream(int i); @@ -160,9 +186,10 @@ private: ePtr m_seekTimeout; void seekTimeoutCB(); friend class eServiceFactoryMP3; - std::string m_filename; - std::string m_title; - eServiceMP3(const char *filename, const char *title); + eServiceReference m_ref; + int m_buffer_size; + bufferInfo m_bufferInfo; + eServiceMP3(eServiceReference ref); Signal2 m_event; enum { @@ -184,6 +211,12 @@ private: std::list m_subtitle_pages; ePtr m_subtitle_sync_timer; void pushSubtitles(); + void pullSubtitle(); + int m_subs_to_pull; + eSingleLock m_subs_to_pull_lock; + gulong m_subs_to_pull_handler_id; + + RESULT seekToImpl(pts_t to); gint m_aspect, m_width, m_height, m_framerate, m_progressive; RESULT trickSeek(gdouble ratio);