소스 검색

Merge branch '0_0_2_test1' of http://mayun.itc.cmbchina.cn/QD_RemoteBankArea/LR04.02_RVCTerminalPlus into 0_0_2_test1

gifur 4 년 전
부모
커밋
cb99bd0f2b

+ 1 - 1
Module/mod_download/CMakeLists.txt

@@ -52,4 +52,4 @@ if(MSVC)
 	set(MODULE_CONAN_DEP_LIBS ${MODULE_CONAN_DEP_LIBS} ${CONAN_BIN_DIRS} PARENT_SCOPE)
 else()
 	set(MODULE_CONAN_DEP_LIBS ${MODULE_CONAN_DEP_LIBS} ${CONAN_LIB_DIRS} PARENT_SCOPE)
-endif(MSVC)
+endif(MSVC)

+ 26 - 19
Module/mod_localmediaplay/AdvertManage/MediaManage.cpp

@@ -5,15 +5,22 @@
 #include "SpBase.h"
 
 
-
+#ifdef RVC_OS_WIN
 #define DEFAULT_DOWNLOAD_PATH	"D:/rvc/Downloads/package"
 #define DEFAULT_RESOURSE_PATH	"D:/rvc/addata/Video"
 #define DEFAULT_DOWNLOAD_PATH_C	"C:/rvc/Downloads/package"
 #define DEFAULT_RESOURSE_PATH_C	"C:/rvc/addata/Video"
-#define DEFAULT_HEAD_CONTAIN	"银行"
-#define DEFAULT_FEN_CONTAIN		"分行"
-#define DEFAULT_NETWORK_CONTAIN	"支行"
-#define DEFAULT_NETWORK2_CONTAIN "网点"
+#else
+#define DEFAULT_DOWNLOAD_PATH	"/opt/rvc/Downloads/package"
+#define DEFAULT_RESOURSE_PATH	"/opt/rvc/addata/Video"
+#define DEFAULT_DOWNLOAD_PATH_C	"/opt/rvc/Downloads/package"
+#define DEFAULT_RESOURSE_PATH_C	"/opt/rvc/addata/Video"
+#endif
+
+#define DEFAULT_HEAD_CONTAIN	"锟斤拷锟斤拷"
+#define DEFAULT_FEN_CONTAIN		"锟斤拷锟斤拷"
+#define DEFAULT_NETWORK_CONTAIN	"支锟斤拷"
+#define DEFAULT_NETWORK2_CONTAIN "锟斤拷锟斤拷"
 
 
 mediaManage::mediaManage()
