X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c6de231f8b5fbd3656d65a4a62b12cdfbd546171..94b346a792a343858948de8c6db1301592af5986:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 5166414f..19bac206 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -97,50 +97,9 @@ int eStaticServiceDVBInformation::isPlayable(const eServiceReference &ref, const } extern void PutToDict(ePyObject &dict, const char*key, long value); // defined in dvb/frontend.cpp -extern void PutToDict(ePyObject &dict, const char*key, ePyObject item); // defined in dvb/frontend.cpp -extern void PutToDict(ePyObject &dict, const char*key, const char *value); // defined in dvb/frontend.cpp - -void PutSatelliteDataToDict(ePyObject &dict, eDVBFrontendParametersSatellite &feparm) -{ - PutToDict(dict, "tuner_type", "DVB-S"); - PutToDict(dict, "frequency", feparm.frequency); - PutToDict(dict, "symbol_rate", feparm.symbol_rate); - PutToDict(dict, "orbital_position", feparm.orbital_position); - PutToDict(dict, "inversion", feparm.inversion); - PutToDict(dict, "fec_inner", feparm.fec); - PutToDict(dict, "modulation", feparm.modulation); - PutToDict(dict, "polarization", feparm.polarisation); - if (feparm.system == eDVBFrontendParametersSatellite::System_DVB_S2) - { - PutToDict(dict, "rolloff", feparm.rolloff); - PutToDict(dict, "pilot", feparm.pilot); - } - PutToDict(dict, "system", feparm.system); -} - -void PutTerrestrialDataToDict(ePyObject &dict, eDVBFrontendParametersTerrestrial &feparm) -{ - PutToDict(dict, "tuner_type", "DVB-T"); - PutToDict(dict, "frequency", feparm.frequency); - PutToDict(dict, "bandwidth", feparm.bandwidth); - PutToDict(dict, "code_rate_lp", feparm.code_rate_LP); - PutToDict(dict, "code_rate_hp", feparm.code_rate_HP); - PutToDict(dict, "constellation", feparm.modulation); - PutToDict(dict, "transmission_mode", feparm.transmission_mode); - PutToDict(dict, "guard_interval", feparm.guard_interval); - PutToDict(dict, "hierarchy_information", feparm.hierarchy); - PutToDict(dict, "inversion", feparm.inversion); -} - -void PutCableDataToDict(ePyObject &dict, eDVBFrontendParametersCable &feparm) -{ - PutToDict(dict, "tuner_type", "DVB-C"); - PutToDict(dict, "frequency", feparm.frequency); - PutToDict(dict, "symbol_rate", feparm.symbol_rate); - PutToDict(dict, "modulation", feparm.modulation); - PutToDict(dict, "inversion", feparm.inversion); - PutToDict(dict, "fec_inner", feparm.fec_inner); -} +extern void PutSatelliteDataToDict(ePyObject &dict, eDVBFrontendParametersSatellite &feparm); // defined in dvb/frontend.cpp +extern void PutTerrestrialDataToDict(ePyObject &dict, eDVBFrontendParametersTerrestrial &feparm); // defined in dvb/frontend.cpp +extern void PutCableDataToDict(ePyObject &dict, eDVBFrontendParametersCable &feparm); // defined in dvb/frontend.cpp PyObject *eStaticServiceDVBInformation::getInfoObject(const eServiceReference &r, int what) { @@ -466,6 +425,7 @@ public: RESULT deleteFromDisk(int simulate); RESULT getListOfFilenames(std::list &); + RESULT reindex(); }; DEFINE_REF(eDVBPVRServiceOfflineOperations); @@ -528,6 +488,42 @@ RESULT eDVBPVRServiceOfflineOperations::getListOfFilenames(std::listgetPid() != rdsPid) { + m_rds_decoder = 0; ePtr data_demux; if (!h.getDataDemux(data_demux)) { - m_rds_decoder = new eDVBRdsDecoder(data_demux); + m_rds_decoder = new eDVBRdsDecoder(data_demux, different_pid); m_rds_decoder->connectEvent(slot(*this, &eDVBServicePlay::rdsDecoderEvent), m_rds_decoder_event_connection); + m_rds_decoder->start(rdsPid); } } - - /* if we decided that we need one, update the pid */ - if (m_rds_decoder) - m_rds_decoder->start(apid); + } /* store new pid as default only when: a.) we have an entry in the service db for the current service, @@ -2329,29 +2336,32 @@ void eDVBServicePlay::updateDecoder() m_decoder->connectVideoEvent(slot(*this, &eDVBServicePlay::video_event), m_video_event_connection); if (m_is_primary) { - ePyObject subs; - if (m_timeshift_changed) - subs = getCachedSubtitle(); m_teletext_parser = new eDVBTeletextParser(m_decode_demux); m_teletext_parser->connectNewPage(slot(*this, &eDVBServicePlay::newSubtitlePage), m_new_subtitle_page_connection); m_subtitle_parser = new eDVBSubtitleParser(m_decode_demux); m_subtitle_parser->connectNewPage(slot(*this, &eDVBServicePlay::newDVBSubtitlePage), m_new_dvb_subtitle_page_connection); - if (subs) + if (m_timeshift_changed) { - int type = PyInt_AsLong(PyTuple_GET_ITEM(subs, 0)), - pid = PyInt_AsLong(PyTuple_GET_ITEM(subs, 1)), - comp_page = PyInt_AsLong(PyTuple_GET_ITEM(subs, 2)), // ttx page - anc_page = PyInt_AsLong(PyTuple_GET_ITEM(subs, 3)); // ttx magazine - if (type == 0) // dvb - m_subtitle_parser->start(pid, comp_page, anc_page); - else if (type == 1) // ttx - m_teletext_parser->setPageAndMagazine(comp_page, anc_page); + ePyObject subs = getCachedSubtitle(); + if (subs != Py_None) + { + int type = PyInt_AsLong(PyTuple_GET_ITEM(subs, 0)), + pid = PyInt_AsLong(PyTuple_GET_ITEM(subs, 1)), + comp_page = PyInt_AsLong(PyTuple_GET_ITEM(subs, 2)), // ttx page + anc_page = PyInt_AsLong(PyTuple_GET_ITEM(subs, 3)); // ttx magazine + if (type == 0) // dvb + m_subtitle_parser->start(pid, comp_page, anc_page); + else if (type == 1) // ttx + m_teletext_parser->setPageAndMagazine(comp_page, anc_page); + } Py_DECREF(subs); } } + m_decoder->play(); /* pids will be set later */ } if (m_cue) m_cue->setDecodingDemux(m_decode_demux, m_decoder); + m_decoder->play(); /* pids will be set later. */ } m_timeshift_changed = 0; @@ -2425,13 +2435,7 @@ void eDVBServicePlay::updateDecoder() m_decoder->setRadioPic(radio_pic); } -/* if (!m_is_primary) - m_decoder->setTrickmode(); - else */ if (m_is_paused) - m_decoder->pause(); - else - m_decoder->play(); - + m_decoder->set(); m_decoder->setAudioChannel(achannel); /* don't worry about non-existing services, nor pvr services */