X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/a33ff213255db7f59090f70235ec06c502e2a2ce..e126edab6b5649fef4c00f871925e06f24338843:/lib/dvb/dvb.h diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 34c55492..f8586257 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -4,6 +4,7 @@ #include #include #include +#include #include class eDVBChannel; @@ -116,7 +117,7 @@ class eDVBResourceManager: public iObject RESULT allocateFrontend(const eDVBChannelID &chid, ePtr &fe); /* allocate a demux able to filter on the selected frontend. */ - RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux); + RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux, int cap); struct active_channel { @@ -156,21 +157,46 @@ public: }; /* allocate channel... */ - RESULT allocateChannel(const eDVBChannelID &channelid, ePtr &channel); - RESULT allocateRawChannel(ePtr &channel); - RESULT allocatePVRChannel(int caps); + RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr &channel); + RESULT allocateRawChannel(eUsePtr &channel); + RESULT allocatePVRChannel(eUsePtr &channel); RESULT connectChannelAdded(const Slot1 &channelAdded, ePtr &connection); RESULT connectChannelRemoved(const Slot1 &channelRemoved, ePtr &connection); RESULT connectChannelRunning(const Slot1 &channelRemoved, ePtr &connection); }; -class eDVBChannel: public iDVBChannel, public Object +class eFilePushThread; + + /* iDVBPVRChannel includes iDVBChannel. don't panic. */ +class eDVBChannel: public iDVBPVRChannel, public Object { DECLARE_REF(eDVBChannel); +public: + eDVBChannel(eDVBResourceManager *mgr, eDVBAllocatedFrontend *frontend); + virtual ~eDVBChannel(); + + /* only for managed channels - effectively tunes to the channelid. should not be used... */ + /* cannot be used for PVR channels. */ + RESULT setChannel(const eDVBChannelID &id); + eDVBChannelID getChannelID() { return m_channel_id; } + + RESULT connectStateChange(const Slot1 &stateChange, ePtr &connection); + RESULT getState(int &state); + + RESULT setCIRouting(const eDVBCIRouting &routing); + RESULT getDemux(ePtr &demux, int cap); + RESULT getFrontend(ePtr &frontend); + + /* iDVBPVRChannel */ + RESULT playFile(const char *file); + RESULT getLength(pts_t &len); + RESULT getCurrentPosition(pts_t &pos); + RESULT seekTo(pts_t &pts); + private: ePtr m_frontend; - ePtr m_demux; + ePtr m_demux, m_decoder_demux; ePtr m_current_frontend_parameters; eDVBChannelID m_channel_id; @@ -182,20 +208,17 @@ private: void frontendStateChanged(iDVBFrontend*fe); ePtr m_conn_frontendStateChanged; -public: - eDVBChannel(eDVBResourceManager *mgr, eDVBAllocatedFrontend *frontend, eDVBAllocatedDemux *demux); - virtual ~eDVBChannel(); - - /* only for managed channels - effectively tunes to the channelid. should not be used... */ - RESULT setChannel(const eDVBChannelID &id); - eDVBChannelID getChannelID() { return m_channel_id; } - - RESULT connectStateChange(const Slot1 &stateChange, ePtr &connection); - RESULT getState(int &state); + + /* for PVR playback */ + eFilePushThread *m_pvr_thread; + int m_pvr_fd_src, m_pvr_fd_dst; + eDVBTSTools m_tstools; - RESULT setCIRouting(const eDVBCIRouting &routing); - RESULT getDemux(ePtr &demux); - RESULT getFrontend(ePtr &frontend); + friend class eUsePtr; + /* use count */ + oRefCount m_use_count; + void AddUse(); + void ReleaseUse(); }; #endif