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.

47 lines
1.5 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
7 years ago
​
​
7 years ago
​
7 years ago
​
7 years ago
​
​
​
  1. #ifndef __BASICMEDIASOURCE_H_INCL__
  2. #define __BASICMEDIASOURCE_H_INCL__
  3. #include "basicMediaDestination.h"
  4. /**
  5. * TODO: Add class description
  6. *
  7. * @author Gagua
  8. */
  9. class basicMediaSource {
  10. private:
  11. protected:
  12. basicMediaDestination *m_pMediaDestination;
  13. MediaStateStatus m_eMediaStatus;
  14. bool m_bStreamingSource;
  15. public:
  16. basicMediaSource();
  17. virtual ~basicMediaSource();
  18. bool attachDestination(basicMediaDestination *Viewer){
  19. if (Viewer != NULL){
  20. m_pMediaDestination = Viewer;
  21. return true;
  22. };
  23. return false;
  24. };
  25. bool isAttached( void ) { return ( m_pMediaDestination != NULL ); };
  26. void setStreaming( bool T ){ m_bStreamingSource = T; };
  27. virtual bool _open( CSTR URI, bool ShowDeviceMenu = false, float framerate=-1.0f, int inputPin = -1, int width = -1, int height = -1 , int s_width=-1, int s_height=-1 ){ return false; };
  28. virtual bool _close( void ){ return true; };
  29. virtual bool _stop( void ){ return true; };
  30. virtual bool _restart( void ){ return true; };
  31. MediaStateStatus getStatus( void ){ return m_eMediaStatus; };
  32. };
  33. inline basicMediaSource::basicMediaSource(){
  34. m_bStreamingSource = true;
  35. m_pMediaDestination = NULL;
  36. m_eMediaStatus = MS_UNDEFINED;
  37. };
  38. inline basicMediaSource::~basicMediaSource() {
  39. };
  40. typedef vector<basicMediaSource *> mediaSourceCollection;
  41. #endif // __BASICMEDIASOURCE_H_INCL__