|
@@ -140,7 +140,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
m_Videos.clear();
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
- // 获取本地媒体根目录
|
|
|
+ // 锟斤拷取锟斤拷锟斤拷媒锟斤拷锟侥柯�
|
|
|
CSimpleStringA strRootPath;
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
Error = GetFunction()->GetPath("ADData", strRootPath);
|
|
@@ -176,7 +176,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
}
|
|
|
else if (sectionList[i].IsStartWith("Image"))
|
|
|
{
|
|
|
- // 加载图片配置
|
|
|
+ // 锟斤拷锟斤拷图片锟斤拷锟斤拷
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CImgPlayConfig curImg;
|
|
|
ZeroMemory(&curImg, sizeof(CImgPlayConfig));
|
|
@@ -238,10 +238,10 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
Dbg("config.strRootPath: %s", curVideo.strRootPath);
|
|
|
|
|
|
CSimpleStringA strRunTime_S, strRunTime_E;
|
|
|
- // 加载通用配置
|
|
|
+ // 锟斤拷锟斤拷通锟斤拷锟斤拷锟斤拷
|
|
|
table.AddEntryString("General", "VideoRunTime_Start", strRunTime_S, "");
|
|
|
table.AddEntryString("General", "VideoRunTime_End", strRunTime_E, "");
|
|
|
- // 加载视频配置
|
|
|
+ // 锟斤拷锟斤拷锟斤拷频锟斤拷锟斤拷
|
|
|
table.AddEntryBoolean(sectionList[i].GetData(), "FullScreen", curVideo.bFullScreen, false);
|
|
|
table.AddEntryBoolean(sectionList[i].GetData(), "PrimMonitor", curVideo.bPrimMonitor, false);
|
|
|
table.AddEntryBoolean(sectionList[i].GetData(), "SimpleMode", curVideo.bSimpleMode, true);
|
|
@@ -253,7 +253,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
else
|
|
|
Dbg("Fail to LoadWmpConfig!");
|
|
|
|
|
|
- // 音量配置 add by ly at 2017/06/06
|
|
|
+ // 锟斤拷锟斤拷锟斤拷锟斤拷 add by ly at 2017/06/06
|
|
|
curVideo.nVolume = 50;
|
|
|
Error = GetFunction()->OpenConfig(Config_Run, tempConfig);
|
|
|
if (Error == Error_Succeed)
|
|
@@ -309,7 +309,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
table.AddEntryInt(sectionList[i], "PlayCount", curAudio.nPlayCnt, 0);
|
|
|
table.AddEntryInt(sectionList[i], "PlayInterval", curAudio.nPlayInterval, 0);
|
|
|
|
|
|
- // 音量配置
|
|
|
+ // 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
auto audioRet = GetLocalAudioVolume();
|
|
|
if (audioRet.first)
|
|
|
curAudio.nVolume = audioRet.second;
|
|
@@ -502,9 +502,9 @@ ErrorCodeEnum CLocalMediaPlayEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
//setMediaPath();
|
|
|
loadDefaultMedia();
|
|
|
|
|
|
- // 订阅IEBrowser重启事件
|
|
|
+ // 锟斤拷锟斤拷IEBrowser锟斤拷锟斤拷锟铰硷拷
|
|
|
GetFunction()->SubscribeLog(m_SubIDIEIdle, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_IEBROWSER_IDLE, NULL, false);
|
|
|
- // 实例化播放对象
|
|
|
+ // 实锟斤拷锟斤拷锟斤拷锟脚讹拷锟斤拷
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
m_scanThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& qryMedia, this, 0, NULL);
|
|
@@ -550,9 +550,9 @@ ErrorCodeEnum CLocalMediaPlayEntity::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
delete m_pMediaAudioPlayer; m_pMediaAudioPlayer = NULL;
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
- // 退订返回主页事件
|
|
|
+ // 锟剿讹拷锟斤拷锟斤拷锟斤拷页锟铰硷拷
|
|
|
GetFunction()->UnsubscribeLog(m_SubIDIEIdle);
|
|
|
- // 释放播放对象
|
|
|
+ // 锟酵放诧拷锟脚讹拷锟斤拷
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
@@ -640,7 +640,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
config.nVolume = entity->m_defaultVolum;
|
|
|
}
|
|
|
Dbg("config.nVolume=%d while play local video.", config.nVolume);
|
|
|
- // 判断当前时间是否允许播放
|
|
|
+ // 锟叫断碉拷前时锟斤拷锟角凤拷锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
SYSTEMTIME st;
|
|
|
GetLocalTime(&st);
|
|
|
TCHAR strNow[TIME_LEN];
|
|
@@ -658,7 +658,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
}
|
|
|
WaitForSingleObject(playThread, INFINITE);
|
|
|
if (entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play video");
|
|
|
return 0;
|
|
|
}
|
|
@@ -705,7 +705,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
}
|
|
|
WaitForSingleObject(playThread, INFINITE);
|
|
|
if (entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play video");
|
|
|
return 0;
|
|
|
}
|
|
@@ -736,7 +736,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
|
|
|
WaitForSingleObject(playThread, i->playInterval);
|
|
|
if (entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play Image");
|
|
|
return 0;
|
|
|
}
|
|
@@ -784,7 +784,7 @@ int StartMediaPlay(void* param)
|
|
|
config.nVolume = entity->m_defaultVolum;
|
|
|
}
|
|
|
Dbg("config.nVolume=%d while play local video.", config.nVolume);
|
|
|
- // 判断当前时间是否允许播放
|
|
|
+ // 锟叫断碉拷前时锟斤拷锟角凤拷锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
struct tm* ptm = NULL;
|
|
|
time_t t = time(NULL);
|
|
|
ptm = localtime(&t);
|
|
@@ -804,7 +804,7 @@ int StartMediaPlay(void* param)
|
|
|
iRet = 0;
|
|
|
pthread_join(playThreadId, NULL);
|
|
|
if (entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play video");
|
|
|
return iRet;
|
|
|
}
|
|
@@ -849,7 +849,7 @@ int StartMediaPlay(void* param)
|
|
|
}
|
|
|
pthread_join(playThreadId, NULL);
|
|
|
if (entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play video");
|
|
|
return 0;
|
|
|
}
|
|
@@ -887,7 +887,7 @@ int StartMediaPlay(void* param)
|
|
|
pthread_timedjoin_np(playThreadId, NULL, &ts);
|
|
|
|
|
|
if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
- {//停止播放
|
|
|
+ {//停止锟斤拷锟斤拷
|
|
|
Dbg("stop play Image");
|
|
|
return 0;
|
|
|
}
|
|
@@ -940,7 +940,7 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
|
static HANDLE audioPlayThread = NULL;
|
|
|
- if (audioPlayThread)//关闭正在播放的音频
|
|
|
+ if (audioPlayThread)//锟截憋拷锟斤拷锟节诧拷锟脚碉拷锟斤拷频
|
|
|
{
|
|
|
DWORD exitCode = 0;
|
|
|
if (WAIT_TIMEOUT == WaitForSingleObject(audioPlayThread, 50))
|
|
@@ -962,10 +962,10 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
m_lastPlayAudio = pAudioNames;
|
|
|
audioPlayThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& CheckAudioThread, this, 0, NULL);
|
|
|
#else
|
|
|
- static pthread_t audioPlayThreadId = 0;
|
|
|
- if (0 == pthread_kill(audioPlayThreadId, 0)) {
|
|
|
+ //static pthread_t audioPlayThreadId = 0;
|
|
|
+ //if (0 == pthread_kill(audioPlayThreadId, 0)) {
|
|
|
|
|
|
- }
|
|
|
+ //}
|
|
|
|
|
|
Dbg("Begin StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames);
|
|
@@ -1053,11 +1053,11 @@ void CLocalMediaPlayEntity::StopImage(int nCfgInx)
|
|
|
|
|
|
void CLocalMediaPlayEntity::StopAll()
|
|
|
{
|
|
|
- StopAudio(); // 关闭音频
|
|
|
+ StopAudio(); // 锟截憋拷锟斤拷频
|
|
|
for (int i = 0; i < MAX_PLAY_CHANNELS; ++i)
|
|
|
{
|
|
|
- StopVideo(i); // 关闭视频
|
|
|
- StopImage(i); // 关闭图像
|
|
|
+ StopVideo(i); // 锟截憋拷锟斤拷频
|
|
|
+ StopImage(i); // 锟截憋拷图锟斤拷
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1233,8 +1233,30 @@ void CLocalMediaPlaySession::Handle_StartPlayVideo(SpReqAnsContext<PlayService_S
|
|
|
|
|
|
void CLocalMediaPlaySession::Handle_StartPlayAudio(SpReqAnsContext<PlayService_StartPlayAudio_Req, PlayService_StartPlayAudio_Ans>::Pointer ctx)
|
|
|
{
|
|
|
- CSimpleStringA AudioNames = CSimpleStringW2A(ctx->Req.AudioNames);
|
|
|
- Dbg("start play audio, name:%s", AudioNames);
|
|
|
+
|
|
|
+ CSimpleStringA AudioNames;
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ AudioNames = CSimpleStringW2A(ctx->Req.AudioNames);
|
|
|
+#else
|
|
|
+ wchar_t strSrc[MAX_PATH] = {0};
|
|
|
+ wcscpy(strSrc, L"CardIn.mp3");
|
|
|
+ //CSimpleStringW strSrcName(ctx->Req.AudioNames);
|
|
|
+ //Dbg("srclen is %d.", strSrcName.GetLength());
|
|
|
+ //memcpy(strSrc, strSrcName.GetData(), strSrcName.GetLength()*sizeof(wchar_t));
|
|
|
+ setlocale(LC_ALL, "zh_CN.UTF-8");
|
|
|
+ char strbuffer[MAX_PATH] = {0};
|
|
|
+ int iRet=wcstombs(strbuffer, strSrc, MAX_PATH);
|
|
|
+ if (0 >= iRet)
|
|
|
+ {
|
|
|
+ Dbg("wstring to utf8 failed!");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ Dbg("wstring to utf8 is %s.", strbuffer);
|
|
|
+ }
|
|
|
+ AudioNames = strbuffer;
|
|
|
+#endif
|
|
|
+
|
|
|
+ Dbg("start play audio, name:%s", strbuffer);
|
|
|
|
|
|
CSimpleStringA UpdateState = "";
|
|
|
ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UpdateState", UpdateState);
|
|
@@ -1245,7 +1267,8 @@ void CLocalMediaPlaySession::Handle_StartPlayAudio(SpReqAnsContext<PlayService_S
|
|
|
m_pEntity->StopAll();
|
|
|
return;
|
|
|
}
|
|
|
- m_pEntity->StartAudio((LPCTSTR)AudioNames);
|
|
|
+ //m_pEntity->StartAudio((LPCTSTR)AudioNames);
|
|
|
+ m_pEntity->StartAudio(strbuffer);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|