@@ -70,10 +77,10 @@ void mediaManage::GetPlayListByLocal(vector<ResourceParse>& resourceList)
 bool mediaManage::InitResourseList(vector<string> resourceList)
 {
 	/*
-	(1)原resourseList不存在,初始化资
-	(2)原resourseList存在,删除失效资源,添加新资
+	锟斤拷1锟斤拷原resourseList锟斤拷锟斤拷锟节o拷锟斤拷始锟斤拷锟斤拷
+	锟斤拷2锟斤拷原resourseList锟斤拷锟节o拷删锟斤拷失效锟斤拷源锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
 	
-	求差集
+	锟斤拷罴�
 	*/
 	vector<string> needDelete(10), needAdd(10);
 	set<string> oldResourceList, newResourseList;
@@ -84,9 +91,9 @@ bool mediaManage::InitResourseList(vector<string> resourceList)
 		newResourseList.insert(*i);
 
 	auto deletePos = set_difference(oldResourceList.begin(), oldResourceList.end(), newResourseList.begin(), newResourseList.end(), needDelete.begin());//need to delete
-	needDelete.resize(deletePos - needDelete.begin());//重新确定needDelete大
+	needDelete.resize(deletePos - needDelete.begin());//锟斤拷锟斤拷确锟斤拷needDelete锟斤拷
 	auto addPos = set_difference(newResourseList.begin(), newResourseList.end(), oldResourceList.begin(), oldResourceList.end(), needAdd.begin());//need to add
-	needAdd.resize(addPos - needAdd.begin());//重新确定needAdd大
+	needAdd.resize(addPos - needAdd.begin());//锟斤拷锟斤拷确锟斤拷needAdd锟斤拷
 
 	DeleteResourceList(needDelete);
 	AddResourceList(needAdd);
@@ -112,12 +119,12 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		wstring wfileName, wdirPath;
 		StringToWstring(wfileName, fileName);
 		StringToWstring(wdirPath, dirPath);
-		//(1)已解压;(2)压缩文件不存在;(3)解压失败
+		//(1)锟窖斤拷压锟斤拷锟斤拷2锟斤拷压锟斤拷锟侥硷拷锟斤拷锟斤拷锟节o拷锟斤拷3锟斤拷锟斤拷压失锟斤拷
 
 		if (!checkFileExist(dirPath))
 		{
 			Dbg("dir %s not exist!", dirPath.c_str());
-			continue;//压缩文件夹不存在
+			continue;//压锟斤拷锟侥硷拷锟叫诧拷锟斤拷锟斤拷
 		}
 /*
 		if (!checkFileExist(dirPath) && createDir(dirPath) && !Unzip2Folder((BSTR)wfileName.c_str(), (BSTR)wdirPath.c_str()))
@@ -130,21 +137,21 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		if (!findVaildConfig(dirPath, configPath))
 		{
 			Dbg("can not find config file in %s//%s", dirPath.c_str(), configPath.c_str());
-			continue;//配置文件不存在
+			continue;//锟斤拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷
 		}
 
 		vector<ResourceParse> mediaList;
 		if (!parseResourceIni(configPath.c_str(), mediaList))
 		{
 			Dbg("parse config %s fail!", configPath.c_str());
-			continue;//配置文件读取失败
+			continue;//锟斤拷锟斤拷锟侥硷拷锟斤拷取失锟斤拷
 		}
 
 		string resourcePath = dirPath + SPLIT_SLASH_STR;
 /*		if (!getUniqueDir(dirPath, resourcePath))
 		{
 			Dbg("error:find multi resource dir!");
-			continue;//未找到唯一得广告目录
+			continue;//未锟揭碉拷唯一锟矫癸拷锟侥柯�
 		}
 		resourcePath = dirPath + "\\" + resourcePath + "\\";
 		*/
@@ -208,7 +215,7 @@ void mediaManage::InitResourceListByLocal()
 
 	std::stable_sort(m_localList.begin(), m_localList.end(), [](const ResourceParse& a, const ResourceParse& b) {
 		return a.priority > b.priority;
-		});//按priority排序
+		});//锟斤拷priority锟斤拷锟斤拷
 
 
 	for (auto i = m_localList.begin(); i != m_localList.end(); i++)
@@ -226,7 +233,7 @@ void mediaManage::InitResourceListByLocal()
 }
 
 void mediaManage::DeleteResourceList(vector<string> resourceList)
-{//不删除文件夹中文件,防止占用问题,定期清理
+{//锟斤拷删锟斤拷锟侥硷拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟斤拷止占锟斤拷锟斤拷锟解,锟斤拷锟斤拷锟斤拷锟斤拷
 	if (0 == resourceList.size())
 		return;
 
@@ -236,7 +243,7 @@ void mediaManage::DeleteResourceList(vector<string> resourceList)
 		{
 			if (*i == j->m_resourceName)
 			{
-				m_curParse.erase(j);//迭代器失效
+				m_curParse.erase(j);//锟斤拷锟斤拷锟斤拷失效
 				break;
 			}
 		}
@@ -292,7 +299,7 @@ void mediaManage::clearOutdataResource()
 		}
 
 		auto deletePos = set_difference(oldResourceList.begin(), oldResourceList.end(), newResourseList.begin(), newResourseList.end(), needDelete.begin());//need to delete
-		needDelete.resize(deletePos - needDelete.begin());//重新确定needDelete大
+		needDelete.resize(deletePos - needDelete.begin());//锟斤拷锟斤拷确锟斤拷needDelete锟斤拷
 
 
 		for (vector<string>::iterator i = needDelete.begin(); i != needDelete.end(); i++)

+ 51 - 28
Module/mod_localmediaplay/mod_localmediaplay.cpp

@@ -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);
 }
 

