#ifndef __MEDIAVIDEOSOURCEMANAGER_H_INCL__ #define __MEDIAVIDEOSOURCEMANAGER_H_INCL__ #ifndef __linux__ #include #include #endif #include "../../components/base/basicLogCollection.h" #include "../../components/base/basicMediaSource.h" #include "../../components/base/basicSettingsProvider.h" #include "../../gui/controls/VideoThumbWidget.h" #include "../../components/object/objectStaticCamera.h" #ifndef NO_PTZ_CAMERAS #include "../../components/object/objectCameraPTZ.h" //#include "../../components/object/objectCamera_VISCA_PTZ.h" //#include "../../components/object/objectCamera_ONVIF_PTZ.h" //#include "video/videoAVLIBSource.h" #endif #include "videoNode.h" /** * TODO: Add class description * * @author Gagua */ class mediaVideoSourceManager { private: basicLogCollection *m_pLog; config_setting_t *m_pSettings; enumeratorInfo m_vLocalDevices; sourcePool m_vUsedDevices; mediaSourceCollection m_vSourceCollection; videoNodeCollection m_vNodeCollection; vectorCameras m_vCameras; public: // Method to fetch singleton instance. static mediaVideoSourceManager* getInstance(); // Destructor virtual ~mediaVideoSourceManager(); bool isUsed( int id); basicCamera *addSource( SOURCE_INFO *SRC ); bool addSource( basicMediaSource *SRC ); size_t getLocalSourceCount( void ); DeviceInfo *getLocalSourceInfo( size_t sourceId ); static const char *getStandardSize( bool wide, int id ); static const int getStandardWidth( bool wide, int id); static const int getStandardHeight( bool wide, int id); basicMediaSource *getVideoSource( int sourceId ); size_t getCameraCollectionCount(void){ return m_vCameras.size(); }; vectorCamerasInterator getCameraCollectionBegin(void){ return m_vCameras.begin(); }; vectorCamerasInterator getCameraCollectionEnd(void){ return m_vCameras.end(); }; void shutdownAllVideoSources(void); bool removeSource(basicCamera *ptr); protected: // Constructor - protected so users cannot call it. mediaVideoSourceManager(); private: bool loadAssignedSources(void); // private static member referencing the single instance of the object // TODO: Replace mediaVideoSourceManager with the type of object you want to // return the single instance of static mediaVideoSourceManager* _instance; // Copy constructor // Declared but not defined to prevent auto-generated // copy constructor. Refer to "Effective C++" by Meyers mediaVideoSourceManager(const mediaVideoSourceManager& src); // Assignment operator // Declared but not defined to prevent auto-generated // assignment operator. Refer to "Effective C++" by Meyers mediaVideoSourceManager& operator=(const mediaVideoSourceManager& src); }; // TODO: Uncomment the copy constructor when you need it. //inline mediaVideoSourceManager::mediaVideoSourceManager(const mediaVideoSourceManager& src) //{ // // TODO: copy //} // TODO: Uncomment the assignment operator when you need it. //inline mediaVideoSourceManager& mediaVideoSourceManager::operator=(const mediaVideoSourceManager& rhs) //{ // if (this == &rhs) { // return *this; // } // // // TODO: assignment // // return *this; //} #endif // __MEDIAVIDEOSOURCEMANAGER_H_INCL__