|
@@ -789,10 +789,7 @@ void CLocalMediaPlayEntity::MediaPlayFinished(int iMediaType)
|
|
|
//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play audio %s success.", ret.AudioNames.GetData());
|
|
|
if (false == m_buserstopaudio) {
|
|
|
SpSendBroadcast(GetFunction(), eMsg_AudioPlayRet, eMsgSig_AudioPlayRet, ret);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("SpSendBroadcast AudioPlayRet and audio name is %s.", ret.AudioNames.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("user stop, not broadcast!");
|
|
|
+ //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("SpSendBroadcast AudioPlayRet and audio name is %s.", ret.AudioNames.GetData());
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
@@ -832,7 +829,10 @@ int CLocalMediaPlayEntity::PlayingAudioDataCallback(audio_param_t* param, const
|
|
|
if (0 != m_iPlayType && m_bStartRecord) {
|
|
|
if (false == m_bloged) {
|
|
|
m_bloged = true;
|
|
|
- LogWarn(Severity_Low, Error_Debug, LOG_EVT_PLAYING_AUDIO_INFOS, CSimpleStringA::Format("audio param target (%d channels, %d Hz, channel_layout(%d), frame_size(%d), bytes_per_sec(%d), audio format(%d)).", param->channels, param->freq, param->channel_layout, param->frame_size, param->bytes_per_sec, param->fmt).GetData());
|
|
|
+ if (8000 != param->freq || 1 != param->channels) {
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_PLAYING_AUDIO_INFOS, CSimpleStringA::Format("audio param target (%d channels, %d Hz, channel_layout(%d), frame_size(%d), bytes_per_sec(%d), audio format(%d)).", param->channels, param->freq, param->channel_layout, param->frame_size, param->bytes_per_sec, param->fmt).GetData());
|
|
|
+ }
|
|
|
+
|
|
|
if (!IsSupportAudioSamprate(param->freq)) {
|
|
|
LogWarn(Severity_Middle, Error_Debug, LOG_EVT_NOTSUPPORT_AUDIOFORMAT, CSimpleStringA::Format("not support audio param (%d channels, %d Hz, channel_layout(%d), frame_size(%d), bytes_per_sec(%d), audio format(%d)).", param->channels, param->freq, param->channel_layout, param->frame_size, param->bytes_per_sec, param->fmt).GetData());
|
|
|
}
|
|
@@ -1234,9 +1234,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::HandleRemoteRecord(const char* pszMessage)
|
|
|
DWORD WINAPI StartAudioPlayingThreadFunc(LPVOID param)
|
|
|
{
|
|
|
CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Enter StartAudioPlayingThreadFunc");
|
|
|
const char* pAudioNames = entity->m_lastPlayAudio.c_str();
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Begin StartAudio, and Audio Info is %s.", pAudioNames);
|
|
|
if (0 == entity->m_iPlayType) {
|
|
|
HANDLE playEndEvent = NULL;
|
|
|
entity->m_pAudioPlayer->PlayLocalAudio(pAudioNames);
|
|
@@ -1268,7 +1266,6 @@ DWORD WINAPI StartAudioPlayingThreadFunc(LPVOID param)
|
|
|
DWORD WINAPI NoticePlayThread(LPVOID param)
|
|
|
{
|
|
|
CLocalMediaPlayEntity *entity = (CLocalMediaPlayEntity*)param;
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Begin NoticePlayThread");
|
|
|
|
|
|
HANDLE playEndEvent = NULL;
|
|
|
if (!entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playEndEvent)){
|
|
@@ -1305,8 +1302,6 @@ DWORD WINAPI NoticePlayThread(LPVOID param)
|
|
|
|
|
|
entity->m_lastPlayVideo.clear();
|
|
|
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("End NoticePlayThread");
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -1317,8 +1312,6 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
|
|
|
static bool blog = true;
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter Windows Media Play Thread.");
|
|
|
-
|
|
|
while (entity->GetPlayFlag())
|
|
|
{
|
|
|
vector<ResourceParse> curParse;
|
|
@@ -1394,7 +1387,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
if (!entity->GetLocalVideoVolume(0, config.nVolume)){
|
|
|
config.nVolume = entity->m_defaultVolum;
|
|
|
}
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("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;
|
|
@@ -1416,9 +1409,6 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend [Media] %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
|
|
|
- }
|
|
|
entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (!entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread)){
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Get Play End Event Failed!");
|
|
@@ -1453,9 +1443,6 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend [Media] %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
|
|
|
- }
|
|
|
entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (!entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread)){
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Image Media Thread Failed!");
|
|
@@ -1489,8 +1476,6 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
if (entity->m_playThread) {
|
|
|
entity->m_playThread = NULL;
|
|
|
}
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Exit Windows Media Play Thread.");
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1502,7 +1487,6 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
|
|
|
if (NULL == param){
|
|
|
return iRet;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter FFmpeg Media Play Function.");
|
|
|
|
|
|
CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
|
|
|
static bool blog = true;
|
|
@@ -1589,10 +1573,6 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
|
|
|
if (!CheckFileExist(config.strRootPath, config.strFileNames[0], blog)) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend [Media%d] %c:%s, %s", i, item.type, item.resourcePath.c_str(), item.videoNames.c_str());
|
|
|
- }
|
|
|
|
|
|
int iPlayRet = entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (-3 == iPlayRet) {
|
|
@@ -1624,9 +1604,6 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
|
|
|
}
|
|
|
|
|
|
if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop()){
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend [Media%d] %c:%s, %s", i, item.type, item.resourcePath.c_str(), item.videoNames.c_str());
|
|
|
- }
|
|
|
entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (!entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId)) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Image Media Thread Failed!");
|
|
@@ -1636,7 +1613,7 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
|
|
|
|
|
|
WaitForSingleObject(playThreadId, INFINITE);
|
|
|
if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop()){//停止播放
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop play video");
|
|
|
+
|
|
|
}
|
|
|
else{
|
|
|
entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->Close();
|
|
@@ -1645,14 +1622,12 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
|
|
|
}
|
|
|
}
|
|
|
unsigned int uend_time = y2k_time_now();
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("uend_time - ustart_time = %u.", uend_time - ustart_time);
|
|
|
if (uend_time - ustart_time < RVC_MIN_LOCALPLAYER_TIME) {
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIAPLAY_COST_TIME_ERROR, "广告播放时长不足1秒");
|
|
|
break;
|
|
|
}
|
|
|
blog = false;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave Media Play Function.");
|
|
|
|
|
|
if (entity->m_badplayflag) {
|
|
|
entity->m_badplayflag = false;
|
|
@@ -1685,8 +1660,6 @@ void* StartMediaPlayFunc(void* param)
|
|
|
return (void*)&iRet;
|
|
|
}
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter FFmpeg Media Play Function.");
|
|
|
-
|
|
|
CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
|
|
|
static bool blog = true;
|
|
|
while (entity->GetPlayFlag())
|
|
@@ -1781,9 +1754,6 @@ void* StartMediaPlayFunc(void* param)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend %c:%s, %s", item.type, item.strResourcePath, item.strvideoNames);
|
|
|
- }
|
|
|
int iPlayRet = entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (-3 == iPlayRet) {
|
|
|
struct timespec ts;
|
|
@@ -1818,9 +1788,6 @@ void* StartMediaPlayFunc(void* param)
|
|
|
}
|
|
|
|
|
|
if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop()) {
|
|
|
- if (blog) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend %c:%s, %s", item.type, item.strResourcePath, item.strvideoNames);
|
|
|
- }
|
|
|
entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
if (!entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId)) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Image Media Thread Failed!");
|
|
@@ -1848,8 +1815,6 @@ void* StartMediaPlayFunc(void* param)
|
|
|
}
|
|
|
|
|
|
entity->m_uMediaPlayThreadId = 0;
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave FFmpeg Media Play Function.");
|
|
|
|
|
|
return (void*)&iRet;
|
|
|
}
|
|
@@ -1914,7 +1879,6 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (0 == m_iPlayType) {
|
|
|
if (NULL != m_playThread) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Current is playing video, close it.");
|
|
|
StopVideo(nCfgInx);
|
|
|
}
|
|
|
|
|
@@ -1926,7 +1890,6 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
|
|
|
}
|
|
|
else {
|
|
|
if (NULL != m_uMediaPlayThreadId) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Current is playing video, close it.");
|
|
|
StopVideo(nCfgInx);
|
|
|
}
|
|
|
m_hStopMediaPlayEvent = CreateEventA(NULL, false, false, NULL);
|
|
@@ -1975,7 +1938,6 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (0 == m_iPlayType) {
|
|
|
if (!m_pAudioPlayer->checkIsStop()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current is playing, close it.");
|
|
|
StopAudio();
|
|
|
}
|
|
|
m_lastPlayAudio = pAudioNames;
|
|
@@ -1987,7 +1949,6 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
else
|
|
|
{
|
|
|
if (m_pMediaAudioPlayer->checkIsPlay()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current is playing, close it.");
|
|
|
StopAudio();
|
|
|
}
|
|
|
m_lastPlayAudio = pAudioNames;
|
|
@@ -1995,16 +1956,11 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
m_buserstopaudio = false;
|
|
|
auto audioRet = GetLocalAudioVolume();
|
|
|
m_pMediaAudioPlayer->SetVolume(audioRet.second);
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to set audio volume %d!", audioRet.second);
|
|
|
}
|
|
|
#else
|
|
|
if (m_pMediaAudioPlayer->checkIsPlay()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current is playing, close it.");
|
|
|
StopAudio();
|
|
|
}
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current is not playing, start paly audio %s.", pAudioNames);
|
|
|
- }
|
|
|
|
|
|
m_lastPlayAudio = pAudioNames;
|
|
|
|
|
@@ -2061,7 +2017,6 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
|
|
|
SetEvent(m_hStopMediaPlayEvent);
|
|
|
WaitForSingleObject(m_playThread, INFINITE);
|
|
|
m_playThread = NULL;
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Succeed to StopVideo!");
|
|
|
CloseHandle(m_hStopMediaPlayEvent);
|
|
|
}
|
|
|
}
|
|
@@ -2072,7 +2027,6 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
|
|
|
SetEvent(m_hStopMediaPlayEvent);
|
|
|
WaitForSingleObject(m_uMediaPlayThreadId, INFINITE);
|
|
|
m_uMediaPlayThreadId = NULL;
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Succeed to StopVideo!");
|
|
|
CloseHandle(m_hStopMediaPlayEvent);
|
|
|
}
|
|
|
}
|
|
@@ -2103,7 +2057,6 @@ void CLocalMediaPlayEntity::StopAudio()
|
|
|
m_buserstopaudio = true;
|
|
|
WaitForSingleObject(m_uAudioPlayThreadId, INFINITE);
|
|
|
m_uAudioPlayThreadId = NULL;
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Succeed to StopAudio!");
|
|
|
}
|
|
|
#else
|
|
|
if (0 != m_uAudioPlayThreadId) {
|
|
@@ -2289,12 +2242,10 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartMediaPlayerNotice(int nCfgInx, int nWn
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (false == m_pAudioPlayer->checkIsStop()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("audio current is playing, close it.");
|
|
|
StopAudio();
|
|
|
}
|
|
|
|
|
|
if (false == m_pVideoPlayer[nCfgInx]->checkIsStop()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("notice current is playing, close it.");
|
|
|
StopNotice(nCfgInx);
|
|
|
}
|
|
|
#endif // RVC_OS_WI
|
|
@@ -2382,12 +2333,10 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartFFPlayerNotice(int nCfgInx, int nWndX,
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
|
|
|
if (m_pMediaAudioPlayer->checkIsPlay()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("audio current is playing, close it.");
|
|
|
StopAudio();
|
|
|
}
|
|
|
|
|
|
if (m_pMediaPlayer[nCfgInx]->checkIsPlay()) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("notice current is playing, close it.");
|
|
|
StopNotice(nCfgInx);
|
|
|
}
|
|
|
|
|
@@ -2554,7 +2503,6 @@ void CLocalMediaPlaySession::Handle_StartPlayAudio(SpReqAnsContext<PlayService_S
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
CSimpleStringA AudioNames = CSimpleStringW2A(ctx->Req.AudioNames);
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start play audio, name:%s", AudioNames.GetData());
|
|
|
|
|
|
CSimpleStringA UpdateState = "";
|
|
|
ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UpdateState", UpdateState);
|