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.

46 lines
1.4 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. MediaStateStatus getStatus( void ){ return m_eMediaStatus;};
  31. };
  32. inline basicMediaSource::basicMediaSource(){
  33. m_bStreamingSource = true;
  34. m_pMediaDestination = NULL;
  35. m_eMediaStatus = MS_UNDEFINED;
  36. };
  37. inline basicMediaSource::~basicMediaSource() {
  38. };
  39. typedef vector<basicMediaSource *> mediaSourceCollection;
  40. #endif // __BASICMEDIASOURCE_H_INCL__