123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #pragma once
- #include <stdio.h>
- #ifdef _WIN32
- #ifdef LIBMEDIAPLAYER_EXPORTS
- #define LIBMEDIAPLAYER_API __declspec(dllexport)
- #else
- #define LIBMEDIAPLAYER_API __declspec(dllimport)
- #endif
- # elif ( defined(__GNUC__) && __GNUC__ >= 4 )
- #define LIBMEDIAPLAYER_API __attribute__((visibility("default")))
- #else // _WIN32
- #define LIBMEDIAPLAYER_API
- #endif // _WIN32
- #ifdef _WIN32
- #ifndef RVC_NO_VTABLE
- #define RVC_NO_VTABLE __declspec(novtable)
- #endif // !RVC_NO_VTABLE
- #else
- #ifndef RVC_NO_VTABLE
- #define RVC_NO_VTABLE
- #endif // !RVC_NO_VTABLE
- #endif // _WIN32
- #ifndef TIME_LEN
- #define TIME_LEN 9
- #endif // !TIME_LEN
- #ifndef MAX_FILECOUNT
- #define MAX_FILECOUNT 32
- #endif // !MAX_FILECOUNT
- #ifndef MAX_PATH
- #define MAX_PATH 260
- #endif // !MAX_PATH
- enum PlayModeEnum
- {
- UNKNOWN = -1, // 未知
- SINGLE, // 单一
- SALESRECORD, // 客户经理
- LOCALAUDIO, // 本地音频
- LOCALVIDEO, // 本地视频
- THRIDSALESRECORD // 3.0客户经理双录
- };
- struct CMediaPlayConfig
- {
- char strVideoRunTime_S[TIME_LEN]; // 每天允许视频播放的起始时间
- char strVideoRunTime_E[TIME_LEN]; // 每天允许视频播放的终止时间
- bool bFullScreen; // 是否全屏
- bool bPrimMonitor; // 是否主屏显示
- bool bSimpleMode; // 是否简洁模式
- PlayModeEnum eMode; // 播放模式
- int nWndX; // 窗口X坐标
- int nWndY; // 窗口Y坐标
- int nWndWidth; // 窗口宽度
- int nWndHeight; // 窗口高度
- int nFileCnt; // 文件个数
- int nPlayCnt; // 播放次数
- int nPlayInterval; // 播放时间间隔
- char strNamePrefix[MAX_PATH]; // 客户经理录像名前缀
- char strRootPath[MAX_PATH]; // 根目录
- char strFileNames[MAX_FILECOUNT][MAX_PATH]; // 文件名数组
- int nVolume; // 音量
- };
- struct RVC_NO_VTABLE CMediaHostApi
- {
- virtual int LoadPlayConfig(CMediaPlayConfig& config, int CfgInx) = 0;
- virtual void Debug(const char* fmt, ...) = 0;
- };
- class libmediaplayer_impl; // 桥接
- class LIBMEDIAPLAYER_API Clibmediaplayer
- {
- public:
- Clibmediaplayer(CMediaHostApi* pHostApi);
- ~Clibmediaplayer();
- void PlayVideo(const char* pVideoDir, const char* pNamePrefix = NULL, int nVideoCount = 1);
- void PlayLocalAudio(const char* pAudioNames);
- void PlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight);
- void Close();
- bool checkIsPlay(void* curThread);
- bool checkIsStop();
- void PlayMedia(CMediaPlayConfig& config);
- void SetVolume(int nVolume);
- void PlaySalesRecordVideo(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pVideoDir, const char* pNamePrefix = NULL, int nVideoCount = 1);
- private:
- libmediaplayer_impl* m_pImpl;
- };
|