Răsfoiți Sursa

Z991239-1563 #comment other: 解决部分实体windows版编译失败问题

陈礼鹏80274480 4 ani în urmă
părinte
comite
49683b64df

+ 0 - 377
Module/mod_localmediaplay/AdvertManage/BaseFun.cpp

@@ -379,380 +379,3 @@ bool getUniqueDir(string path, string &dirName)
 	}
 	return false;
 }
-
-
-
-UINT GetPrivateProfileIntEx(LPCSTR lpAppName,LPCSTR lpKeyName,INT nDefault,LPCSTR lpFileName)
-{
-	char lpReturnedString[MAX_PATH] = { 0 };
-	DWORD nRet = GetPrivateProfileStringEx(
-		lpAppName,
-		lpKeyName,
-		"",
-		lpReturnedString,
-		sizeof(lpReturnedString),
-		lpFileName
-	);
-
-	if (nRet == 0) {
-		return nDefault;
-	}
-		
-	return atoi(lpReturnedString);
-}
-
-BOOL WritePrivateProfileStringEx(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR lpString,LPCSTR lpFileName)
-{
-	FILE* fp = NULL;
-	static char szLine[RVC_MAX_INI_LEN] = { 0 };
-	static char tmpstr[RVC_MAX_INI_LEN] = { 0 };
-	memset(szLine, 0, sizeof(szLine));
-	memset(tmpstr, 0, sizeof(tmpstr));
-	int rtnval;
-	int i = 0;
-	int secFlag = 0;
-
-	if ((fp = fopen(lpFileName, "rw+")) == NULL){
-		return FALSE;
-	}
-
-	int lineLen = 0;//整行长度      
-	int orgEqualPos = 0;//=号在原行中的位置
-	int equalPos = 0; //=号在去空格后的位置
-	strcpy(tmpstr, "[");
-	strcat(tmpstr, lpAppName);
-	strcat(tmpstr, "]");
-	int endFlag;
-	while (!feof(fp))
-	{
-
-		rtnval = fgetc(fp);
-		if (rtnval == EOF){
-			//最后一行可能无换行符号   	
-			rtnval = '\n';
-			endFlag = 1;
-		}
-		//注释行    
-		if ('#' == rtnval || ';' == rtnval)
-		{
-			fgets(szLine, sizeof(szLine), fp);
-			//reset 
-			i = 0;
-			lineLen = 0;
-			orgEqualPos = 0;
-			equalPos = 0;
-			memset(szLine, 0, sizeof(szLine));
-			continue;
-		}
-		else if ('/' == rtnval)
-		{
-			szLine[i++] = rtnval;
-			lineLen++;
-			if ('/' == (rtnval = fgetc(fp))) //注释行
-			{
-				fgets(szLine, sizeof(szLine), fp);
-				//reset 
-				i = 0;
-				lineLen = 0;
-				orgEqualPos = 0;
-				equalPos = 0;
-				memset(szLine, 0, sizeof(szLine));
-				continue;
-			}
-		}
-
-		if (rtnval != ' ' && rtnval != '\t')
-		{
-			szLine[i++] = rtnval;   //去掉空格和tab后的字符串
-			if (rtnval == '=')
-			{
-				orgEqualPos = lineLen;
-				equalPos = i - 1;
-			}
-
-		}
-
-		lineLen++; //字符
-
-		if (rtnval == '\n'){
-			szLine[--i] = '\0';
-			if (szLine[--i] == '\r')
-				szLine[i--] = '\0';
-
-			if ((equalPos != 0) && (secFlag == 1))
-			{
-				szLine[equalPos] = '\0';
-				if (strcasecmp(szLine, lpKeyName) == 0)
-				{
-					//找到key对应变量
-					int leftPos = ftell(fp);
-					int writePos = leftPos - lineLen + orgEqualPos + 1;
-					fseek(fp, 0, SEEK_END);
-					int leftLen = ftell(fp) - leftPos;
-					char* pLeft = new char[leftLen];
-					fseek(fp, leftPos, SEEK_SET);
-					fread(pLeft, leftLen, 1, fp);
-					fseek(fp, writePos, SEEK_SET);
-					fwrite(lpString, strlen(lpString), 1, fp);
-					fwrite("\n", sizeof(char), 1, fp);
-					fwrite(pLeft, leftLen, 1, fp);
-					delete[]pLeft;
-					pLeft = 0;
-					fclose(fp);
-					return TRUE;
-				}
-			}
-
-			else
-			{
-				if (strcasecmp(tmpstr, szLine) == 0)
-				{
-					//找到section    
-					secFlag = 1;
-				}
-				else if (secFlag == 1 && szLine[0] == '[' && szLine[i] == ']')
-				{//进入下个section了,说明没找到
-					int leftPos = ftell(fp) - lineLen;
-					int writePos = leftPos;
-					fseek(fp, 0, SEEK_END);
-					int leftLen = ftell(fp) - leftPos;
-					char* pLeft = new char[leftLen];
-					fseek(fp, leftPos, SEEK_SET);
-					fread(pLeft, leftLen, 1, fp);
-					fseek(fp, writePos, SEEK_SET);
-					fwrite("\n", sizeof(char), 1, fp);
-					fwrite(lpKeyName, strlen(lpKeyName), 1, fp);
-					fwrite("=", sizeof(char), 1, fp);
-					fwrite(lpString, strlen(lpString), 1, fp);
-					fwrite("\n", sizeof(char), 1, fp);
-					fwrite(pLeft, leftLen, 1, fp);
-					delete[]pLeft;
-					pLeft = 0;
-					fclose(fp);
-					return TRUE;
-				}
-			}
-			//reset 
-			if (endFlag == 1)
-				break;
-			i = 0;
-			lineLen = 0;
-			orgEqualPos = 0;
-			equalPos = 0;
-			memset(szLine, 0, sizeof(szLine));
-		}
-	}
-	//到文件尾了	
-	if (secFlag)
-	{//必须有section
-		fseek(fp, 0, SEEK_END);
-		fwrite("\n", sizeof(char), 1, fp);
-		fwrite(lpKeyName, strlen(lpKeyName), 1, fp);
-		fwrite("=", sizeof(char), 1, fp);
-		fwrite(lpString, strlen(lpString), 1, fp);
-		fwrite("\n", sizeof(char), 1, fp);
-	}
-	fclose(fp);
-	return TRUE;
-}
-
-DWORD GetPrivateProfileStringEx(LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefault, LPSTR lpReturnedString, DWORD nSize, LPCSTR lpFileName)
-{
-	FILE* fp = NULL;
-	static char szLine[RVC_MAX_INI_LEN] = { 0 };
-	static char tmpstr[RVC_MAX_INI_LEN] = { 0 };
-	int rtnval;
-	int i = 0;
-	int secFlag = 0;
-
-	if ((fp = fopen(lpFileName, "r")) == NULL){
-		Dbg("have no such file[%s]", lpFileName);
-		return -1;
-	}
-
-	int equalPos = 0; //=号在去空格后的位置
-	strcpy(tmpstr, "[");
-	strcat(tmpstr, lpAppName);
-	strcat(tmpstr, "]");
-	int endFlag = 0;
-	while (!feof(fp))
-	{
-		rtnval = fgetc(fp);
-		if (rtnval == EOF){
-			//最后一行可能无换行符号     	
-			rtnval = '\n';
-			endFlag = 1;
-		}
-		//注释行    
-		if ('#' == rtnval || ';' == rtnval)
-		{
-			fgets(szLine, sizeof(szLine), fp);
-			//reset 
-			i = 0;
-			equalPos = 0;
-			memset(szLine, 0, sizeof(szLine));
-			continue;
-		}
-		else if ('/' == rtnval)
-		{
-			szLine[i++] = rtnval;
-			if ('/' == (rtnval = fgetc(fp))) //注释行
-			{
-				fgets(szLine, sizeof(szLine), fp);
-				//reset 
-				i = 0;
-				equalPos = 0;
-				memset(szLine, 0, sizeof(szLine));
-				continue;
-			}
-		}
-
-		if (rtnval != ' ' && rtnval != '\t')
-		{
-			szLine[i++] = rtnval;   //去掉空格和tab后的字符串
-			if (rtnval == '=')
-			{
-				equalPos = i - 1;
-			}
-		}
-
-		if (rtnval == '\n'){
-			szLine[--i] = '\0';
-
-			if (szLine[--i] == '\r')
-				szLine[i--] = '\0';
-
-			if ((equalPos != 0) && (secFlag == 1))
-			{
-				szLine[equalPos] = '\0'; //=号变0
-				if (strcasecmp(szLine, lpKeyName) == 0)
-				{
-					//找到key对应变量 
-					strncpy(lpReturnedString, szLine + equalPos + 1, nSize - 1);
-					lpReturnedString[nSize - 1] = '\0';
-					fclose(fp);
-					return 1;
-				}
-			}
-			else
-			{
-				if (strcasecmp(tmpstr, szLine) == 0)
-				{
-					//找到section    
-					secFlag = 1;
-				}
-				else if (secFlag == 1 && szLine[0] == '[' && szLine[i] == ']')
-				{//进入下个section了,说明没找到
-					break;
-				}
-			}
-
-			if (endFlag == 1)
-				break;
-			//reset 
-			i = 0;
-			equalPos = 0;
-			memset(szLine, 0, sizeof(szLine));
-
-		}
-	}
-	fclose(fp);
-	//没找到则用默认
-	strncpy(lpReturnedString, lpDefault, nSize - 1);
-	lpReturnedString[nSize - 1] = '\0';
-
-	return 0;
-}
-
-
-DWORD GetPrivateProfileSectionEx(LPCSTR lpAppName, LPSTR lpReturnedString, DWORD nSize, LPCSTR lpFileName)
-{
-	//由于项目中未使用,暂未实现
-	assert(0);
-	return 0;
-}
-
-
-DWORD GetPrivateProfileSectionNamesEx(LPSTR lpszReturnBuffer, DWORD nSize, LPCSTR lpFileName)
-{
-	FILE* fp = NULL;
-	static char szLine[RVC_MAX_INI_LEN] = { 0 };
-	static char tmpstr[RVC_MAX_INI_LEN] = { 0 };
-	int rPos = 0;
-
-	memset(lpszReturnBuffer, 0, nSize);
-	int rtnval;
-	int i = 0;
-	int endFlag;
-
-	if ((fp = fopen(lpFileName, "r")) == NULL){
-		return -1;
-	}
-
-	while (!feof(fp))
-	{
-		rtnval = fgetc(fp);
-		if (rtnval == EOF){
-			//最后一行可能无换行符号    	
-			rtnval = '\n';
-			endFlag = 1;
-		}
-		//注释行    
-		if ('#' == rtnval || ';' == rtnval)
-		{
-			fgets(szLine, sizeof(szLine), fp);
-			//reset 
-			i = 0;
-			memset(szLine, 0, sizeof(szLine));
-			continue;
-		}
-		else if ('/' == rtnval)
-		{
-			szLine[i++] = rtnval;
-			if ('/' == (rtnval = fgetc(fp))) //注释行
-			{
-				fgets(szLine, sizeof(szLine), fp);
-				//reset 
-				i = 0;
-				memset(szLine, 0, sizeof(szLine));
-				continue;
-			}
-		}
-
-		if (rtnval != ' ' && rtnval != '\t')
-		{
-			szLine[i++] = rtnval;   //去掉空格和tab后的字符串
-
-		}
-
-		if (rtnval == '\n')
-		{
-			szLine[--i] = '\0';
-			if (szLine[--i] == '\r')
-				szLine[i--] = '\0';
-
-			if (szLine[0] == '[' && szLine[i] == ']')
-			{
-				//找到section    
-				for (int j = 1; j < i && rPos < nSize - 1; j++)
-					lpszReturnBuffer[rPos++] = szLine[j];
-				lpszReturnBuffer[rPos++] = '\0';
-				if (rPos >= nSize)
-				{
-					break;
-				}
-			}
-
-			if (endFlag == 1)
-				break;
-
-			//reset 
-			i = 0;
-			memset(szLine, 0, sizeof(szLine));
-
-		}
-	}
-	lpszReturnBuffer[rPos] = '\0';
-	fclose(fp);
-	return 0;
-}

