warn instead of fatal if bitmap is incompatible.
[enigma2.git] / lib / dvb / pmt.cpp
index 8db4ba9f9a8d313783d29bc7deaaf00d3618df48..e70942009136e8739c1562878f743385302d9472 100644 (file)
@@ -87,9 +87,9 @@ void eDVBServicePMTHandler::PMTready(int error)
        {
                m_have_cached_program = false;
                serviceEvent(eventNewProgramInfo);
-               eEPGCache::getInstance()->PMTready(this);
                if (!m_pvr_channel) // don't send campmt to camd.socket for playbacked services
                {
+                       eEPGCache::getInstance()->PMTready(this);
                        if(!m_ca_servicePtr)
                        {
                                int demuxes[2] = {0,0};
@@ -856,3 +856,52 @@ void eDVBCAService::sendCAPMT()
                ++m_sendstate;
        }
 }
+
+static PyObject *createTuple(int pid, const char *type)
+{
+       PyObject *r = PyTuple_New(2);
+       PyTuple_SetItem(r, 0, PyInt_FromLong(pid));
+       PyTuple_SetItem(r, 1, PyString_FromString(type));
+       return r;
+}
+
+static inline void PyList_AppendSteal(PyObject *list, PyObject *item)
+{
+       PyList_Append(list, item);
+       Py_DECREF(item);
+}
+
+PyObject *eDVBServicePMTHandler::program::createPythonObject()
+{
+       PyObject *r = PyDict_New();
+
+       PyObject *l = PyList_New(0);
+       
+       PyList_AppendSteal(l, createTuple(0, "pat"));
+
+       if (pmtPid != -1)
+               PyList_AppendSteal(l, createTuple(pmtPid, "pmt"));
+       
+       for (std::vector<eDVBServicePMTHandler::videoStream>::const_iterator
+                       i(videoStreams.begin()); 
+                       i != videoStreams.end(); ++i)
+               PyList_AppendSteal(l, createTuple(i->pid, "video"));
+
+       for (std::vector<eDVBServicePMTHandler::audioStream>::const_iterator
+                       i(audioStreams.begin()); 
+                       i != audioStreams.end(); ++i)
+               PyList_AppendSteal(l, createTuple(i->pid, "audio"));
+
+       for (std::vector<eDVBServicePMTHandler::subtitleStream>::const_iterator
+                       i(subtitleStreams.begin());
+                       i != subtitleStreams.end(); ++i)
+               PyList_AppendSteal(l, createTuple(i->pid, "subtitle"));
+
+       PyList_AppendSteal(l, createTuple(pcrPid, "pcr"));
+
+       if (textPid != -1)
+               PyList_AppendSteal(l, createTuple(textPid, "text"));
+               
+       PyDict_SetItemString(r, "pids", l);
+       return r;
+}