You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.4 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __MEDIAVIDEOSOURCEMANAGER_H_INCL__
  2. #define __MEDIAVIDEOSOURCEMANAGER_H_INCL__
  3. #ifndef __linux__
  4. #include <winsock2.h>
  5. #include <ws2tcpip.h>
  6. #endif
  7. #include "../../components/base/basicLogCollection.h"
  8. #include "../../components/base/basicMediaSource.h"
  9. #include "../../components/base/basicSettingsProvider.h"
  10. #include "../../gui/controls/VideoThumbWidget.h"
  11. #include "../../components/object/objectStaticCamera.h"
  12. #ifndef NO_PTZ_CAMERAS
  13. #include "../../components/object/objectCameraPTZ.h"
  14. //#include "../../components/object/objectCamera_VISCA_PTZ.h"
  15. //#include "../../components/object/objectCamera_ONVIF_PTZ.h"
  16. //#include "video/videoAVLIBSource.h"
  17. #endif
  18. #include "videoNode.h"
  19. /**
  20. * TODO: Add class description
  21. *
  22. * @author Gagua
  23. */
  24. class mediaVideoSourceManager {
  25. private:
  26. basicLogCollection *m_pLog;
  27. config_setting_t *m_pSettings;
  28. enumeratorInfo m_vLocalDevices;
  29. sourcePool m_vUsedDevices;
  30. mediaSourceCollection m_vSourceCollection;
  31. videoNodeCollection m_vNodeCollection;
  32. vectorCameras m_vCameras;
  33. public:
  34. // Method to fetch singleton instance.
  35. static mediaVideoSourceManager* getInstance();
  36. // Destructor
  37. virtual ~mediaVideoSourceManager();
  38. bool isUsed( int id);
  39. basicCamera *addSource( SOURCE_INFO *SRC );
  40. bool addSource( basicMediaSource *SRC );
  41. size_t getLocalSourceCount( void );
  42. DeviceInfo *getLocalSourceInfo( size_t sourceId );
  43. static const char *getStandardSize( bool wide, int id );
  44. static const int getStandardWidth( bool wide, int id);
  45. static const int getStandardHeight( bool wide, int id);
  46. basicMediaSource *getVideoSource( int sourceId );
  47. vectorCamerasInterator getCameraCollectionBegin(void){ return m_vCameras.begin(); };
  48. vectorCamerasInterator getCameraCollectionEnd(void){ return m_vCameras.end(); };
  49. void shutdownAllVideoSources(void);
  50. protected:
  51. // Constructor - protected so users cannot call it.
  52. mediaVideoSourceManager();
  53. private:
  54. bool loadAssignedSources(void);
  55. // private static member referencing the single instance of the object
  56. // TODO: Replace mediaVideoSourceManager with the type of object you want to
  57. // return the single instance of
  58. static mediaVideoSourceManager* _instance;
  59. // Copy constructor
  60. // Declared but not defined to prevent auto-generated
  61. // copy constructor. Refer to "Effective C++" by Meyers
  62. mediaVideoSourceManager(const mediaVideoSourceManager& src);
  63. // Assignment operator
  64. // Declared but not defined to prevent auto-generated
  65. // assignment operator. Refer to "Effective C++" by Meyers
  66. mediaVideoSourceManager& operator=(const mediaVideoSourceManager& src);
  67. };
  68. // TODO: Uncomment the copy constructor when you need it.
  69. //inline mediaVideoSourceManager::mediaVideoSourceManager(const mediaVideoSourceManager& src)
  70. //{
  71. // // TODO: copy
  72. //}
  73. // TODO: Uncomment the assignment operator when you need it.
  74. //inline mediaVideoSourceManager& mediaVideoSourceManager::operator=(const mediaVideoSourceManager& rhs)
  75. //{
  76. // if (this == &rhs) {
  77. // return *this;
  78. // }
  79. //
  80. // // TODO: assignment
  81. //
  82. // return *this;
  83. //}
  84. #endif // __MEDIAVIDEOSOURCEMANAGER_H_INCL__