From cf5341701c32afc934b3ff0dc75a28c7e9f264ee Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Tue, 19 Jun 2007 23:40:09 +0000 Subject: [PATCH] implement streamableService for playing dvb services --- lib/service/servicedvb.cpp | 31 ++++++++++++++++++++++++++++++- lib/service/servicedvb.h | 7 +++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 173f471b..613dc9be 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -1277,7 +1277,7 @@ RESULT eDVBServicePlay::setFastForward(int ratio) return m_decoder->setFastForward(ffratio); } - + RESULT eDVBServicePlay::seek(ePtr &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 &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 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) diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index 7c785c4e..4a40df12 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -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 &ptr); + PyObject *getStreamingData(); private: friend class eServiceFactoryDVB; eServiceReference m_reference; -- 2.30.2