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.

91 lines
1.6 KiB

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