[FCC] Fix to perform normal decoding for usb tuner on FCC mode.
[vuplus_dvbapp] / lib / dvb / dvb.h
index fa1801d..3e9fc7f 100644 (file)
@@ -12,6 +12,7 @@
 #include <lib/dvb/tstools.h>
 #include <lib/dvb/esection.h>
 #include <connection.h>
+#include <lib/dvb/fbc.h>
 
 #include <dvbsi++/service_description_section.h>
 
@@ -135,10 +136,15 @@ class eDVBResourceManager: public iObject, public Object
        DECLARE_REF(eDVBResourceManager);
        int avail, busy;
 
+       enum { DM7025, DM800, DM500HD, DM800SE, DM8000, DM7020HD };
+
+       int m_boxtype;
+
        eSmartPtrList<iDVBAdapter> m_adapter;
        eSmartPtrList<eDVBRegisteredDemux> m_demux;
        eSmartPtrList<eDVBRegisteredFrontend> m_frontend, m_simulate_frontend;
        void addAdapter(iDVBAdapter *adapter);
+       void setUsbTuner();
 
        struct active_channel
        {
@@ -154,8 +160,11 @@ class eDVBResourceManager: public iObject, public Object
        ePtr<iDVBChannelList> m_list;
        ePtr<iDVBSatelliteEquipmentControl> m_sec;
        static eDVBResourceManager *instance;
-       
+
+       ePtr<eFBCTunerManager> m_fbc_mng;
        friend class eDVBChannel;
+       friend class eFBCTunerManager;
        RESULT addChannel(const eDVBChannelID &chid, eDVBChannel *ch);
        RESULT removeChannel(eDVBChannel *ch);
 
@@ -187,11 +196,11 @@ public:
        };
        
        RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
-       int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, bool simulate=false);
+       int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, int &system, bool simulate=false);
 
                /* allocate channel... */
        RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel, bool simulate=false);
-       RESULT allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel);
+       RESULT allocatePVRChannel(const eDVBChannelID &channelid, eUsePtr<iDVBPVRChannel> &channel);
        static RESULT getInstance(ePtr<eDVBResourceManager> &);
 
                        /* allocates a frontend able to tune to frontend paramters 'feperm'.
@@ -205,7 +214,7 @@ public:
 
        RESULT allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index);
                        /* allocate a demux able to filter on the selected frontend. */
-       RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap);
+       RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int &cap);
 #ifdef SWIG
 public:
 #endif
@@ -214,6 +223,8 @@ public:
        PSignal1<void,int> frontendUseMaskChanged;
        SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int slot_index);
        PyObject *setFrontendSlotInformations(SWIG_PYOBJECT(ePyObject) list);
+       bool frontendIsCompatible(int index, const char *type);
+       void setFrontendType(int index, const char *type);
 };
 SWIG_TEMPLATE_TYPEDEF(ePtr<eDVBResourceManager>, eDVBResourceManager);
 SWIG_EXTEND(ePtr<eDVBResourceManager>,
@@ -255,7 +266,10 @@ public:
                /* iDVBPVRChannel */
        RESULT playFile(const char *file);
        void stopFile();
-       
+
+       RESULT playSource(ePtr<iTsSource>& source, const char *priv=NULL);
+       void stopSource();
+
        void setCueSheet(eCueSheet *cuesheet);
        
        RESULT getLength(pts_t &len);
@@ -264,6 +278,7 @@ public:
        int getUseCount() { return m_use_count; }
 
        RESULT requestTsidOnid(ePyObject callback);
+       int reserveDemux();
 private:
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
@@ -273,6 +288,7 @@ private:
        Signal1<void,iDVBChannel*> m_stateChanged;
        Signal2<void,iDVBChannel*,int> m_event;
        int m_state;
+       ePtr<iTsSource> m_source;
 
                        /* for channel list */
        ePtr<eDVBResourceManager> m_mgr;
@@ -291,12 +307,12 @@ private:
        
        void cueSheetEvent(int event);
        ePtr<eConnection> m_conn_cueSheetEvent;
-       int m_skipmode_m, m_skipmode_n;
+       int m_skipmode_m, m_skipmode_n, m_skipmode_frames, m_skipmode_frames_remainder;
        
        std::list<std::pair<off_t, off_t> > m_source_span;
        void getNextSourceSpan(off_t current_offset, size_t bytes_read, off_t &start, size_t &size);
        void flushPVR(iDVBDemux *decoding_demux=0);
-       
+
        eSingleLock m_cuesheet_lock;
 
        friend class eUsePtr<eDVBChannel>;