libmediaplayer.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. #include "libmediaplayer.h"
  2. #include "player.h"
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <io.h>
  6. class libmediaplayer_impl
  7. {
  8. private:
  9. CMediaHostApi* m_pHostApi;
  10. CMediaPlayer* m_Player;
  11. CMediaPlayConfig m_stPlayConfig;
  12. public:
  13. bool m_bisplaying;
  14. public:
  15. libmediaplayer_impl(CMediaHostApi* pHostApi);
  16. ~libmediaplayer_impl();
  17. bool isStop();
  18. void PlayMediaFinished();
  19. int StartPlayVideo(const char* pVideoDir, const char* pNamePrefix = NULL, int nVideoCount = 1);
  20. int GetLocalAudioPlayingParams(rvc_media_player_param_t* pParam, const char* pAudioNames);
  21. int StartPlayLocalAudio(const char* pAudioNames);
  22. int GetLocalVideoPlayingParams(rvc_media_player_param_t* pParam);
  23. int StartPlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight);
  24. int StartPlayMedia(CMediaPlayConfig& config);
  25. bool StopPlay();
  26. void SetVolume(int nVolume);
  27. void StartPlaySalesRecordVideo(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pVideoDir, const char* pNamePrefix = NULL, int nVideoCount = 1);
  28. void StartPlayVideoNotice(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pFileName);
  29. bool checkIsPlay();
  30. bool checkIsStop();
  31. CMediaHostApi* GetHostApi();
  32. int PlayingAudioPcmCallback(audio_param_t* param, const void* input, unsigned long uaudiolen);
  33. bool IsFileValid(const char* pVideoName);
  34. };
  35. bool IsFileExist(const char* pFilePath)
  36. {
  37. bool bRet = false;
  38. if (NULL != pFilePath) {
  39. if (0 == access(pFilePath, 0)) {
  40. bRet = true;
  41. }
  42. }
  43. return bRet;
  44. }
  45. void CStringSplit(char* str, char** result, const char* del)
  46. {
  47. char* ptr = NULL;
  48. char* p = strtok_s(str, del, &ptr);
  49. while (p != NULL)
  50. {
  51. *result++ = p;
  52. p = strtok_s(NULL, del, &ptr);
  53. }
  54. }
  55. static void __cb_play_finished(void* user_data)
  56. {
  57. libmediaplayer_impl* pthis = static_cast<libmediaplayer_impl*>(user_data);
  58. if (NULL != pthis) {
  59. pthis->PlayMediaFinished();
  60. pthis->m_bisplaying = false;
  61. }
  62. }
  63. static int __cb_playing_audio_data(audio_param_t* param, const void* input, unsigned long uaudiolen, void* user_data)
  64. {
  65. int iret = -1;
  66. libmediaplayer_impl* pthis = static_cast<libmediaplayer_impl*>(user_data);
  67. if (NULL != pthis) {
  68. iret = pthis->PlayingAudioPcmCallback(param, input, uaudiolen);
  69. }
  70. return iret;
  71. }
  72. libmediaplayer_impl::libmediaplayer_impl(CMediaHostApi* pHostApi)
  73. {
  74. m_pHostApi = pHostApi;
  75. m_Player = new CMediaPlayer(pHostApi);
  76. if (NULL == m_Player) {
  77. pHostApi->Debug(MEDIA_LOG_DEBUG, "new MediaPlayer failed!");
  78. }
  79. memset(&m_stPlayConfig, 0, sizeof(CMediaPlayConfig));
  80. m_bisplaying = false;
  81. }
  82. libmediaplayer_impl::~libmediaplayer_impl()
  83. {
  84. m_pHostApi = NULL;
  85. delete m_Player;
  86. m_Player = NULL;
  87. m_bisplaying = false;
  88. }
  89. bool libmediaplayer_impl::isStop()
  90. {
  91. return !m_bisplaying;
  92. }
  93. void libmediaplayer_impl::PlayMediaFinished()
  94. {
  95. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "PlayMediaFinished!");
  96. m_pHostApi->MediaPlayFinished(m_Player->GetPlayingMediaType());
  97. }
  98. int libmediaplayer_impl::PlayingAudioPcmCallback(audio_param_t* param, const void* input, unsigned long uaudiolen)
  99. {
  100. return m_pHostApi->PlayingAudioDataCallback(param, input, uaudiolen);
  101. }
  102. bool libmediaplayer_impl::IsFileValid(const char* pVideoName)
  103. {
  104. bool bret= false;
  105. int err = -1;
  106. AVFormatContext* p_fmt_ctx = avformat_alloc_context();
  107. if (!p_fmt_ctx){
  108. return bret;
  109. }
  110. // 1. 构建AVFormatContext
  111. // 1.1 打开视频文件:读取文件头,将文件格式信息存储在"fmt context"中
  112. err = avformat_open_input(&p_fmt_ctx, pVideoName, NULL, NULL);
  113. if (0 == err){
  114. err = avformat_find_stream_info(p_fmt_ctx, NULL);
  115. if (err >= 0){
  116. for (int i = 0; i < (int)p_fmt_ctx->nb_streams; i++){
  117. if ((p_fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) || AVMEDIA_TYPE_VIDEO == p_fmt_ctx->streams[i]->codecpar->codec_type){
  118. bret = true;
  119. }
  120. }
  121. }
  122. }
  123. avformat_close_input(&p_fmt_ctx);
  124. avformat_free_context(p_fmt_ctx);
  125. return bret;
  126. }
  127. int libmediaplayer_impl::StartPlayVideo(const char* pVideoDir, const char* pNamePrefix, int nVideoCount)
  128. {
  129. int iRet = -1;
  130. if (NULL == pVideoDir || NULL == pNamePrefix) {
  131. return iRet;
  132. }
  133. play_media_callback_t cb = {0};
  134. cb.cb_play_media_finished = &__cb_play_finished;
  135. cb.user_data = this;
  136. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "audio root path is %s.", pVideoDir);
  137. char strVideoName[MAX_PATH] = { 0 };
  138. snprintf(strVideoName, MAX_PATH, "%s/%s", pVideoDir, pNamePrefix);
  139. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "video full path is %s.", strVideoName);
  140. if (!IsFileExist(strVideoName)) {
  141. return iRet;
  142. }
  143. rvc_media_player_param_t t_param = { 0 };
  144. t_param.p_input_file = strVideoName;
  145. t_param.cb = &cb;
  146. t_param.eType = eVideo_Type;
  147. t_param.eWindType = eVideoSize_Type;
  148. t_param.idisplaycx = SDL_WINDOWPOS_UNDEFINED;
  149. t_param.idisplaycy = SDL_WINDOWPOS_UNDEFINED;
  150. memcpy(t_param.strPlayLists[0], strVideoName, strlen(strVideoName));
  151. t_param.uFilesCount = 1;
  152. if (0 == m_Player->InitParam(&t_param)) {
  153. m_bisplaying = true;
  154. iRet = m_Player->StartMediaPlay();
  155. }
  156. return iRet;
  157. }
  158. int libmediaplayer_impl::GetLocalAudioPlayingParams(rvc_media_player_param_t* pParam, const char* pAudioNames)
  159. {
  160. int iRet = -1;
  161. if (NULL == pParam || NULL == pAudioNames) {
  162. return iRet;
  163. }
  164. pParam->eType = eAudio_Type;
  165. pParam->eWindType = eVideoSize_Type;
  166. size_t uLen = strlen(pAudioNames);
  167. char* Tmp = new char[uLen + 1];
  168. memset(Tmp, 0, uLen + 1);
  169. memcpy(Tmp, pAudioNames, uLen);
  170. char* Result[MAX_FILECOUNT] = { NULL };
  171. CStringSplit(Tmp, Result, "|");
  172. int FileCount = 0;
  173. char** pStr = Result;
  174. while (*pStr != NULL) {
  175. ++pStr;
  176. ++FileCount;
  177. }
  178. m_stPlayConfig.bPrimMonitor = true;
  179. m_stPlayConfig.nFileCnt = FileCount;
  180. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "wmp pAudioNames = %s!", pAudioNames);
  181. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "wmp config.nFileCnt = %d!", FileCount);
  182. size_t uValidCount = 0;
  183. for (int i = 0; i < FileCount && i < MAX_FILECOUNT; i++) {
  184. char strFileName[MAX_PATH] = { 0 };
  185. snprintf(strFileName, MAX_PATH, "%s%s", m_stPlayConfig.strRootPath, Result[i]);
  186. if (IsFileExist(strFileName)) {
  187. memcpy(pParam->strPlayLists[i], strFileName, strlen(strFileName));
  188. uValidCount++;
  189. }
  190. else {
  191. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "File %s is not exist.", strFileName);
  192. continue;
  193. }
  194. }
  195. delete[] Tmp;
  196. Tmp = NULL;
  197. pParam->uFilesCount = uValidCount;
  198. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "pParam uFilesCount = %d", pParam->uFilesCount);
  199. if (uValidCount > 0) {
  200. iRet = 0;
  201. }
  202. return iRet;
  203. }
  204. int libmediaplayer_impl::StartPlayLocalAudio(const char* pAudioNames)
  205. {
  206. int iRet = -1;
  207. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "StartPlayLocalAudio %s.", pAudioNames);
  208. m_stPlayConfig.eMode = MEDIA_LOCALAUDIO;
  209. iRet = m_pHostApi->LoadPlayConfig(m_stPlayConfig);
  210. m_stPlayConfig.eMode = MEDIA_LOCALAUDIO;
  211. if (0 != iRet) {
  212. m_pHostApi->Debug(MEDIA_LOG_ERROR, "Load WmpConfiguration failed while play local audio!");
  213. return iRet;
  214. }
  215. else {
  216. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Load WmpConfiguration succeeded while play local audio!");
  217. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "m_stPlayConfig.strRootPath: %s", m_stPlayConfig.strRootPath);
  218. }
  219. rvc_media_player_param_t t_param = { 0 };
  220. if (0 != GetLocalAudioPlayingParams(&t_param, pAudioNames)) {
  221. return iRet;
  222. }
  223. play_media_callback_t cb = { 0 };
  224. cb.cb_play_media_finished = &__cb_play_finished;
  225. cb.cb_playing_audiodata = &__cb_playing_audio_data;
  226. cb.user_data = this;
  227. t_param.cb = &cb;
  228. if (0 == m_Player->InitParam(&t_param)) {
  229. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Player Init success!");
  230. m_bisplaying = true;
  231. iRet = m_Player->StartMediaPlay();
  232. }
  233. else {
  234. m_pHostApi->Debug(MEDIA_LOG_ERROR, "Player Init failed!");
  235. }
  236. return iRet;
  237. }
  238. int libmediaplayer_impl::GetLocalVideoPlayingParams(rvc_media_player_param_t* pParam)
  239. {
  240. int iRet = -1;
  241. if (NULL == pParam) {
  242. return iRet;
  243. }
  244. pParam->eType = eVideo_Type;
  245. pParam->eWindType = eFullScreen_Type;
  246. size_t uValidCount = 0;
  247. for (int i = 0; i < m_stPlayConfig.nFileCnt && i < MAX_FILECOUNT; i++) {
  248. char strFileName[MAX_PATH] = { 0 };
  249. snprintf(strFileName, MAX_PATH, "%s%s", m_stPlayConfig.strRootPath, m_stPlayConfig.strFileNames[i]);
  250. if (IsFileExist(strFileName)) {
  251. memcpy(pParam->strPlayLists[i], strFileName, strlen(strFileName));
  252. uValidCount++;
  253. }
  254. else {
  255. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "File %s is not exist.", strFileName);
  256. continue;
  257. }
  258. }
  259. pParam->uFilesCount = uValidCount;
  260. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "pParam uFilesCount = %d", pParam->uFilesCount);
  261. if (uValidCount > 0) {
  262. iRet = 0;
  263. }
  264. return iRet;
  265. }
  266. int libmediaplayer_impl::StartPlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight)
  267. {
  268. int iRet = -1;
  269. m_stPlayConfig.eMode = MEDIA_LOCALVIDEO;
  270. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "nCfgInx=%d, nWndX=%d, nWndY=%d, nWndWidth=%d, nWndHeight=%d!", nCfgInx, nWndX, nWndY, nWndWidth, nWndHeight);
  271. iRet = m_pHostApi->LoadPlayConfig(m_stPlayConfig, nCfgInx);
  272. m_stPlayConfig.eMode = MEDIA_LOCALVIDEO;
  273. m_stPlayConfig.nWndX = nWndX;
  274. m_stPlayConfig.nWndY = nWndY;
  275. m_stPlayConfig.nWndWidth = nWndWidth;
  276. m_stPlayConfig.nWndHeight = nWndHeight;
  277. if (0 != iRet) {
  278. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Load WmpConfiguration failed while play local video!");
  279. return iRet;
  280. }
  281. else {
  282. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Load WmpConfiguration succeeded while play local video!");
  283. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "m_stPlayConfig.strRootPath: %s,m_stPlayConfig.nFileCnt:%d", m_stPlayConfig.strRootPath, m_stPlayConfig.nFileCnt);
  284. }
  285. struct tm* ptm = NULL;
  286. time_t t = time(NULL);
  287. ptm = localtime(&t);
  288. char strNow[TIME_LEN] = { 0 };
  289. sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
  290. if (strcmp(strNow, m_stPlayConfig.strVideoRunTime_S) < 0 || strcmp(strNow, m_stPlayConfig.strVideoRunTime_E) >= 0)
  291. {
  292. //m_pHostApi->Debug("Now is %s, video play start time is %s, video play stop time is %s, play video rejected!", strNow, m_stPlayConfig.strVideoRunTime_S, m_stPlayConfig.strVideoRunTime_E);
  293. iRet = 0;
  294. return iRet;
  295. }
  296. rvc_media_player_param_t t_param = { 0 };
  297. if (0 != GetLocalVideoPlayingParams(&t_param)) {
  298. return iRet;
  299. }
  300. t_param.idisplaycx = SDL_WINDOWPOS_UNDEFINED;
  301. t_param.idisplaycy = SDL_WINDOWPOS_UNDEFINED;
  302. t_param.bvicemonitor = true;
  303. play_media_callback_t cb = { 0 };
  304. cb.cb_play_media_finished = &__cb_play_finished;
  305. cb.user_data = this;
  306. t_param.cb = &cb;
  307. if (0 == m_Player->InitParam(&t_param)) {
  308. m_bisplaying = true;
  309. iRet = m_Player->StartMediaPlay();
  310. }
  311. else {
  312. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "player init failed!");
  313. }
  314. return iRet;
  315. }
  316. int libmediaplayer_impl::StartPlayMedia(CMediaPlayConfig& config)
  317. {
  318. int iRet = -1;
  319. memcpy(&m_stPlayConfig, &config, sizeof(CMediaPlayConfig));
  320. struct tm* ptm = NULL;
  321. time_t t = time(NULL);
  322. ptm = localtime(&t);
  323. char strNow[TIME_LEN] = { 0 };
  324. snprintf(strNow, TIME_LEN, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
  325. if (strcmp(strNow, m_stPlayConfig.strVideoRunTime_S) < 0 || strcmp(strNow, m_stPlayConfig.strVideoRunTime_E) >= 0)
  326. {
  327. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Now is %s, video play start time is %s, video play stop time is %s, play video rejected!", strNow, m_stPlayConfig.strVideoRunTime_S, m_stPlayConfig.strVideoRunTime_E);
  328. iRet = -2;
  329. return iRet;
  330. }
  331. rvc_media_player_param_t t_param = { 0 };
  332. //if (0 != GetLocalVideoPlayingParams(&t_param)) {
  333. // return iRet;
  334. //}
  335. t_param.eType = eVideo_Type;
  336. t_param.eWindType = eFullScreen_Type;
  337. t_param.bvicemonitor = true;
  338. char strFileName[MAX_PATH] = { 0 };
  339. snprintf(strFileName, MAX_PATH, "%s%s", m_stPlayConfig.strRootPath, m_stPlayConfig.strFileNames[0]);
  340. if (IsFileExist(strFileName)) {
  341. memcpy(t_param.strPlayLists[0], strFileName, strlen(strFileName));
  342. t_param.uFilesCount = 1;
  343. }
  344. else {
  345. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "File %s is not exist.", strFileName);
  346. t_param.uFilesCount = 0;
  347. return iRet;
  348. }
  349. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "pParam uFilesCount = %d", t_param.uFilesCount);
  350. play_media_callback_t cb = { 0 };
  351. cb.cb_play_media_finished = &__cb_play_finished;
  352. cb.user_data = this;
  353. t_param.cb = &cb;
  354. m_Player->SetVolume(config.nVolume);
  355. if (0 == m_Player->InitParam(&t_param)) {
  356. m_bisplaying = true;
  357. iRet = m_Player->StartMediaPlay();
  358. }
  359. else {
  360. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Player Init failed!");
  361. }
  362. return iRet;
  363. }
  364. bool libmediaplayer_impl::StopPlay()
  365. {
  366. if (m_Player->GetPlayingFlag())
  367. {
  368. m_Player->StopMediaPlay();
  369. }
  370. return true;
  371. }
  372. void libmediaplayer_impl::SetVolume(int nVolume)
  373. {
  374. //if (m_Player->GetPlayingFlag())
  375. {
  376. m_Player->SetVolume(nVolume);
  377. }
  378. }
  379. void libmediaplayer_impl::StartPlaySalesRecordVideo(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pVideoDir, const char* pNamePrefix, int nVideoCount)
  380. {
  381. }
  382. void libmediaplayer_impl::StartPlayVideoNotice(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pFileName)
  383. {
  384. int iRet = -1;
  385. if (NULL == pFileName) {
  386. return;
  387. }
  388. rvc_media_player_param_t t_param = { 0 };
  389. t_param.uFilesCount = 1;
  390. t_param.eType = eVideo_Type;
  391. t_param.eWindType = eSpecified_Type;
  392. t_param.idisplaycx = nWndX;
  393. t_param.idisplaycy = nWndY;
  394. t_param.idisplaywidth = nWndWidth;
  395. t_param.idisplayheight = nWndHeight;
  396. t_param.bvicemonitor = false;
  397. memcpy(&t_param.strPlayLists[0], pFileName, strlen(pFileName));
  398. play_media_callback_t cb = { 0 };
  399. cb.cb_play_media_finished = &__cb_play_finished;
  400. cb.user_data = this;
  401. t_param.cb = &cb;
  402. if (0 == m_Player->InitParam(&t_param)) {
  403. m_bisplaying = true;
  404. iRet = m_Player->StartMediaPlay();
  405. }
  406. else {
  407. m_pHostApi->Debug(MEDIA_LOG_DEBUG, "player init failed!");
  408. }
  409. return;
  410. }
  411. bool libmediaplayer_impl::checkIsPlay()
  412. {
  413. return m_bisplaying;
  414. }
  415. bool libmediaplayer_impl::checkIsStop()
  416. {
  417. return !m_bisplaying;
  418. }
  419. CMediaHostApi* libmediaplayer_impl::GetHostApi()
  420. {
  421. return m_pHostApi;
  422. }
  423. Clibmediaplayer::Clibmediaplayer(CMediaHostApi* pHostApi)
  424. {
  425. m_pImpl = new libmediaplayer_impl(pHostApi);
  426. return;
  427. }
  428. Clibmediaplayer::~Clibmediaplayer()
  429. {
  430. delete m_pImpl;
  431. m_pImpl = NULL;
  432. }
  433. int Clibmediaplayer::PlayVideo(const char* pVideoDir, const char* pNamePrefix, int nVideoCount)
  434. {
  435. return m_pImpl->StartPlayVideo(pVideoDir, pNamePrefix, nVideoCount);
  436. }
  437. int Clibmediaplayer::PlayLocalAudio(const char* pAudioNames)
  438. {
  439. m_pImpl->GetHostApi()->Debug(MEDIA_LOG_DEBUG, "Clibmediaplayer StartPlayLocalAudio");
  440. return m_pImpl->StartPlayLocalAudio(pAudioNames);
  441. }
  442. int Clibmediaplayer::PlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight)
  443. {
  444. return m_pImpl->StartPlayLocalVideo(nCfgInx, nWndX, nWndY, nWndWidth, nWndHeight);
  445. }
  446. bool Clibmediaplayer::checkIsPlay()
  447. {
  448. return m_pImpl->checkIsPlay();
  449. }
  450. bool Clibmediaplayer::checkIsStop()
  451. {
  452. return m_pImpl->isStop();
  453. }
  454. int Clibmediaplayer::PlayMedia(CMediaPlayConfig& config)
  455. {
  456. return m_pImpl->StartPlayMedia(config);
  457. }
  458. void Clibmediaplayer::Close()
  459. {
  460. m_pImpl->StopPlay();
  461. }
  462. void Clibmediaplayer::SetVolume(int nVolume)
  463. {
  464. m_pImpl->SetVolume(nVolume);
  465. }
  466. void Clibmediaplayer::PlaySalesRecordVideo(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pVideoDir, const char* pNamePrefix, int nVideoCount)
  467. {
  468. m_pImpl->StartPlaySalesRecordVideo(nWndX, nWndY, nWndWidth, nWndHeight, pVideoDir, pNamePrefix, nVideoCount);
  469. }
  470. void Clibmediaplayer::PlayVideoNotice(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char* pFileName)
  471. {
  472. m_pImpl->StartPlayVideoNotice(nWndX, nWndY, nWndWidth, nWndHeight, pFileName);
  473. }
  474. bool Clibmediaplayer::IsFileValid(const char* pVideoName)
  475. {
  476. return m_pImpl->IsFileValid(pVideoName);
  477. }
  478. int mediaplayer_init()
  479. {
  480. return 0;
  481. }
  482. int mediaplayer_term()
  483. {
  484. return 0;
  485. }