+ 0 - 41
Module/mod_localmediaplay/AdvertManage/BaseFun.h

@@ -21,44 +21,3 @@ void Wchar_tToString(std::string& szDst, wchar_t *wchar);
 void StringToWstring(std::wstring& szDst, std::string str);
 void stopForDebug();
 bool getUniqueDir(string path, string &dirName);//获取路径中唯一的一个文件夹名,失败返回false
-
-
-UINT
-GetPrivateProfileIntEx(
-	LPCSTR lpAppName,
-	LPCSTR lpKeyName,
-	INT nDefault,
-	LPCSTR lpFileName
-);
-
-BOOL
-WritePrivateProfileStringEx(
-	LPCSTR lpAppName,
-	LPCSTR lpKeyName,
-	LPCSTR lpString,
-	LPCSTR lpFileName
-);
-DWORD
-GetPrivateProfileStringEx(
-	LPCSTR lpAppName,
-	LPCSTR lpKeyName,
-	LPCSTR lpDefault,
-	LPSTR lpReturnedString,
-	DWORD nSize,
-	LPCSTR lpFileName
-);
-
-DWORD
-GetPrivateProfileSectionEx(
-	LPCSTR lpAppName,
-	LPSTR lpReturnedString,
-	DWORD nSize,
-	LPCSTR lpFileName
-);
-
-DWORD
-GetPrivateProfileSectionNamesEx(
-	LPSTR lpszReturnBuffer,
-	DWORD nSize,
-	LPCSTR lpFileName
-);

