libmediaplayer.h 1018 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include <stdio.h>
  3. #include "idatastruct.h"
  4. #ifdef _WIN32
  5. #ifdef LIBMEDIAPLAYER_EXPORTS
  6. #define LIBMEDIAPLAYER_API __declspec(dllexport)
  7. #else
  8. #define LIBMEDIAPLAYER_API __declspec(dllimport)
  9. #endif
  10. # elif ( defined(__GNUC__) && __GNUC__ >= 4 )
  11. #define LIBMEDIAPLAYER_API __attribute__((visibility("default")))
  12. #else // RVC_OS_WIN
  13. #define LIBMEDIAPLAYER_API
  14. #endif // RVC_OS_WIN
  15. class libmediaplayer_impl;
  16. class LIBMEDIAPLAYER_API Clibmediaplayer
  17. {
  18. public:
  19. Clibmediaplayer(CMediaHostApi* pHostApi);
  20. ~Clibmediaplayer();
  21. int PlayLocalAudio(const char* pAudioNames);
  22. void Close();
  23. bool checkIsPlay();
  24. bool checkIsStop();
  25. int PlayMedia(CMediaPlayConfig& config);
  26. void SetVolume(int nVolume);
  27. void PlayVideoNotice(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pVideoName);
  28. bool IsFileValid(const char* pVideoName);
  29. private:
  30. libmediaplayer_impl* m_pImpl;
  31. };
  32. extern "C" LIBMEDIAPLAYER_API int mediaplayer_init();
  33. extern "C" LIBMEDIAPLAYER_API int mediaplayer_term();