implement streamableService for playing dvb services
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 19 Jun 2007 23:40:09 +0000 (23:40 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 19 Jun 2007 23:40:09 +0000 (23:40 +0000)
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index 173f471bf733f65362395e54443e4503b4cc3a35..613dc9bee4734c776f8ac1c0f22a230897f06b68 100644 (file)
@@ -1277,7 +1277,7 @@ RESULT eDVBServicePlay::setFastForward(int ratio)
 
        return m_decoder->setFastForward(ffratio);
 }
-    
+
 RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
 {
        if (m_is_pvr || m_timeshift_enabled)
@@ -2862,6 +2862,35 @@ void eDVBServicePlay::video_event(struct iTSMPEGDecoder::videoEvent event)
        m_event((iPlayableService*)this, evVideoSizeChanged);
 }
 
+RESULT eDVBServicePlay::stream(ePtr<iStreamableService> &ptr)
+{
+       ptr = this;
+       return 0;
+}
+
+PyObject *eDVBServicePlay::getStreamingData()
+{
+       eDVBServicePMTHandler::program program;
+       if (m_service_handler.getProgramInfo(program))
+       {
+               Py_INCREF(Py_None);
+               return Py_None;
+       }
+
+       PyObject *r = program.createPythonObject();
+       ePtr<iDVBDemux> demux;
+       if (!m_service_handler.getDataDemux(demux))
+       {
+               uint8_t demux_id;
+               demux->getCADemuxID(demux_id);
+               
+               PyDict_SetItemString(r, "demux", PyInt_FromLong(demux_id));
+       }
+
+       return r;
+}
+
+
 DEFINE_REF(eDVBServicePlay)
 
 PyObject *eDVBService::getInfoObject(const eServiceReference &ref, int w)
index 7c785c4efe51c050050f0a3f7608fe3266f04874..4a40df1204a9c6609e2d58e43bd745d45716f0fe 100644 (file)
@@ -89,7 +89,7 @@ class eDVBServicePlay: public eDVBServiceBase,
                public iAudioTrackSelection, public iAudioChannelSelection,
                public iSubserviceList, public iTimeshiftService,
                public iCueSheet, public iSubtitleOutput, public iAudioDelay,
-               public iRdsDecoder
+               public iRdsDecoder, public iStreamableService
 {
 DECLARE_REF(eDVBServicePlay);
 public:
@@ -176,7 +176,10 @@ public:
        int getPCMDelay();
        void setAC3Delay(int);
        void setPCMDelay(int);
-
+       
+               // iStreamableService
+       RESULT stream(ePtr<iStreamableService> &ptr);
+       PyObject *getStreamingData();
 private:
        friend class eServiceFactoryDVB;
        eServiceReference m_reference;