+ 6 - 1
Module/mod_mediacontroller/CMakeLists.txt

@@ -90,6 +90,7 @@ endif(WIN32)
 
 if(WIN32)
 conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
+lib8k/1.0@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
@@ -117,18 +118,22 @@ target_link_directories(${MODULE_NAME} PRIVATE
 	${CONAN_LIB_DIRS_SPEEXDSP}
 	if(WIN32)
 	${CONAN_LIB_DIRS_IPP}
+	${CONAN_LIB_DIRS_APACHE-APR}
+	${CONAN_LIB_DIRS_LIB8K}
 	else
 	${CONAN_LIB_DIRS_APR}
 	endif(WIN32)
 )
 
-
+message(STATUS "CONAN_PKG_LIBS_APACHE-APR = ${CONAN_PKG_LIBS_APACHE-APR}")
 # 添加实体需要依赖的其他共享库(包括系统库)
 if(WIN32)
 set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} 
 	${CONAN_PKG_LIBS_IPP}
 	${CONAN_PKG_LIBS_PORTAUDIO}
 	${CONAN_PKG_LIBS_FFMPEG}
+	${CONAN_PKG_LIBS_APACHE-APR}
+	${CONAN_PKG_LIBS_LIB8K}
 	ws2_32
 	strmiids
 	winmm

