ECSDKMirrorManager.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef ECSDKMIRRORMANAGER_H
  2. #define ECSDKMIRRORMANAGER_H
  3. #include "ECSDKTypes.h"
  4. namespace ECSDKFrameWork {
  5. /*!
  6. * \brief The base class of video player object.
  7. *
  8. * A video player is used to play a video.
  9. *
  10. */
  11. class EC_DLL_EXPORT IECVideoPlayer
  12. {
  13. public:
  14. /*!
  15. * \brief Virtual destructor.
  16. */
  17. virtual ~IECVideoPlayer();
  18. /*!
  19. * \brief start the video.
  20. *
  21. * \param width
  22. *
  23. * \param height
  24. *
  25. * \note When the user calls the startMIrror interface, the phone returns the recorded data,
  26. * and ECSDKFramewok calls the interface, where the user may need to initialize the decoder
  27. * and display the render window
  28. */
  29. virtual void start(int32_t width, int32_t height) = 0;
  30. /*!
  31. * \brief Stop the video.
  32. *
  33. * \note The ECSDKFramework calls this interface to tell the user to stop decoding when
  34. * for some reason, such as when the screen is disconnected
  35. */
  36. virtual void stop() = 0;
  37. /*!
  38. * \brief Used to play the mirror data.
  39. *
  40. * \param[in] data mirror data.
  41. * \param[in] len data length.
  42. *
  43. */
  44. virtual void play(const void *data, int32_t len) = 0;
  45. };
  46. /**
  47. * @brief The IECVideoManagerListener class
  48. */
  49. class EC_DLL_EXPORT IECMirrorManagerListener
  50. {
  51. public:
  52. /**
  53. * @brief onMirrorStatus
  54. * @param status
  55. */
  56. virtual void onMirrorStatus(ECSDKMirrorStatus status) = 0;
  57. /**
  58. * @brief onRealMirrorSizeChanged
  59. * @param realWidth
  60. * @param realHeight
  61. *
  62. * \note The actual size of the projection screen does not equal the size of the video stream in some cases.
  63. * The surrounding area is filled with black. This message calls back the actual size of the projection screen
  64. */
  65. virtual void onMirrorInfoChanged(ECVideoInfo info) {};
  66. };
  67. /**
  68. * @brief The ECSDKVideoPlayer class
  69. */
  70. class EC_DLL_EXPORT ECSDKMirrorManager
  71. {
  72. public:
  73. /**
  74. * @brief getInstance
  75. * @return
  76. */
  77. static ECSDKMirrorManager *getInstance();
  78. /**
  79. * @brief initialize
  80. * @param VideoPlayerObject
  81. * @param listener
  82. * @return
  83. */
  84. virtual bool initialize(IECVideoPlayer* VideoPlayerObject, IECMirrorManagerListener* listener) = 0;
  85. /**
  86. * @brief release
  87. * @return
  88. */
  89. virtual void release() = 0;
  90. /**
  91. * @brief setMirrorConfig
  92. * @param cfg
  93. * @return
  94. */
  95. virtual int32_t setMirrorConfig(const ECMirrorConfig& cfg) = 0;
  96. /**
  97. * @brief startMirror
  98. * @return
  99. */
  100. virtual int32_t startMirror() = 0;
  101. /**
  102. * @brief stopMirror
  103. */
  104. virtual void stopMirror() = 0;
  105. protected:
  106. ECSDKMirrorManager ();
  107. virtual ~ECSDKMirrorManager();
  108. };
  109. }
  110. #endif // ECSDKMIRRORMANAGER_H