+ 17 - 17
Other/libmediaplayer/CMakeLists.txt

@@ -23,25 +23,17 @@ add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
 
 if(WIN32)
 conan_cmake_run(REQUIRES ffmpeg/4.1@LR04.02_ThirdParty/testing
+SDL2/2.0.9@LR04.02_ThirdParty/testing	
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
-conan_cmake_run(REQUIRES ffmpeg/4.1@LR04.02_ThirdParty/testing
+conan_cmake_run(REQUIRES ffmpeg/4.1@LR04.02_ThirdParty/dynamic
+SDL2/2.0.12@LR04.02_ThirdParty/dynamic
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)
 
 
-if(WIN32)
-conan_cmake_run(REQUIRES SDL2/2.0.9@LR04.02_ThirdParty/testing
-BASIC_SETUP CMAKE_TARGETS
-BUILD missing)
-else(WIN32)
-conan_cmake_run(REQUIRES SDL2/2.0.9@LR04.02_ThirdParty/testing
-BASIC_SETUP CMAKE_TARGETS
-BUILD missing)
-endif(WIN32)
-
 target_include_directories(${MODULE_NAME} PRIVATE
 	${RVC_COMMON_INCLUDE_DIR}
 	${CONAN_INCLUDE_DIRS_FFMPEG}
@@ -55,9 +47,17 @@ target_link_directories(${MODULE_NAME} PRIVATE
 	)
 
 
+message(STATUS "CONAN_LIBS_FFMPEG== ${CONAN_LIBS_FFMPEG}")
+message(STATUS "CONAN_INCLUDE_DIRS_FFMPEG== ${CONAN_INCLUDE_DIRS_FFMPEG}")
+message(STATUS "CONAN_PKG_LIBS_FFMPEG== ${CONAN_PKG_LIBS_FFMPEG}")
+message(STATUS "CONAN_LIBS_SDL2 == ${CONAN_LIBS_SDL2}")
+
 target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS} PRIVATE
 	${CONAN_LIBS_FFMPEG}
 	${CONAN_LIBS_SDL2}
+	dl
+	m
+	pthread
 	)  
 
 target_compile_definitions(${MODULE_NAME} PUBLIC "LIBMEDIAPLAYER_EXPORTS")
@@ -78,9 +78,9 @@ install(TARGETS ${MODULE_NAME}
     COMPONENT libraries)
 endif(MSVC)
 
-# 设置要依赖拷贝的第三方库
-if(MSVC)
-set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_BIN_DIRS} PARENT_SCOPE)
-else()
-set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_LIB_DIRS} PARENT_SCOPE)
-ENDIF(MSVC)
+# 锟斤拷锟斤拷要锟斤拷锟斤拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟斤拷锟斤拷
+#if(MSVC)
+#set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_BIN_DIRS} PARENT_SCOPE)
+#else()
+#set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_LIB_DIRS} PARENT_SCOPE)
+#ENDIF(MSVC)

+ 2 - 2
Other/libmediaplayer/frame.cpp

@@ -11,11 +11,11 @@ int frame_queue_init(frame_queue_t *f, packet_queue_t *pktq, int max_size, int k
     int i;
     memset(f, 0, sizeof(frame_queue_t));
     if (!(f->mutex = SDL_CreateMutex())) {
-        av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
+        //av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
         return AVERROR(ENOMEM);
     }
     if (!(f->cond = SDL_CreateCond())) {
-        av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError());
+        //av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError());
         return AVERROR(ENOMEM);
     }
     f->pktq = pktq;