+ 6 - 0
Other/libaudioframework/audiomicspk2.h

@@ -7,6 +7,12 @@
 extern "C" {
 #endif
 
+#define AMS_OPT_RECORD		0x01
+#define AMS_OPT_PLAY		0x02
+#define AMS_OPT_RECPLAY		0x03
+#define AMS_OPT_AS_STREAM	0x00
+#define AMS_OPT_AS_ENGINE	0x04
+
 #include "audiostream.h"
 
 typedef struct audiomicspk2_t audiomicspk2_t;

+ 18 - 8
Other/libvideoframework/CMakeLists.txt

@@ -8,23 +8,34 @@ else()
     set(SPBASE_LIB spbase)
 endif(RVC_DEBUG_MODE)
 
+if(MSVC)
+	set(${VIDEONOUSE}_SRCS
+	   videorender.h
+       videoview.h
+       videorender.c
+	   videoview.c
+	)
+else()
+	set(${VIDEONOUSE}_SRCS 
+	)
+endif(MSVC)
 
 if(MSVC)
-	set(${PLATFORM}_SRCS
+	set(${VIDEOPLATFORM}_SRCS
 	   videocap.h
        videoclock.h
        videoplayer.h
-       videorender.h
-       videoview.h
+       #videorender.h
+       #videoview.h
 	   videocap.c
 	   videoclock.c
 	   videoplayer.c
-       videorender.c
-	   videoview.c
+       #videorender.c
+	   #videoview.c
 	   congestion_control/common/platform/windows/mscc.c
 	)
 else()
-	set(${PLATFORM}_SRCS 
+	set(${VIDEOPLATFORM}_SRCS 
 		congestion_control/common/platform/linux/posix.c
 	)
 endif(MSVC)
@@ -133,7 +144,6 @@ set(${MODULE_PREFIX}_SRCS
     congestion_control/common/cf_skiplist.c
     congestion_control/common/cf_stream.c
     congestion_control/common/cf_unwrapper.c
-    #congestion_control/common/platform/windows/mscc.c
     congestion_control/estimator/ack_bitrate_estimator.c
     congestion_control/estimator/aimd_rate_control.c
     congestion_control/estimator/bitrate_controller.c
@@ -191,7 +201,7 @@ set(${MODULE_PREFIX}_SRCS
 	precompile.h
 	precompile.c
 
-	${${PLATFORM}_SRCS}
+	${${VIDEOPLATFORM}_SRCS}
 )
 
 add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})

+ 2 - 3
Other/libvideoframework/precompile.h

@@ -9,7 +9,7 @@
 #endif
 
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 #include <WinSock2.h>
 #define WIN32_LEAN_AND_MEAN
 #include <Mmsystem.h>
@@ -18,7 +18,7 @@
 #include <process.h>
 #else
 
-#endif // _WIN32
+#endif // RVC_OS_WIN
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -38,6 +38,5 @@
 #else
 #ifndef SPBASE_API
 #define SPBASE_API __declspec(dllimport)
-//#pragma comment(lib, "SpBase.lib")
 #endif
 #endif

+ 1 - 3
Other/libvideoframework/videoutil.h

@@ -1,10 +1,8 @@
 #ifndef VIDEOUTIL_H
 #define VIDEOUTIL_H
 
-#ifdef _WIN32
-#else
+
 #include <stdint.h>
-#endif // _WIN32
 
 #ifdef __cplusplus
 extern "C" {