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.

88 lines
1.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. {
  11. private:
  12. protected:
  13. basicMediaDestination * m_pMediaDestination;
  14. MediaStateStatus m_eMediaStatus;
  15. bool m_bStreamingSource;
  16. public:
  17. basicMediaSource();
  18. virtual ~basicMediaSource();
  19. bool attachDestination(basicMediaDestination * Viewer)
  20. {
  21. if (Viewer != NULL)
  22. {
  23. m_pMediaDestination = Viewer;
  24. return true;
  25. };
  26. return false;
  27. }
  28. bool isAttached(void)
  29. {
  30. return (m_pMediaDestination != NULL);
  31. }
  32. void setStreaming(bool T)
  33. {
  34. m_bStreamingSource = T;
  35. }
  36. 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)
  37. {
  38. if ( URI || ShowDeviceMenu || framerate || inputPin || width || height || s_width || s_height ) return false;
  39. return false;
  40. }
  41. virtual bool _close(void)
  42. {
  43. return true;
  44. }
  45. virtual bool _stop(void)
  46. {
  47. return true;
  48. }
  49. virtual bool _continue(void)
  50. {
  51. return true;
  52. }
  53. virtual bool _restart(void)
  54. {
  55. return true;
  56. }
  57. MediaStateStatus getStatus(void)
  58. {
  59. return m_eMediaStatus;
  60. }
  61. };
  62. inline basicMediaSource::basicMediaSource()
  63. {
  64. m_bStreamingSource = true;
  65. m_pMediaDestination = NULL;
  66. m_eMediaStatus = MS_UNDEFINED;
  67. }
  68. inline basicMediaSource::~basicMediaSource() {}
  69. typedef vector<basicMediaSource *> mediaSourceCollection;
  70. #endif // __BASICMEDIASOURCE_H_INCL__