#include <dvbsi++/iso639_language_descriptor.h>
#include <dvbsi++/stream_identifier_descriptor.h>
-eDVBServicePMTHandler::eDVBServicePMTHandler(int record)
+eDVBServicePMTHandler::eDVBServicePMTHandler()
:m_ca_servicePtr(0)
{
- m_record = record;
+ m_use_decode_demux = 0;
eDVBResourceManager::getInstance(m_resourceManager);
CONNECT(m_PMT.tableReady, eDVBServicePMTHandler::PMTready);
CONNECT(m_PAT.tableReady, eDVBServicePMTHandler::PATready);
- eDebug("new PMT handler record: %d", m_record);
}
eDVBServicePMTHandler::~eDVBServicePMTHandler()
{
- eDebug("delete PMT handler record: %d", m_record);
if (m_ca_servicePtr)
{
eDebug("unregister caservice");
&& (state == iDVBChannel::state_ok) && (!m_demux))
{
if (m_channel)
- if (m_channel->getDemux(m_demux, m_record ? 0 : iDVBChannel::capDecode))
+ if (m_channel->getDemux(m_demux, (!m_use_decode_demux) ? 0 : iDVBChannel::capDecode))
eDebug("Allocating a demux for now tuned-in channel failed.");
serviceEvent(eventTuned);
void eDVBServicePMTHandler::PATready(int)
{
- eDebug("got PAT");
ePtr<eTable<ProgramAssociationSection> > ptr;
if (!m_PAT.getCurrent(ptr))
{
program.audioStreams.clear();
program.pcrPid = -1;
program.isCrypted = false;
+ program.pmtPid = -1;
if (!m_PMT.getCurrent(ptr))
{
}
}
return 0;
- }
- else if ( m_service && !m_service->cacheEmpty() )
+ } else if ( m_service && !m_service->cacheEmpty() )
{
int vpid = m_service->getCachePID(eDVBService::cVPID),
apid_ac3 = m_service->getCachePID(eDVBService::cAC3PID),
return -1;
}
-int eDVBServicePMTHandler::getDemux(ePtr<iDVBDemux> &demux)
+int eDVBServicePMTHandler::getDataDemux(ePtr<iDVBDemux> &demux)
{
demux = m_demux;
if (demux)
return -1;
}
+int eDVBServicePMTHandler::getDecodeDemux(ePtr<iDVBDemux> &demux)
+{
+ /* if we're using the decoding demux as data source
+ (for example in pvr playbacks), return that one. */
+ if (m_use_decode_demux)
+ {
+ demux = m_demux;
+ return 0;
+ }
+
+ return m_channel->getDemux(demux, iDVBChannel::capDecode);
+}
+
int eDVBServicePMTHandler::getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel)
{
pvr_channel = m_pvr_channel;
return -1;
}
-int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref)
+int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux)
{
RESULT res;
m_reference = ref;
+ m_use_decode_demux = use_decode_demux;
+
/* is this a normal (non PVR) channel? */
if (ref.path.empty())
{
return res;
}
+void eDVBServicePMTHandler::free()
+{
+ m_PMT.stop();
+ m_PAT.stop();
+ m_service = 0;
+ m_channel = 0;
+ m_pvr_channel = 0;
+ m_demux = 0;
+}
+
std::map<eServiceReferenceDVB, eDVBCAService*> eDVBCAService::exist;
eDVBCAService::eDVBCAService()
void PMTready(int error);
void PATready(int error);
- int m_record;
+ int m_use_decode_demux;
public:
- eDVBServicePMTHandler(int record);
+ eDVBServicePMTHandler();
~eDVBServicePMTHandler();
enum
};
int getProgramInfo(struct program &program);
- int getDemux(ePtr<iDVBDemux> &demux);
+ int getDataDemux(ePtr<iDVBDemux> &demux);
+ int getDecodeDemux(ePtr<iDVBDemux> &demux);
+
int getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel);
int getService(eServiceReferenceDVB &service) { service = m_reference; return 0; }
int getPMT(ePtr<eTable<ProgramMapSection> > &ptr) { return m_PMT.getCurrent(ptr); }
int getChannel(eUsePtr<iDVBChannel> &channel);
- int tune(eServiceReferenceDVB &ref);
+ int tune(eServiceReferenceDVB &ref, int use_decode_demux);
+ void free();
};
#endif