X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fservice%2Fservicedvb.cpp;h=ec3fdb5587a4f8eee7698efb840b59f95c20e3f6;hp=52eefa729532192ca42f972556e8829693ca358b;hb=045c47f76723e0aea8d9ed8394f2dee06df28856;hpb=7407ccb796e6079fee5d010aceab5e6c606faf01 diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp old mode 100644 new mode 100755 index 52eefa7..ec3fdb5 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -17,6 +17,7 @@ #include #include #include // access to python config +#include /* for subtitles */ #include @@ -292,7 +293,7 @@ public: RESULT getName(const eServiceReference &ref, std::string &name); int getLength(const eServiceReference &ref); RESULT getEvent(const eServiceReference &ref, ePtr &SWIG_OUTPUT, time_t start_time); - int isPlayable(const eServiceReference &ref, const eServiceReference &ignore) { return 1; } + int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate) { return 1; } int getInfo(const eServiceReference &ref, int w); std::string getInfoString(const eServiceReference &ref,int w); PyObject *getInfoObject(const eServiceReference &r, int what); @@ -404,14 +405,25 @@ RESULT eStaticServiceDVBPVRInformation::getEvent(const eServiceReference &ref, e { if (!ref.path.empty()) { - ePtr event = new eServiceEvent; - std::string filename = ref.path; - filename.erase(filename.length()-2, 2); - filename+="eit"; - if (!event->parseFrom(filename, (m_parser.m_ref.getTransportStreamID().get()<<16)|m_parser.m_ref.getOriginalNetworkID().get())) + if (ref.path.substr(0, 7) == "http://") { - evt = event; - return 0; + eServiceReference equivalentref(ref); + /* this might be a scrambled stream (id + 0x100), force equivalent dvb type */ + equivalentref.type = eServiceFactoryDVB::id; + equivalentref.path.clear(); + return eEPGCache::getInstance()->lookupEventTime(equivalentref, start_time, evt); + } + else + { + ePtr event = new eServiceEvent; + std::string filename = ref.path; + filename.erase(filename.length()-2, 2); + filename+="eit"; + if (!event->parseFrom(filename, (m_parser.m_ref.getTransportStreamID().get()<<16)|m_parser.m_ref.getOriginalNetworkID().get())) + { + evt = event; + return 0; + } } } evt = 0; @@ -816,6 +828,12 @@ RESULT eServiceFactoryDVB::record(const eServiceReference &ref, ePtr source = createTsSource(service); - m_service_handler.tuneExt(service, m_is_pvr, source, service.path.c_str(), m_cue, false, m_dvb_service); + m_service_handler.tuneExt(service, m_is_pvr, source, service.path.c_str(), m_cue, false, m_dvb_service, m_is_stream); if (m_is_pvr) { @@ -1502,7 +1524,7 @@ RESULT eDVBServicePlay::timeshift(ePtr &ptr) { ptr = 0; if (m_have_video_pid && // HACK !!! FIXMEE !! temporary no timeshift on radio services !! - (m_timeshift_enabled || !m_is_pvr)) + (m_timeshift_enabled || (!m_is_pvr&&!m_is_stream))) { if (!m_timeshift_enabled) { @@ -1569,6 +1591,18 @@ RESULT eDVBServicePlay::getName(std::string &name) ePtr i = new eStaticServiceDVBPVRInformation(m_reference); return i->getName(m_reference, name); } + else if (m_is_stream) + { + name = m_reference.name; + if (name.empty()) + { + name = m_reference.path; + } + if (name.empty()) + { + name = "(...)"; + } + } else if (m_dvb_service) { m_dvb_service->getName(m_reference, name); @@ -1720,6 +1754,13 @@ std::string eDVBServicePlay::getInfoString(int w) return m_dvb_service->m_provider_name; case sServiceref: return m_reference.toString(); + case sHBBTVUrl: + { + std::string url; + eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler; + h.getHBBTVUrl(url); + return url; + } default: break; } @@ -1736,6 +1777,11 @@ PyObject *eDVBServicePlay::getInfoObject(int w) return m_service_handler.getCaIds(true); case sTransponderData: return eStaticServiceDVBInformation().getInfoObject(m_reference, w); + case sHBBTVUrl: + { + eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler; + return h.getHbbTVApplications(); + } default: break; } @@ -1795,6 +1841,8 @@ RESULT eDVBServicePlay::getTrackInfo(struct iAudioTrackInfo &info, unsigned int info.m_description = "MPEG"; else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAC3) info.m_description = "Dolby Digital"; + else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDDP) + info.m_description = "Dolby Digital+"; else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAAC) info.m_description = "AAC"; else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAACHE) @@ -2368,9 +2416,18 @@ void eDVBServicePlay::resetTimeshift(int start) ePtr eDVBServicePlay::createTsSource(eServiceReferenceDVB &ref) { - eRawFile *f = new eRawFile(); - f->open(ref.path.c_str()); - return ePtr(f); + if (m_is_stream) + { + eHttpStream *f = new eHttpStream(); + f->open(ref.path.c_str()); + return ePtr(f); + } + else + { + eRawFile *f = new eRawFile(); + f->open(ref.path.c_str()); + return ePtr(f); + } } void eDVBServicePlay::switchToTimeshift() @@ -2524,7 +2581,7 @@ void eDVBServicePlay::updateDecoder(bool sendSeekableStateChanged) m_decoder->setVideoPID(vpid, vpidtype); selectAudioStream(); - if (!(m_is_pvr || m_timeshift_active || !m_is_primary)) + if (!(m_is_pvr || m_is_stream || m_timeshift_active || !m_is_primary)) m_decoder->setSyncPCR(pcrpid); else m_decoder->setSyncPCR(-1);