|
@@ -1,6 +1,7 @@
|
|
|
#include "stdafx.h"
|
|
|
#include "mod_localmediaplay.h"
|
|
|
#include "LocalMediaPlay_msg_g.h"
|
|
|
+#include "fileutil.h"
|
|
|
|
|
|
#define DEFAULT_SLEEP_TIME (60 * 1000)
|
|
|
#define DEFAULT_ADVERT_TYPE 'A'
|
|
@@ -8,14 +9,15 @@ bool IS_DEBUG = false;
|
|
|
int scanTime = 600;
|
|
|
int removeOldTime = 1800;
|
|
|
|
|
|
-DWORD WINAPI clearOutdata(LPVOID lpv)
|
|
|
-{
|
|
|
- CLocalMediaPlayEntity* curEntity = (CLocalMediaPlayEntity*)lpv;
|
|
|
- Sleep(removeOldTime * 1000);
|
|
|
- curEntity->m_mediaManage.clearOutdataResource();
|
|
|
- return 0;
|
|
|
-}
|
|
|
+//DWORD WINAPI clearOutdata(LPVOID lpv)
|
|
|
+//{
|
|
|
+// CLocalMediaPlayEntity* curEntity = (CLocalMediaPlayEntity*)lpv;
|
|
|
+// Sleep(removeOldTime * 1000);
|
|
|
+// curEntity->m_mediaManage.clearOutdataResource();
|
|
|
+// return 0;
|
|
|
+//}
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
DWORD WINAPI qryMedia(LPVOID lpv)
|
|
|
{
|
|
|
CLocalMediaPlayEntity* curEntity = (CLocalMediaPlayEntity*)lpv;
|
|
@@ -28,58 +30,44 @@ DWORD WINAPI qryMedia(LPVOID lpv)
|
|
|
Sleep(3600 * 1000);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- while(true)
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+void* queryMedia(void* param)
|
|
|
+{
|
|
|
+ CLocalMediaPlayEntity* curEntity = (CLocalMediaPlayEntity*)param;
|
|
|
+ Sleep(3000);
|
|
|
+
|
|
|
+ while (true)
|
|
|
{
|
|
|
- if (!curEntity->SecureClientConnect())
|
|
|
- {
|
|
|
- Dbg("fail to connect to RvcResourceSyncEntity");
|
|
|
- Sleep(DEFAULT_SLEEP_TIME);
|
|
|
- continue;
|
|
|
- }
|
|
|
- //connect success
|
|
|
- //curEntity->m_connection->QryVaildAdvertList();
|
|
|
- CSystemStaticInfo si;
|
|
|
- curEntity->GetFunction()->GetSystemStaticInfo(si);
|
|
|
-
|
|
|
- vector<ResourceListRet> vaidResourceList;
|
|
|
- if (Error_Succeed == curEntity->m_connection->QryVaildAdvertList(si.strTerminalID.GetData(), DEFAULT_ADVERT_TYPE, vaidResourceList))
|
|
|
- {//获取有效的资源列表vaidResourceList
|
|
|
- vector<string> curList;
|
|
|
- for (vector<ResourceListRet>::iterator i = vaidResourceList.begin(); i != vaidResourceList.end(); i++)
|
|
|
- curList.push_back(i->ResourceName);
|
|
|
- curEntity->m_mediaManage.InitResourseList(curList);
|
|
|
- //CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&clearOutdata, curEntity, 0, NULL)); //获取成功的情况下进行清理过期资源
|
|
|
- if (IS_DEBUG)
|
|
|
- {
|
|
|
- curEntity->StartAudio("CardIn.mp3");
|
|
|
- //curEntity->StartVideo(1, 0, 0, 480, 360);
|
|
|
-// Sleep(10000);
|
|
|
-// curEntity->StopVideo(1);
|
|
|
- }
|
|
|
- Sleep(scanTime * 1000);
|
|
|
- }
|
|
|
- else
|
|
|
- Sleep(DEFAULT_SLEEP_TIME); //失败的情况下,等待短时间,重新尝试连接和获取
|
|
|
- curEntity->SecureClientRelease();
|
|
|
-
|
|
|
+ curEntity->m_mediaManage.InitResourceListByLocal();
|
|
|
+ Sleep(3600 * 1000);
|
|
|
}
|
|
|
- */
|
|
|
- return 0;
|
|
|
}
|
|
|
+#endif // RVC_OS_WIN
|
|
|
|
|
|
|
|
|
CLocalMediaPlayEntity::CLocalMediaPlayEntity()
|
|
|
- : m_id_seq(0), m_pAudioPlayer(NULL), m_scanThread(NULL), m_connection(NULL)
|
|
|
+ : m_id_seq(0), m_connection(NULL)
|
|
|
{
|
|
|
//stopForDebug();
|
|
|
-
|
|
|
m_defaultVolum = 50;
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ m_scanThread=NULL;
|
|
|
+ m_pAudioPlayer = NULL;
|
|
|
memset(m_pVideoPlayer, 0, sizeof(m_pVideoPlayer));
|
|
|
memset(m_pImagePlayer, 0, sizeof(m_pImagePlayer));
|
|
|
+#else
|
|
|
+ //add by clp 20201103
|
|
|
+ m_scanThreadId = 0;
|
|
|
+ m_pMediaAudioPlayer = NULL;
|
|
|
+ memset(m_pMediaPlayer, 0, sizeof(m_pMediaPlayer));
|
|
|
+ memset(m_pPicturePlayer, 0, sizeof(m_pPicturePlayer));
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
ZeroMemory(&m_mediaParam, sizeof(MediaPlayParam));
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
CLocalMediaPlayEntity::~CLocalMediaPlayEntity()
|
|
@@ -87,12 +75,18 @@ CLocalMediaPlayEntity::~CLocalMediaPlayEntity()
|
|
|
SecureClientRelease();
|
|
|
|
|
|
DWORD exitCode = 0;
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
if (m_scanThread)
|
|
|
{
|
|
|
TerminateThread(m_scanThread, exitCode);
|
|
|
m_scanThread = NULL;
|
|
|
}
|
|
|
-
|
|
|
+#else
|
|
|
+ if (0 == pthread_kill(m_scanThreadId, 0))
|
|
|
+ {
|
|
|
+ pthread_cancel(m_scanThreadId);
|
|
|
+ }
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
|
|
|
void CLocalMediaPlayEntity::SecureClientRelease()
|
|
@@ -134,30 +128,17 @@ CServerSessionBase* CLocalMediaPlayEntity::OnNewSession(const char* pszRemoteEnt
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-BOOL CLocalMediaPlayEntity::LoadPlayConfig(CWmpPlayConfig &config, int CfgInx)
|
|
|
-{
|
|
|
- if (CfgInx >= MAX_PLAY_CHANNELS || CfgInx < 0)
|
|
|
- {
|
|
|
- Dbg("Invalid CfgInx while LoadConfig!");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (config.eMode == LOCALAUDIO && CfgInx < m_defaultAudio.size())
|
|
|
- memcpy(&config, &(m_defaultAudio[CfgInx]), sizeof(CWmpPlayConfig));
|
|
|
- else if (config.eMode == LOCALVIDEO && CfgInx < m_defaultVideo.size())
|
|
|
- memcpy(&config, &(m_defaultVideo[CfgInx]), sizeof(CWmpPlayConfig));
|
|
|
- else
|
|
|
- return FALSE;
|
|
|
- return TRUE;
|
|
|
-}
|
|
|
-
|
|
|
void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_defaultImg.clear();
|
|
|
m_defaultAudio.clear();
|
|
|
m_defaultVideo.clear();
|
|
|
+#else
|
|
|
+ m_defaultPic.clear();
|
|
|
+ m_Audios.clear();
|
|
|
+ m_Videos.clear();
|
|
|
+#endif // RVC_OS_WIN
|
|
|
|
|
|
// 获取本地媒体根目录
|
|
|
CSimpleStringA strRootPath;
|
|
@@ -192,14 +173,19 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
{
|
|
|
removeOldTime = 1800;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else if (sectionList[i].IsStartWith("Image"))
|
|
|
{
|
|
|
- // 加载图片配置
|
|
|
+ // 加载图片配置
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
CImgPlayConfig curImg;
|
|
|
ZeroMemory(&curImg, sizeof(CImgPlayConfig));
|
|
|
- CSimpleStringA imgPath = strRootPath + "\\Image\\";
|
|
|
+#else
|
|
|
+ CPicPlayConfig curImg;
|
|
|
+ ZeroMemory(&curImg, sizeof(CPicPlayConfig));
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+ CSimpleStringA imgPath = strRootPath + SPLIT_SLASH_STR +"Image" + SPLIT_SLASH_STR;
|
|
|
strncpy(curImg.strRootPath, (LPCSTR)imgPath, sizeof(curImg.strRootPath));
|
|
|
Dbg("curSection: %s, config.strRootPath: %s", sectionList[i].GetData(), curImg.strRootPath);
|
|
|
|
|
@@ -231,17 +217,26 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
}
|
|
|
delete[] Tmp; Tmp = NULL;
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_defaultImg.push_back(curImg);
|
|
|
+#else
|
|
|
+ m_defaultPic.push_back(curImg);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
else if (sectionList[i].IsStartWith("Video"))
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
CWmpPlayConfig curVideo;
|
|
|
ZeroMemory(&curVideo, sizeof(CWmpPlayConfig));
|
|
|
- CSimpleStringA videoPath = strRootPath + "\\Video\\";
|
|
|
+#else
|
|
|
+ CMediaPlayConfig curVideo;
|
|
|
+ ZeroMemory(&curVideo, sizeof(CMediaPlayConfig));
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+ CSimpleStringA videoPath = strRootPath + SPLIT_SLASH_STR +"Video" + SPLIT_SLASH_STR;
|
|
|
strcpy(curVideo.strRootPath, (LPCSTR)videoPath);
|
|
|
Dbg("config.strRootPath: %s", curVideo.strRootPath);
|
|
|
|
|
|
-
|
|
|
CSimpleStringA strRunTime_S, strRunTime_E;
|
|
|
// 加载通用配置
|
|
|
table.AddEntryString("General", "VideoRunTime_Start", strRunTime_S, "");
|
|
@@ -290,18 +285,27 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
for (int i = 0; i != FileCount; ++i)
|
|
|
strcpy(curVideo.strFileNames[i], Result[i]);
|
|
|
delete[] Tmp; Tmp = NULL;
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_defaultVideo.push_back(curVideo);
|
|
|
+#else
|
|
|
+ m_Videos.push_back(curVideo);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
else if (sectionList[i].IsStartWith("Audio"))
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
CWmpPlayConfig curAudio;
|
|
|
ZeroMemory(&curAudio, sizeof(CWmpPlayConfig));
|
|
|
- CSimpleStringA audioPath = strRootPath + "\\Audio\\";
|
|
|
+#else
|
|
|
+ CMediaPlayConfig curAudio;
|
|
|
+ ZeroMemory(&curAudio, sizeof(CMediaPlayConfig));
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+ CSimpleStringA audioPath = strRootPath + SPLIT_SLASH_STR +"Audio" + SPLIT_SLASH_STR;
|
|
|
strcpy(curAudio.strRootPath, (LPCSTR)audioPath);
|
|
|
Dbg("config.strRootPath: %s", curAudio.strRootPath);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
table.AddEntryInt(sectionList[i], "PlayCount", curAudio.nPlayCnt, 0);
|
|
|
table.AddEntryInt(sectionList[i], "PlayInterval", curAudio.nPlayInterval, 0);
|
|
|
|
|
@@ -317,14 +321,43 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
|
|
|
else
|
|
|
Dbg("Fail to LoadWmpConfig!");
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_defaultAudio.push_back(curAudio);
|
|
|
+#else
|
|
|
+ m_Audios.push_back(curAudio);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+
|
|
|
+BOOL CLocalMediaPlayEntity::LoadPlayConfig(CWmpPlayConfig& config, int CfgInx)
|
|
|
+{
|
|
|
+ if (CfgInx >= MAX_PLAY_CHANNELS || CfgInx < 0)
|
|
|
+ {
|
|
|
+ Dbg("Invalid CfgInx while LoadConfig!");
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (config.eMode == LOCALAUDIO && CfgInx < m_defaultAudio.size())
|
|
|
+ {
|
|
|
+ memcpy(&config, &(m_defaultAudio[CfgInx]), sizeof(CWmpPlayConfig));
|
|
|
}
|
|
|
+ else if (config.eMode == LOCALVIDEO && CfgInx < m_defaultVideo.size())
|
|
|
+ {
|
|
|
+ memcpy(&config, &(m_defaultVideo[CfgInx]), sizeof(CWmpPlayConfig));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
}
|
|
|
|
|
|
-BOOL CLocalMediaPlayEntity::LoadPlayConfig(CImgPlayConfig &config, int CfgInx)
|
|
|
+BOOL CLocalMediaPlayEntity::LoadPlayConfig(CImgPlayConfig& config, int CfgInx)
|
|
|
{
|
|
|
if (CfgInx >= m_defaultImg.size() || CfgInx < 0)
|
|
|
{
|
|
@@ -337,7 +370,7 @@ BOOL CLocalMediaPlayEntity::LoadPlayConfig(CImgPlayConfig &config, int CfgInx)
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
-void CLocalMediaPlayEntity::WmpDebug(const char *fmt, ...)
|
|
|
+void CLocalMediaPlayEntity::WmpDebug(const char* fmt, ...)
|
|
|
{
|
|
|
va_list arg;
|
|
|
va_start(arg, fmt);
|
|
@@ -345,7 +378,7 @@ void CLocalMediaPlayEntity::WmpDebug(const char *fmt, ...)
|
|
|
va_end(arg);
|
|
|
}
|
|
|
|
|
|
-void CLocalMediaPlayEntity::ImgDebug(const char *fmt, ...)
|
|
|
+void CLocalMediaPlayEntity::ImgDebug(const char* fmt, ...)
|
|
|
{
|
|
|
va_list arg;
|
|
|
va_start(arg, fmt);
|
|
@@ -353,6 +386,64 @@ void CLocalMediaPlayEntity::ImgDebug(const char *fmt, ...)
|
|
|
va_end(arg);
|
|
|
}
|
|
|
|
|
|
+#else
|
|
|
+
|
|
|
+int CLocalMediaPlayEntity::LoadPlayConfig(CMediaPlayConfig& config, int CfgInx)
|
|
|
+{
|
|
|
+ if (CfgInx >= MAX_PLAY_CHANNELS || CfgInx < 0)
|
|
|
+ {
|
|
|
+ Dbg("Invalid CfgInx while LoadConfig!");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (config.eMode == LOCALAUDIO && CfgInx < m_Audios.size())
|
|
|
+ {
|
|
|
+ memcpy(&config, &(m_Audios[CfgInx]), sizeof(CMediaPlayConfig));
|
|
|
+ }
|
|
|
+ else if (config.eMode == LOCALVIDEO && CfgInx < m_Videos.size())
|
|
|
+ {
|
|
|
+ memcpy(&config, &(m_Videos[CfgInx]), sizeof(CMediaPlayConfig));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int CLocalMediaPlayEntity::LoadPlayConfig(CPicPlayConfig& config, int CfgInx)
|
|
|
+{
|
|
|
+ if (CfgInx >= m_defaultPic.size() || CfgInx < 0)
|
|
|
+ {
|
|
|
+ Dbg("Invalid CfgInx while LoadConfig!");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ memcpy(&config, &(m_defaultPic[CfgInx]), sizeof(CPicPlayConfig));
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void CLocalMediaPlayEntity::Debug(const char* fmt, ...)
|
|
|
+{
|
|
|
+ va_list arg;
|
|
|
+ va_start(arg, fmt);
|
|
|
+ vDbg(fmt, arg);
|
|
|
+ va_end(arg);
|
|
|
+}
|
|
|
+
|
|
|
+void CLocalMediaPlayEntity::PicDebug(const char* fmt, ...)
|
|
|
+{
|
|
|
+ va_list arg;
|
|
|
+ va_start(arg, fmt);
|
|
|
+ vDbg(fmt, arg);
|
|
|
+ va_end(arg);
|
|
|
+}
|
|
|
+
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+
|
|
|
void CLocalMediaPlayEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID, const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
|
|
|
const DWORD dwSysError, const DWORD dwUserCode, const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName, const char *pszMessage)
|
|
@@ -367,6 +458,8 @@ void CLocalMediaPlayEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID n
|
|
|
|
|
|
void CLocalMediaPlayEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
{
|
|
|
+ LOG_FUNCTION();
|
|
|
+
|
|
|
ErrorCodeEnum Error = __OnStart(Error_Succeed);
|
|
|
|
|
|
pTransactionContext->SendAnswer(Error);
|
|
@@ -375,12 +468,27 @@ void CLocalMediaPlayEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmar
|
|
|
ErrorCodeEnum CLocalMediaPlayEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ //toolkit_setenv("SDL_AUDIODRIVER", "winmm");
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
for (int i = 0; i != MAX_PLAY_CHANNELS; ++i)
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pVideoPlayer[i] = new Clibwmpplayer(this);
|
|
|
m_pImagePlayer[i] = new Clibimgplayer(this);
|
|
|
+#else
|
|
|
+ m_pMediaPlayer[i] = new Clibmediaplayer(this);
|
|
|
+ m_pPicturePlayer[i] = new Clibpictureplayer(this);
|
|
|
+#endif
|
|
|
}
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pAudioPlayer = new Clibwmpplayer(this);
|
|
|
+#else
|
|
|
+ m_pMediaAudioPlayer = new Clibmediaplayer(this);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
|
|
|
if (!IsRunConfigExist())
|
|
|
{
|
|
@@ -388,18 +496,28 @@ ErrorCodeEnum CLocalMediaPlayEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
SetLocalAudioVolume(50);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//setMediaPath();
|
|
|
loadDefaultMedia();
|
|
|
|
|
|
-
|
|
|
// 订阅IEBrowser重启事件
|
|
|
GetFunction()->SubscribeLog(m_SubIDIEIdle, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_IEBROWSER_IDLE, NULL, false);
|
|
|
// 实例化播放对象
|
|
|
|
|
|
- m_scanThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&qryMedia, this, 0, NULL);
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ m_scanThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& qryMedia, this, 0, NULL);
|
|
|
if (NULL != m_scanThread)
|
|
|
- Dbg("create qryMeia thread success, %d", m_scanThread);
|
|
|
+ Dbg("create qryMeia thread success, %d.", m_scanThread);
|
|
|
+#else
|
|
|
+ int err = pthread_create(&m_scanThreadId, NULL, queryMedia, this);
|
|
|
+ if (0 == err){
|
|
|
+ Dbg("create queryMedia thread success, %d.", m_scanThreadId);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Dbg("create queryMedia thread failed.");
|
|
|
+ }
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
@@ -414,41 +532,80 @@ ErrorCodeEnum CLocalMediaPlayEntity::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
LOG_FUNCTION();
|
|
|
for (int i = 0; i != MAX_PLAY_CHANNELS; ++i)
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
delete m_pVideoPlayer[i]; m_pVideoPlayer[i] = NULL;
|
|
|
delete m_pImagePlayer[i]; m_pImagePlayer[i] = NULL;
|
|
|
+#else
|
|
|
+ delete m_pMediaPlayer[i]; m_pMediaPlayer[i] = NULL;
|
|
|
+ delete m_pPicturePlayer[i]; m_pPicturePlayer[i] = NULL;
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
delete m_pAudioPlayer; m_pAudioPlayer = NULL;
|
|
|
+#else
|
|
|
+ delete m_pMediaAudioPlayer; m_pMediaAudioPlayer = NULL;
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
// 退订返回主页事件
|
|
|
GetFunction()->UnsubscribeLog(m_SubIDIEIdle);
|
|
|
// 释放播放对象
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
DWORD WINAPI CheckAudioThread(LPVOID param)
|
|
|
{
|
|
|
CLocalMediaPlayEntity *entity = (CLocalMediaPlayEntity*)param;
|
|
|
Dbg("Begin CheckAudioThread");
|
|
|
|
|
|
+
|
|
|
HANDLE playThread = NULL;
|
|
|
if (!entity->m_pAudioPlayer->checkIsPlay(playThread))
|
|
|
{
|
|
|
Dbg("Create play audio Media Thread Failed!");
|
|
|
return 0;
|
|
|
}
|
|
|
-
|
|
|
WaitForSingleObject(playThread, INFINITE);
|
|
|
+ entity->m_pAudioPlayer->Close();
|
|
|
+
|
|
|
AudioPlayRet ret;
|
|
|
ret.AudioNames = entity->m_lastPlayAudio.c_str();
|
|
|
+ ret.ret = true;
|
|
|
+ Dbg("stop play audio %s success", ret.AudioNames);
|
|
|
+ SpSendBroadcast(entity->GetFunction(), eMsg_AudioPlayRet, eMsgSig_AudioPlayRet, ret);
|
|
|
|
|
|
- entity->m_pAudioPlayer->Close();
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+void* CheckAudioPlayingThreadFunc(void* param)
|
|
|
+{
|
|
|
+ CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
|
|
|
+ Dbg("Begin CheckAudioPlayingThreadFunc");
|
|
|
+
|
|
|
+ pthread_t playThreadId = 0;
|
|
|
+ if (!entity->m_pMediaAudioPlayer->checkIsPlay(&playThreadId))
|
|
|
+ {
|
|
|
+ Dbg("Create play audio Media Thread Failed!");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ pthread_join(playThreadId, NULL);
|
|
|
+
|
|
|
+ AudioPlayRet ret;
|
|
|
+ ret.AudioNames = entity->m_lastPlayAudio.c_str();
|
|
|
ret.ret = true;
|
|
|
Dbg("stop play audio %s success", ret.AudioNames);
|
|
|
SpSendBroadcast(entity->GetFunction(), eMsg_AudioPlayRet, eMsgSig_AudioPlayRet, ret);
|
|
|
-
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
{
|
|
|
CLocalMediaPlayEntity *entity = (CLocalMediaPlayEntity*)param;
|
|
@@ -484,7 +641,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
SYSTEMTIME st;
|
|
|
GetLocalTime(&st);
|
|
|
TCHAR strNow[TIME_LEN];
|
|
|
- sprintf(strNow, "%02d:%02d:%02d", st.wHour,st.wMinute, st.wSecond);
|
|
|
+ sprintf(strNow, "%02d:%02d:%02d", st.wHour, st.wMinute, st.wSecond);
|
|
|
if (strcmp(strNow, config.strVideoRunTime_S) < 0 || strcmp(strNow, config.strVideoRunTime_E) >= 0)
|
|
|
{
|
|
|
Sleep(10000);
|
|
@@ -536,7 +693,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
strncpy_s(config.strFileNames[0], i->videoNames.c_str(), 256);
|
|
|
strncpy_s(config.strVideoRunTime_S, "09:00:00", sizeof(config.strVideoRunTime_S));
|
|
|
strncpy_s(config.strVideoRunTime_E, "17:30:00", sizeof(config.strVideoRunTime_E));
|
|
|
-
|
|
|
+
|
|
|
entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (!entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread))
|
|
|
{
|
|
@@ -573,6 +730,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
Dbg("Create play Image Media Thread Failed!");
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
WaitForSingleObject(playThread, i->playInterval);
|
|
|
if (entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
{//停止播放
|
|
@@ -584,10 +742,165 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
+#else
|
|
|
+int StartMediaPlay(void* param)
|
|
|
+{
|
|
|
+ int iRet = -1;
|
|
|
+ if (NULL == param)
|
|
|
+ {
|
|
|
+ return iRet;
|
|
|
+ }
|
|
|
+
|
|
|
+ CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
|
|
|
+ while (TRUE)
|
|
|
+ {
|
|
|
+ vector<ResourceParse> curParse;
|
|
|
+ entity->m_mediaManage.GetPlayListByLocal(curParse);
|
|
|
+ if (0 == curParse.size())
|
|
|
+ {
|
|
|
+ int64_t playThreadId = 0;
|
|
|
+ CMediaPlayConfig config;
|
|
|
+ ZeroMemory(&config, sizeof(CMediaPlayConfig));
|
|
|
+ memcpy(&config, &(entity->m_Videos[entity->m_mediaParam.nCfgInx]), sizeof(CMediaPlayConfig));
|
|
|
+ config.nPlayCnt = 1; //can be change
|
|
|
+ config.eMode = LOCALVIDEO;
|
|
|
+ config.nWndX = entity->m_mediaParam.nWndX;
|
|
|
+ config.nWndY = entity->m_mediaParam.nWndY;
|
|
|
+ config.nWndWidth = entity->m_mediaParam.nWndWidth;
|
|
|
+ config.nWndHeight = entity->m_mediaParam.nWndHeight;
|
|
|
+ if (IS_DEBUG)
|
|
|
+ {
|
|
|
+ config.bFullScreen = false;
|
|
|
+ config.bPrimMonitor = true;
|
|
|
+ }
|
|
|
+ // add by ly@2018/07/30
|
|
|
+ if (!entity->GetLocalVideoVolume(0, config.nVolume))
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ TCHAR strNow[TIME_LEN] = {0};
|
|
|
+ sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
|
|
+ if (strcmp(strNow, config.strVideoRunTime_S) < 0 || strcmp(strNow, config.strVideoRunTime_E) >= 0)
|
|
|
+ {
|
|
|
+ Sleep(10000);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
+ if (!entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId))
|
|
|
+ {
|
|
|
+ Dbg("Create play Video Media Thread Failed!");
|
|
|
+ return iRet;
|
|
|
+ }
|
|
|
+ iRet = 0;
|
|
|
+ pthread_join(playThreadId, NULL);
|
|
|
+ if (entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
+ {//停止播放
|
|
|
+ Dbg("stop play video");
|
|
|
+ return iRet;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (vector<ResourceParse>::iterator i = curParse.begin(); i != curParse.end(); i++)
|
|
|
+ {
|
|
|
+ int64_t playThreadId = 0;
|
|
|
+ Dbg("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
|
|
|
+ if ('V' == i->type)
|
|
|
+ {//video
|
|
|
+ CMediaPlayConfig config;
|
|
|
+ ZeroMemory(&config, sizeof(CMediaPlayConfig));
|
|
|
+ config.bFullScreen = IS_DEBUG ? false : i->fullScreen;
|
|
|
+ config.bPrimMonitor = IS_DEBUG ? true : i->primMonitor;
|
|
|
+ config.bSimpleMode = i->simpleMode;
|
|
|
+ config.eMode = LOCALVIDEO;
|
|
|
+ config.nFileCnt = 1;
|
|
|
+ config.nPlayCnt = 1;
|
|
|
+ config.nPlayInterval = i->playInterval;
|
|
|
+ // add by ly@2018/07/30
|
|
|
+ //config.nVolume = IS_DEBUG ? 0 : entity->m_defaultVolum;
|
|
|
+ if (!entity->GetLocalVideoVolume(0, config.nVolume))
|
|
|
+ {
|
|
|
+ config.nVolume = entity->m_defaultVolum;
|
|
|
+ }
|
|
|
+ Dbg("config.nVolume=%d while play local video.", config.nVolume);
|
|
|
+ config.nWndX = entity->m_mediaParam.nWndX;
|
|
|
+ config.nWndY = entity->m_mediaParam.nWndY;
|
|
|
+ config.nWndWidth = entity->m_mediaParam.nWndWidth;
|
|
|
+ config.nWndHeight = entity->m_mediaParam.nWndHeight;
|
|
|
+ strncpy(config.strRootPath, i->resourcePath.c_str(), sizeof(config.strRootPath));
|
|
|
+ strncpy(config.strFileNames[0], i->videoNames.c_str(), 256);
|
|
|
+ strncpy(config.strVideoRunTime_S, "09:00:00", sizeof(config.strVideoRunTime_S));
|
|
|
+ strncpy(config.strVideoRunTime_E, "17:30:00", sizeof(config.strVideoRunTime_E));
|
|
|
+
|
|
|
+ entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
+ if (!entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId))
|
|
|
+ {
|
|
|
+ Dbg("Create play Video Media Thread Failed!");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ pthread_join(playThreadId, NULL);
|
|
|
+ if (entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
+ {//停止播放
|
|
|
+ Dbg("stop play video");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ('P' == i->type)
|
|
|
+ {//play Image
|
|
|
+ CPicPlayConfig config;
|
|
|
+ ZeroMemory(&config, sizeof(CPicPlayConfig));
|
|
|
+ config.bFullScreen = IS_DEBUG ? false : i->fullScreen;
|
|
|
+ config.bPrimMonitor = IS_DEBUG ? true : i->primMonitor;
|
|
|
+ config.nFileCnt = 1;
|
|
|
+ config.nPlayCnt = 1;
|
|
|
+ config.nPlayInterval = i->playInterval;
|
|
|
+ config.nWndX = entity->m_mediaParam.nWndX;
|
|
|
+ config.nWndY = entity->m_mediaParam.nWndY;
|
|
|
+ config.nWndWidth = entity->m_mediaParam.nWndWidth;
|
|
|
+ config.nWndHeight = entity->m_mediaParam.nWndHeight;
|
|
|
+ strncpy(config.strRootPath, i->resourcePath.c_str(), sizeof(config.strRootPath));
|
|
|
+ strncpy(config.strFileNames[0], i->videoNames.c_str(), 256);
|
|
|
+ entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
+ if (!entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId))
|
|
|
+ {
|
|
|
+ Dbg("Create play Image Media Thread Failed!");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ //WaitForSingleObject(playThread, i->playInterval);
|
|
|
+ struct timespec ts;
|
|
|
+ {
|
|
|
+ int rc = clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
+ if (rc)
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ ts.tv_nsec += (i->playInterval * 1000000);
|
|
|
+ pthread_timedjoin_np(playThreadId, NULL, &ts);
|
|
|
+
|
|
|
+ if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
|
|
|
+ {//停止播放
|
|
|
+ Dbg("stop play Image");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->Close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return iRet;
|
|
|
+}
|
|
|
+
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
|
|
|
|
|
|
void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight)
|
|
@@ -604,20 +917,26 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
|
|
|
m_mediaParam.nWndWidth = nWndWidth;
|
|
|
m_mediaParam.nWndHeight = nWndHeight;
|
|
|
|
|
|
+#ifdef RVC_OS_WIN // RVC_OS_WIN
|
|
|
if (NULL != m_playThread)
|
|
|
{
|
|
|
WaitForSingleObject(m_playThread, 5000);
|
|
|
m_playThread = NULL;
|
|
|
}
|
|
|
-
|
|
|
if (NULL == m_playThread)
|
|
|
- m_playThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&MediaPlayThread, this, 0, NULL);
|
|
|
+ m_playThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& MediaPlayThread, this, 0, NULL);
|
|
|
+#else
|
|
|
+
|
|
|
+ StartMediaPlay(this);
|
|
|
+
|
|
|
+
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
static HANDLE audioPlayThread = NULL;
|
|
|
-
|
|
|
if (audioPlayThread)//关闭正在播放的音频
|
|
|
{
|
|
|
DWORD exitCode = 0;
|
|
@@ -629,19 +948,34 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
audioPlayThread = NULL;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ Dbg("Begin StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
m_pAudioPlayer->PlayLocalAudio(pAudioNames);
|
|
|
- Dbg("Succeed to StartAudio!, Audio Info:%s", pAudioNames);
|
|
|
+ Dbg("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
|
|
|
auto audioRet = GetLocalAudioVolume();
|
|
|
m_pAudioPlayer->SetVolume(audioRet.second);
|
|
|
Dbg("Succeed to set audio volume %d!", audioRet.second);
|
|
|
|
|
|
m_lastPlayAudio = pAudioNames;
|
|
|
- audioPlayThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&CheckAudioThread, this, 0, NULL);
|
|
|
-
|
|
|
+ audioPlayThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& CheckAudioThread, this, 0, NULL);
|
|
|
+#else
|
|
|
+ static pthread_t audioPlayThreadId = 0;
|
|
|
+ if (0 == pthread_kill(audioPlayThreadId, 0)) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Dbg("Begin StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
+ m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames);
|
|
|
+ Dbg("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
+
|
|
|
+ auto audioRet = GetLocalAudioVolume();
|
|
|
+ m_pMediaAudioPlayer->SetVolume(audioRet.second);
|
|
|
+ Dbg("Succeed to set audio volume %d!", audioRet.second);
|
|
|
+ m_lastPlayAudio = pAudioNames;
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
|
|
|
void CLocalMediaPlayEntity::StartImage(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight)
|
|
@@ -651,10 +985,17 @@ void CLocalMediaPlayEntity::StartImage(int nCfgInx, int nWndX, int nWndY, int nW
|
|
|
Dbg("Invalid CfgInx while StartImage!");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pImagePlayer[nCfgInx]->Play(nCfgInx, nWndX, nWndY, nWndWidth, nWndHeight);
|
|
|
+#else
|
|
|
+ m_pPicturePlayer[nCfgInx]->Play(nCfgInx, nWndX, nWndY, nWndWidth, nWndHeight);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
Dbg("Succeed to StartImage!");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
|
|
|
{
|
|
|
if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0)
|
|
@@ -662,6 +1003,8 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
|
|
|
Dbg("Invalid CfgInx while StopVideo!");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pVideoPlayer[nCfgInx]->Close();
|
|
|
m_pImagePlayer[nCfgInx]->Close();
|
|
|
if (m_playThread)
|
|
@@ -669,12 +1012,22 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
|
|
|
TerminateThread(m_playThread, -1);
|
|
|
m_playThread = NULL;
|
|
|
}
|
|
|
+#else
|
|
|
+ m_pMediaPlayer[nCfgInx]->Close();
|
|
|
+ m_pPicturePlayer[nCfgInx]->Close();
|
|
|
+
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
Dbg("Succeed to StopVideo!");
|
|
|
}
|
|
|
|
|
|
void CLocalMediaPlayEntity::StopAudio()
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pAudioPlayer->Close();
|
|
|
+#else
|
|
|
+ m_pMediaAudioPlayer->Close();
|
|
|
+#endif
|
|
|
Dbg("Succeed to StopAudio!");
|
|
|
}
|
|
|
|
|
@@ -685,7 +1038,13 @@ void CLocalMediaPlayEntity::StopImage(int nCfgInx)
|
|
|
Dbg("Invalid CfgInx while StopImage!");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pImagePlayer[nCfgInx]->Close();
|
|
|
+#else
|
|
|
+ m_pPicturePlayer[nCfgInx]->Close();
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
Dbg("Succeed to StopImage!");
|
|
|
}
|
|
|
|
|
@@ -743,6 +1102,7 @@ std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
|
|
|
Dbg("fail to get local audio volume!");
|
|
|
return std::make_pair(false, nVolume);
|
|
|
}
|
|
|
+
|
|
|
bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
|
|
|
{
|
|
|
Dbg("set local video audio req.");
|
|
@@ -758,7 +1118,11 @@ bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
Dbg("succeed to set local audio volume with nVolume:%d!", nVolume);
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pAudioPlayer->SetVolume(nVolume);
|
|
|
+#else
|
|
|
+ m_pMediaAudioPlayer->SetVolume(nVolume);
|
|
|
+#endif // RVC_OS_WIN
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -784,7 +1148,11 @@ bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
|
|
|
Dbg("succeed to set local video volume with nCfgInx:%d, nVolume:%d!", nCfgInx, nVolume);
|
|
|
for (int i = 0; i < MAX_PLAY_CHANNELS; ++i)
|
|
|
{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
m_pVideoPlayer[i]->SetVolume(nVolume);
|
|
|
+#else
|
|
|
+ m_pMediaPlayer[i]->SetVolume(nVolume);
|
|
|
+#endif
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -805,11 +1173,22 @@ bool CLocalMediaPlayEntity::IsRunConfigExist()
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA strRuninfoFile;
|
|
|
strRuninfoFile = CSimpleStringA::Format("%s\\runcfg\\%s.ini", (LPCTSTR)strPath, GetEntityName());
|
|
|
WIN32_FIND_DATA findData;
|
|
|
if (FindFirstFileA((LPCTSTR)strRuninfoFile, &findData) != INVALID_HANDLE_VALUE) return true;
|
|
|
return false;
|
|
|
+#else
|
|
|
+ CSimpleStringA strRuninfoFile;
|
|
|
+ strRuninfoFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "%s.ini", (LPCTSTR)strPath, GetEntityName());
|
|
|
+ if (ExistsFileA(strRuninfoFile)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+#endif // RVC_OS_WIN
|
|
|
}
|
|
|
|
|
|
void CLocalMediaPlayEntity::OnSelfTest(EntityTestEnum eTestType, CSmartPointer<ITransactionContext> pTransactionContext)
|