+ 23 - 23
Other/libmediaplayer/idatastruct.h

@@ -29,40 +29,40 @@
 enum PlayModeEnum
 {
 	UNKNOWN = -1,                               // 未知
-	SINGLE,                                     // 
-	SALESRECORD,                                // 客户经理
-	LOCALAUDIO,                                 // 本地音
-	LOCALVIDEO,                                 // 本地视
-	THRIDSALESRECORD							// 3.0客户经理双录
+	SINGLE,                                     // 锟斤拷
+	SALESRECORD,                                // 锟酵伙拷锟斤拷锟斤拷
+	LOCALAUDIO,                                 // 锟斤拷锟斤拷锟斤拷
+	LOCALVIDEO,                                 // 锟斤拷锟斤拷锟斤拷
+	THRIDSALESRECORD							// 3.0锟酵伙拷锟斤拷锟斤拷双录
 };
 
 struct CMediaPlayConfig
 {
-	char strVideoRunTime_S[TIME_LEN];			// 每天允许视频播放的起始时间
-	char strVideoRunTime_E[TIME_LEN];			// 每天允许视频播放的终止时间
+	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]; // 文件名数组
+	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;								// 音量
+	int nVolume;								// 锟斤拷锟斤拷
 };
 
 
 struct RVC_NO_VTABLE CMediaHostApi
 {
-	virtual int LoadPlayConfig(CMediaPlayConfig& config, int CfgInx) = 0;
+	virtual int LoadPlayConfig(CMediaPlayConfig& config, int CfgInx = 0) = 0;
 	virtual void Debug(const char* fmt, ...) = 0;
 };
 

+ 23 - 2
Other/libmediaplayer/libmediaplayer.cpp

@@ -7,6 +7,7 @@ class libmediaplayer_impl
 private:
 	CMediaHostApi* m_pHostApi;
 	CMediaPlayer* m_Player;
+	CMediaPlayConfig m_stPlayConfig;
 
 public:
 
@@ -20,6 +21,7 @@ public:
 		else{
 			pHostApi->Debug(" new MediaPlayer failed!");
 		}
+		memset(&m_stPlayConfig, 0, sizeof(CMediaPlayConfig));
 	}
 
 	~libmediaplayer_impl()
@@ -59,19 +61,33 @@ public:
 
 	void StartPlayLocalAudio(const char* pAudioNames)
 	{
+		m_pHostApi->Debug("StartPlayLocalAudio %s.", pAudioNames);
 		play_media_callback_t cb;
 		cb.cb_play_media_finished = &__cb_play_finished;
 		cb.user_data = this;
 
+		m_stPlayConfig.eMode = LOCALAUDIO;
+		m_pHostApi->LoadPlayConfig(m_stPlayConfig);
+		m_pHostApi->Debug("audio root path is %s.", m_stPlayConfig.strRootPath);
+		char strAudioName[MAX_PATH] = {0};
+		snprintf(strAudioName, MAX_PATH, "%s%s", m_stPlayConfig.strRootPath, pAudioNames);
+		m_pHostApi->Debug("audio full path is %s.", strAudioName);
+
 		rvc_media_player_param_t t_param;
-		t_param.p_input_file = (char*)pAudioNames;
+		t_param.p_input_file = strAudioName;
 		t_param.cb = &cb;
-		t_param.eType = eVideo_Type;
+		t_param.eType = eAudio_Type;
 
 		if (0 == m_Player->Init(&t_param))
 		{
+			m_pHostApi->Debug("Player Init success!");
 			m_Player->StartMediaPlay();
 		}
+		else
+		{
+			m_pHostApi->Debug("Player Init failed!");
+		}
+		
 	}
 
 	void StartPlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight)
@@ -131,6 +147,10 @@ public:
 		m_pHostApi->Debug("PlayMediaFinished!");
 	}
 
+	CMediaHostApi* GetHostApi()
+	{
+		return m_pHostApi;
+	}
 };
 
 
@@ -155,6 +175,7 @@ void Clibmediaplayer::PlayVideo(const char* pVideoDir, const char* pNamePrefix,
 
 void Clibmediaplayer::PlayLocalAudio(const char* pAudioNames)
 {
+	m_pImpl->GetHostApi()->Debug("Clibmediaplayer StartPlayLocalAudio");
 	m_pImpl->StartPlayLocalAudio(pAudioNames);
 }
 

+ 4 - 5
Other/libmediaplayer/player.cpp

@@ -209,7 +209,7 @@ CMediaPlayer::CMediaPlayer(CMediaHostApi* pHostApi, const char* picon_path)
 	m_player_stat = NULL;
 	m_uvolume = SDL_MIX_MAXVOLUME;
 	m_bplaying = false;
-	m_piconpath = rvc_strdup(picon_path);
+	m_piconpath = av_strdup(picon_path);
 	if (NULL != m_hostapi){
 		m_hostapi->Debug("new CMediaPlayer success!");
 	}
@@ -232,6 +232,8 @@ CMediaPlayer::~CMediaPlayer()
 
 int CMediaPlayer::Init(rvc_media_player_param_t* pMedia_Player)
 {
+	m_hostapi->Debug("Init()");
+
 	int iRet = -1;
 	if (NULL == pMedia_Player){
 		return iRet;
@@ -246,9 +248,6 @@ int CMediaPlayer::Init(rvc_media_player_param_t* pMedia_Player)
 		m_hostapi->Debug("player_stat_t struct malloc failed!");
 		return iRet;
 	}
-	else {
-		m_hostapi->Debug("player_stat_t struct malloc success!");
-	}
 
 	m_player_stat->filename = av_strdup(pMedia_Player->p_input_file);
 	m_player_stat->rvc_hostapi = m_hostapi;
@@ -301,7 +300,7 @@ int CMediaPlayer::Init(rvc_media_player_param_t* pMedia_Player)
 
 	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER))
 	{
-		m_hostapi->Debug("Could not initialize SDL - %s\n", SDL_GetError());
+		m_hostapi->Debug("Could not initialize SDL - %s", SDL_GetError());
 		m_hostapi->Debug("(Did you set the DISPLAY variable?)");
 	}
 	else {

+ 1 - 2
Other/libmediaplayer/player.h

@@ -18,6 +18,7 @@ extern "C"
 #include <libavutil/frame.h>
 #include <libavutil/time.h>
 #include <libavutil/imgutils.h>
+#include <libavutil/mem.h>
 
 #if defined(_WIN32)
 #include <SDL.h>
@@ -234,6 +235,4 @@ private:
 };
 
 
-
-
 #endif

+ 5 - 2
Other/libpictureplayer/CMakeLists.txt

@@ -16,7 +16,7 @@ conan_cmake_run(REQUIRES SDL2/2.0.9@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
-conan_cmake_run(REQUIRES SDL2/2.0.9@LR04.02_ThirdParty/testing
+conan_cmake_run(REQUIRES SDL2/2.0.12@LR04.02_ThirdParty/dynamic
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)
@@ -36,6 +36,9 @@ target_link_directories(${MODULE_NAME} PRIVATE
 
 target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS}	PRIVATE
 	${CONAN_LIBS_SDL2}
+	dl
+	m
+	pthread
 	)  
 
 
@@ -57,7 +60,7 @@ install(TARGETS ${MODULE_NAME}
 endif(MSVC)
 
 
-# 设置要依赖拷贝的第三方库
+# 锟斤拷锟斤拷要锟斤拷锟斤拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟斤拷锟斤拷
 if(MSVC)
 set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_BIN_DIRS} PARENT_SCOPE)
 else()