瀏覽代碼

Z991239-1473 #comment other: sipphone sip请求发送部分Linux迁移改造

陈礼鹏80274480 4 年之前
父節點
當前提交
3ee655f96e

+ 53 - 14
Module/mod_sipphone/CMakeLists.txt

@@ -13,10 +13,10 @@ endif(RVC_DEBUG_MODE)
 
 if(MSVC)
     set(STDAFXCPP stdafx.cpp)
-	set(UUIDCPP uuid.cpp)
+	set(VOLUMEKEEPER_SRCS uuid.cpp volumekeeper.h volumekeeper.cpp)
 else()
-	 set(STDAFXCPP )
-	 set(UUIDCPP )
+	set(STDAFXCPP )
+	set(VOLUMEKEEPER_SRCS )
 endif(MSVC)
 
 set(${MODULE_PREFIX}_SRCS
@@ -24,7 +24,6 @@ set(${MODULE_PREFIX}_SRCS
     endpoint.h
     Event.h
     SIPPhone_msg_g.h
-    volumekeeper.h
     SIPPhone_client_g.h
     SIPPhone_def_g.h
     SIPPhone_server_g.h
@@ -33,10 +32,10 @@ set(${MODULE_PREFIX}_SRCS
 	#${STDAFXCPP}
     audio_session.cpp
     endpoint.cpp
-    volumekeeper.cpp
+   
     mod_sipphone.cpp
-    ${UUIDCPP}
     video_session.cpp
+	${VOLUMEKEEPER_SRCS}
 )
 
 set(MOD_VERSION_STRING "0.0.1-dev1")
@@ -87,23 +86,43 @@ BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)
 
+
+if(WIN32)
 conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
-	SpeexDSP/1.2rc3@LR04.02_ThirdParty/testing
-	sofia/1.12.11@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
+else(WIN32)
+conan_cmake_run(REQUIRES apache-apr/1.6.3@LR04.02_ThirdParty/testing
+BASIC_SETUP CMAKE_TARGETS
+BUILD missing)
+endif(WIN32)
+
+
+if(WIN32)
+conan_cmake_run(REQUIRES sofia/1.12.11@LR04.02_ThirdParty/testing
+BASIC_SETUP CMAKE_TARGETS
+BUILD missing)
+else(WIN32)
+conan_cmake_run(REQUIRES sofia/1.13@LR04.02_ThirdParty/testing
+BASIC_SETUP CMAKE_TARGETS
+BUILD missing)
+endif(WIN32)
 
+conan_cmake_run(REQUIRES SpeexDSP/1.2rc3@LR04.02_ThirdParty/testing
+BASIC_SETUP CMAKE_TARGETS
+BUILD missing)
 
-ADD_DEFINITIONS(-DSU_HAVE_STDINT)
-set(DOXYGEN_ONLY 0)
 
 target_include_directories(${MODULE_NAME} PRIVATE
 	${CONAN_INCLUDE_DIRS_PORTAUDIO}
 	${CONAN_INCLUDE_DIRS_FFMPEG}
 	${CONAN_INCLUDE_DIRS_OPENCV}
     ${CONAN_INCLUDE_DIRS_OPENCV}/opencv
-	${CONAN_INCLUDE_DIRS_APACHE-APR}/include
+	
 	${RVC_TOOLKIT_INCLUDE_DIR}
+	if(WIN32)
+	${CONAN_INCLUDE_DIRS_IPP}
+	${CONAN_INCLUDE_DIRS_APACHE-APR}/include
 	${CONAN_INCLUDE_DIRS_SOFIA}/libsofia-sip-ua/su
 	${CONAN_INCLUDE_DIRS_SOFIA}/win32
 	${CONAN_INCLUDE_DIRS_SOFIA}/libsofia-sip-ua/nua
@@ -114,8 +133,9 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${CONAN_INCLUDE_DIRS_SOFIA}/libsofia-sip-ua/nta
 	${CONAN_INCLUDE_DIRS_SOFIA}/libsofia-sip-ua/nea
 	${CONAN_INCLUDE_DIRS_SOFIA}/libsofia-sip-ua/soa
-	if(WIN32)
-	${CONAN_INCLUDE_DIRS_IPP}
+	else
+	${CONAN_INCLUDE_DIRS_APACHE-APR}
+	${CONAN_INCLUDE_DIRS_SOFIA}/sofia-sip-1.13
 	endif(WIN32)
 )
 
@@ -173,6 +193,18 @@ else(WIN32)
 set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} 	
 	${CONAN_PKG_LIBS_FFMPEG}
 	${CONAN_PKG_LIBS_PORTAUDIO}
+	${CONAN_LIBS_OPENCV}
+	${SPBASE_LIB}
+	${TOOLKIT_LIB}
+	#${CONAN_PKG_LIBS_APACHE-APR}
+	${CONAN_PKG_LIBS_SPANDSP}
+	${CONAN_PKG_LIBS_SOFIA}
+	${CONAN_PKG_LIBS_SPEEXDSP}
+	#libaudioframework
+	#libvideoframework
+	audioqueue
+	videoqueue
+	asound
 )
 endif(WIN32)
 
@@ -180,4 +212,11 @@ endif(WIN32)
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
 
 
-deploy_module(${MODULE_PREFIX} ${MODULE_NAME})
+deploy_module(${MODULE_PREFIX} ${MODULE_NAME})
+
+
+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)

+ 37 - 8
Module/mod_sipphone/audio_session.cpp

@@ -517,8 +517,10 @@ static int phonemedia_start(audio_session_t *session)
 		//Dbg("recv hook addr %d,send hook addr %d", &m_on_recv_hook,&m_on_send_hook);
 		audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_HOOK_ARG, media);
 		Dbg("AUDIO_RTP_FLAG_HOOK_ARG addr is %0x.", media);
-		audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_RECV_HOOK, &m_on_recv_hook);
-		audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_SEND_HOOK, &m_on_send_hook);
+		
+		//audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_RECV_HOOK, &m_on_recv_hook);
+		//audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_SEND_HOOK, &m_on_send_hook);
+		
 		//audiortp_set_param(media->rtpstream, AUDIO_RTP_FLAG_HOOK_ARG, media->rtpstream);
 		audiortp_init(media->rtpstream);
 	}
@@ -853,12 +855,13 @@ static void __stdcall __audio_log_func(int level, const char *s)
 
 int audio_lib_init()
 {
+#ifdef RVC_OS_WIN
 	audio_log_set_func(&__audio_log_func);
-
 	int rc = audioframework_init();
 	if (rc != 0) {
 		return Error_Resource;
-	} else {
+	}
+	else {
 		int icnt, ocnt;
 		audio_log_set_func(NULL);
 		rc = audio_get_dev_count(&icnt, &ocnt);
@@ -878,12 +881,38 @@ int audio_lib_init()
 		audio_log_set_func(&__audio_log_func);
 	}
 
+#else
+	Pa_Initialize();
+	//PaUtil_SetDebugPrintFunction(&__PaUtilLogCallback);
+
+	int icnt, ocnt;
+	int rc = audio_get_dev_count(&icnt, &ocnt);
+	if (rc == 0) {
+		int i;
+		Dbg("audio input devices(%d):", icnt);
+		for (i = 0; i < icnt; ++i) {
+			CSimpleStringA str = audio_get_dev_name(true, i);
+			Dbg("%d = %s", i, (LPCSTR)str);
+		}
+		Dbg("audio output devices(%d):", ocnt);
+		for (i = 0; i < ocnt; ++i) {
+			CSimpleStringA str = audio_get_dev_name(false, i);
+			Dbg("%d = %s", i, (LPCSTR)str);
+		}
+	}
+
+#endif // RVC_OS_WIN
+
 	return 0;
 }
 
 void audio_lib_deinit()
 {
+#ifdef RVC_OS_WIN
 	audioframework_term();
+#else
+
+#endif // RVC_OS_WIN
 }
 
 int audio_get_dev_count(int *in_cnt, int *out_cnt)
@@ -906,7 +935,7 @@ int audio_get_dev_count(int *in_cnt, int *out_cnt)
 
 CSimpleStringA audio_get_dev_name(bool in_direction, int idx)
 {
-	audio_log_set_func(NULL);
+	//audio_log_set_func(NULL);
 	int cnt = Pa_GetDeviceCount();
 	int ii, i;
 	for (i = 0, ii = 0; i < cnt; ++i) {
@@ -914,7 +943,7 @@ CSimpleStringA audio_get_dev_name(bool in_direction, int idx)
 		if (in_direction) {
 			if (info->maxInputChannels) {
 				if (idx == ii) {
-					audio_log_set_func(__audio_log_func);
+					//audio_log_set_func(__audio_log_func);
 					return CSimpleStringA(info->name);
 				}
 				ii++;
@@ -922,14 +951,14 @@ CSimpleStringA audio_get_dev_name(bool in_direction, int idx)
 		} else {
 			if (info->maxOutputChannels) {
 				if (idx == ii) {
-					audio_log_set_func(__audio_log_func);
+					//audio_log_set_func(__audio_log_func);
 					return CSimpleStringA(info->name);
 				}
 				ii++;
 			}
 		}
 	}
-	audio_log_set_func(__audio_log_func);
+	//audio_log_set_func(__audio_log_func);
 	return CSimpleStringA();
 }
 

+ 112 - 88
Module/mod_sipphone/endpoint.cpp

@@ -1,4 +1,9 @@
+#ifdef RVC_OS_WIN
 #include "stdafx.h"
+#else
+
+#endif
+
 #include "endpoint.h"
 
 #include <sofia-sip/su.h>
@@ -1120,7 +1125,11 @@ static unsigned int __stdcall __event_thread(void *arg)
 	endpoint_t *ep = (endpoint_t *)arg;
 	ep->entity->GetFunction()->InitLogCurrentThread();
 
+#ifdef RVC_OS_WIN
 	CoInitialize(NULL);
+#else
+
+#endif // RVC_OS_WIN
 
 	ep->root = su_root_create(ep);
 	
@@ -1147,8 +1156,13 @@ static unsigned int __stdcall __event_thread(void *arg)
 	su_root_destroy(ep->root);
 	ep->root = NULL;
 
+
+#ifdef RVC_OS_WIN
 	CoUninitialize();
+#else
 
+#endif // RVC_OS_WIN
+	
 	return 0;
 }
 
@@ -1162,6 +1176,16 @@ static int __endpoint_break(void *arg)
 	return 0;
 }
 
+#ifdef RVC_OS_WIN
+#else
+unsigned long GetTickCount()
+{
+	struct timespec ts;
+	clock_gettime(CLOCK_MONOTONIC, &ts);
+	return (ts.tv_sec * 1000 + ts.tv_nsec / 1000000);
+}
+#endif
+
 static endpoint_t *__endpoint_create(CEntityBase *pEntity, const endpoint_conf_t *conf,int nDev)
 {
 	endpoint_t *ep;
@@ -1396,92 +1420,92 @@ int set_switch_distribute_req_buffer(char* pbuffer, size_t ulen, endpoint_distri
 #define BUFFER_SIZE 256
 #endif
 
-int endpoint_pad_switch_interactive(endpoint_distribute_call_info_t *tinfo)
-{
-	int ret = -1;
-	SOCKET conn = INVALID_SOCKET;
-	struct sockaddr_in addr = {0};
-	int rc = -1;
-	BOOL opt = TRUE;
-	int saccept = -1;
-	BOOL bconnect = FALSE;
-	// try connect to switch server
-	if (NULL== tinfo){
-		return ret;
-	}
-
-	addr.sin_family = AF_INET;
-	addr.sin_port = htons(tinfo->server_port);
-	addr.sin_addr.s_addr = inet_addr(tinfo->server_ip);//strtoul(config->switch_server, NULL, 10);
-
-	conn = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (INVALID_SOCKET == conn){
-		return ret;
-	}
-	rc = setsockopt(conn, IPPROTO_TCP, TCP_NODELAY, (char*)&opt, sizeof(opt));
-	opt = TRUE;
-	if (rc == 0){
-		rc = setsockopt(conn, SOL_SOCKET, SO_DONTLINGER, (char*)&opt, sizeof(opt));
-	}
-
-	if (0 != rc){
-		return ret;
-	}
-
-	int nRet = 0;
-	u_long lRet = 1;
-	nRet = ioctlsocket(conn, FIONBIO, &lRet);
-	if (SOCKET_ERROR == nRet){
-		closesocket(conn);
-		return ret;
-	}    
-
-	saccept = connect(conn, (struct sockaddr*)&addr, sizeof(addr));
-	if (SOCKET_ERROR == saccept){
-		fd_set fdWrite;
-		FD_ZERO(&fdWrite);
-		FD_SET(conn, &fdWrite);
-		timeval time;
-		time.tv_sec = 5;
-		time.tv_usec = 0;
-
-		int nret = select(0, NULL, &fdWrite, NULL, &time);
-		if (SOCKET_ERROR == nret){
-			closesocket(conn);
-			return ret;
-		}
-
-		if (!FD_ISSET(conn, &fdWrite)){
-			closesocket(conn);
-			return ret;
-		}
-		else{
-			bconnect = TRUE;
-		}
-	}
-	else{
-		bconnect = TRUE;
-	}
-
-	if (bconnect){
-		lRet = 0;
-		nRet = ioctlsocket(conn, FIONBIO, &lRet);
-		if (SOCKET_ERROR == nRet){
-			closesocket(conn);
-			return ret;
-		}   
-
-		char req_buffer[BUFFER_SIZE] = {0};
-		int idatalen = set_switch_distribute_req_buffer(req_buffer, BUFFER_SIZE, tinfo);
-		int n = send(conn, req_buffer, idatalen, 0);
-		if (n == idatalen){
-			ret = 0;
-		}
-	}
-	closesocket(conn);
-
-	return ret;
-}
+//int endpoint_pad_switch_interactive(endpoint_distribute_call_info_t *tinfo)
+//{
+//	int ret = -1;
+//	SOCKET conn = INVALID_SOCKET;
+//	struct sockaddr_in addr = {0};
+//	int rc = -1;
+//	BOOL opt = TRUE;
+//	int saccept = -1;
+//	BOOL bconnect = FALSE;
+//	// try connect to switch server
+//	if (NULL== tinfo){
+//		return ret;
+//	}
+//
+//	addr.sin_family = AF_INET;
+//	addr.sin_port = htons(tinfo->server_port);
+//	addr.sin_addr.s_addr = inet_addr(tinfo->server_ip);//strtoul(config->switch_server, NULL, 10);
+//
+//	conn = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+//	if (INVALID_SOCKET == conn){
+//		return ret;
+//	}
+//	rc = setsockopt(conn, IPPROTO_TCP, TCP_NODELAY, (char*)&opt, sizeof(opt));
+//	opt = TRUE;
+//	if (rc == 0){
+//		rc = setsockopt(conn, SOL_SOCKET, SO_DONTLINGER, (char*)&opt, sizeof(opt));
+//	}
+//
+//	if (0 != rc){
+//		return ret;
+//	}
+//
+//	int nRet = 0;
+//	u_long lRet = 1;
+//	nRet = ioctlsocket(conn, FIONBIO, &lRet);
+//	if (SOCKET_ERROR == nRet){
+//		closesocket(conn);
+//		return ret;
+//	}    
+//
+//	saccept = connect(conn, (struct sockaddr*)&addr, sizeof(addr));
+//	if (SOCKET_ERROR == saccept){
+//		fd_set fdWrite;
+//		FD_ZERO(&fdWrite);
+//		FD_SET(conn, &fdWrite);
+//		timeval time;
+//		time.tv_sec = 5;
+//		time.tv_usec = 0;
+//
+//		int nret = select(0, NULL, &fdWrite, NULL, &time);
+//		if (SOCKET_ERROR == nret){
+//			closesocket(conn);
+//			return ret;
+//		}
+//
+//		if (!FD_ISSET(conn, &fdWrite)){
+//			closesocket(conn);
+//			return ret;
+//		}
+//		else{
+//			bconnect = TRUE;
+//		}
+//	}
+//	else{
+//		bconnect = TRUE;
+//	}
+//
+//	if (bconnect){
+//		lRet = 0;
+//		nRet = ioctlsocket(conn, FIONBIO, &lRet);
+//		if (SOCKET_ERROR == nRet){
+//			closesocket(conn);
+//			return ret;
+//		}   
+//
+//		char req_buffer[BUFFER_SIZE] = {0};
+//		int idatalen = set_switch_distribute_req_buffer(req_buffer, BUFFER_SIZE, tinfo);
+//		int n = send(conn, req_buffer, idatalen, 0);
+//		if (n == idatalen){
+//			ret = 0;
+//		}
+//	}
+//	closesocket(conn);
+//
+//	return ret;
+//}
 
 int endpoint_distribute_hangup(endpoint_distribute_call_info_t *tinfo)
 {
@@ -1490,7 +1514,7 @@ int endpoint_distribute_hangup(endpoint_distribute_call_info_t *tinfo)
 		return ret;
 	}
 
-	ret = endpoint_pad_switch_interactive(tinfo);
+	//ret = endpoint_pad_switch_interactive(tinfo);
 	Dbg("endpoint_distribute_hangup call_name=%s,server_ip=%s,server_port=%d.", tinfo->call_name,tinfo->server_ip,tinfo->server_port);
 
 	return ret;
@@ -1748,7 +1772,7 @@ static void __endpoint_call_destroy(endpoint_call_t *call)
 }
 
 
-int translate_ipaddr_from_int(char* strdst, size_t ulen, unsigned long uip)
+int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip)
 {
 	int iret = -1;
 	if (NULL == strdst){

+ 7 - 1
Module/mod_sipphone/endpoint.h

@@ -4,8 +4,14 @@
 #pragma once
 #include "../include/EventCode.h"
 #include "../mod_counterconnector/CallType.h"
+
+#ifdef RVC_OS_WIN
 #include <process.h>
 #include <objbase.h>
+#else
+
+#endif
+
 
 enum e_call_state
 {
@@ -122,6 +128,6 @@ int local_remote_show_video(endpoint_call_t *call,int local_view_x, int local_vi
 
 void Terminatedcall(endpoint_call_t *call);
 int endpoint_distribute_hangup(endpoint_distribute_call_info_t *tinfo);
-int translate_ipaddr_from_int(char* strdst, size_t ulen, unsigned long uip);
+int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip);
 
 #endif // ENDPOINT_H

+ 49 - 9
Module/mod_sipphone/mod_sipphone.cpp

@@ -20,9 +20,9 @@
 #include "Event.h"
 #include "EventCode.h"
 
-#include "../mod_Assistantchannel/AssistantChannel_client_g.h"
+#include "../mod_assistantchannel/AssistantChannel_client_g.h"
 using namespace AssistantChannel;
-#include "../mod_Assistantchannel/chan_protocol.h"
+#include "../mod_assistantchannel/chan_protocol.h"
 
 #include "../mod_selfchecker/SelfChecker_client_g.h"
 #include "../mod_selfchecker/SelfChecker_def_g.h"
@@ -1000,6 +1000,8 @@ public:
 			}
 		}
 
+#ifdef RVC_OS_WIN
+
 		if (m_kept_volume_in[DEV_HANDFREE]) 
 		{
 			m_pKeeperIn[DEV_HANDFREE] = volume_keeper_create(conf.audio_handfree_in_dev, 1, m_kept_volume_in[DEV_HANDFREE]);
@@ -1048,6 +1050,9 @@ public:
 				Dbg("PICKUP out volume keeper create failed!");
 			}
 		}
+#else
+
+#endif // RVC_OS_WIN
 		return Error_Succeed;
 	}
 	
@@ -1209,20 +1214,21 @@ public:
 
 	ErrorCodeEnum GetLocalIP()
 	{
-		char tmp[256];
+#ifdef RVC_OS_WIN
+		char tmp[MAX_PATH] = { 0 };
 		gethostname(tmp, sizeof(tmp));
-		hostent *ent = gethostbyname(tmp);
+		hostent* ent = gethostbyname(tmp);
 		if (ent) {
 			for (int i = 0; ent->h_addr_list[i]; ++i) {
 				if (ent->h_addrtype == AF_INET) {
-					struct in_addr *in = (struct in_addr*)ent->h_addr_list[i];
-					char *p = inet_ntoa(*in);
-					if (p[0] != '0') 
+					struct in_addr* in = (struct in_addr*)ent->h_addr_list[i];
+					char* p = inet_ntoa(*in);
+					if (p[0] != '0')
 					{
-						if(strstr(p,"198.168.") == NULL)
+						if (strstr(p, "198.168.") == NULL)
 						{
 							strcpy(m_localip, p);
-							Dbg("local ip == %s",m_localip);
+							Dbg("local ip == %s", m_localip);
 							return Error_Succeed;
 						}
 					}
@@ -1230,6 +1236,40 @@ public:
 			}
 		}
 		return Error_Unexpect;
+#else
+		ErrorCodeEnum error = Error_Unexpect;
+		int sockfd = -1;
+		struct ifconf ifconf;
+		struct ifreq* ifreq = NULL;
+		char strbuf[MAX_PATH] = {0};
+		ifconf.ifc_len = MAX_PATH;
+		ifconf.ifc_buf = strbuf;
+		if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0){
+			Dbg("socket error");
+			return error;
+		}
+
+		ioctl(sockfd, SIOCGIFCONF, &ifconf); //get all socket info
+		ifreq = (struct ifreq*)ifconf.ifc_buf;
+		for (int i = (ifconf.ifc_len / sizeof(struct ifreq)); i > 0; i--){
+			if (ifreq->ifr_flags == AF_INET) { //for ipv4
+				char* strIP = inet_ntoa(((struct sockaddr_in*) & (ifreq->ifr_addr))->sin_addr);
+				Dbg("name =[%s], local addr = [%s]", ifreq->ifr_name, strIP);
+				ifreq++;
+				if (NULL != strIP){
+					if (NULL == strstr(strIP, "198.168.") && NULL == strstr(strIP, "127.0.0.1"))
+					{
+						strcpy(m_localip, strIP);
+						Dbg("local ip == %s", m_localip);
+						error = Error_Succeed;
+						break;
+					}
+
+				}
+			}
+		}
+		return error;
+#endif // RVC_OS_WIN
 	}
 
 	//send DynamicFps

+ 0 - 74
Module/mod_sipphone/mod_sipphone.vcxproj.filters

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="endpoint.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="SIPPhone_client_g.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="SIPPhone_def_g.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="SIPPhone_server_g.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="video_session.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="audio_session.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="volumekeeper.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Event.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="$(FrameworkHeadRoot)\Common\stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="endpoint.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="mod_sipphone.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="video_session.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="audio_session.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="uuid.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="volumekeeper.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="$(FrameworkHeadRoot)\Common\stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\Version.rc">
-      <Filter>Resource Files</Filter>
-    </ResourceCompile>
-  </ItemGroup>
-</Project>

+ 258 - 130
Module/mod_sipphone/video_session.cpp

@@ -1,5 +1,5 @@
 #include "stdafx.h"
-#include <io.h>
+
 #include "SpBase.h"
 #include "video_session.h"
 #include "../../Other/libvideoframework/videoframework.h"
@@ -14,10 +14,20 @@
 #include "../../Other/libvideoframework/videocap.h"
 #include "../../Other/libvideoframework/videortp.h"
 #include "../../Other/libvideoframework/videoclock.h"
+#include "fileutil.h"
 
+#ifdef RVC_OS_WIN
 #include <ipp.h>
+#include <io.h>
+#include <DbgHelp.h>
+#pragma comment(lib, "dbghelp.lib")
+#else
+
+#endif // RVC_OS_WIN
+
+
 
-#include "../../Other/libvideohorflip/videohorflip.h"
+//#include "../../Other/libvideohorflip/videohorflip.h"
 
 #include "cv.h"
 #include "highgui.h"
@@ -41,15 +51,18 @@ extern "C"
 }
 #include "../../Other/libvideoframework/video_common/ffmpeg_api_cpp_adapter.h"
 
-#include <DbgHelp.h>
-#pragma comment(lib, "dbghelp.lib")
-
 
 BOOL g_bIsSalesRecord = FALSE;
 BOOL g_bEwsRecord = FALSE;    // add by ly@2019/04/18
 
+#ifdef RVC_OS_WIN
 HWND pg_local_hwnd = NULL;					// preview window
 HWND pg_remote_hwnd = NULL;					// remote window
+#else
+
+#endif // RVC_OS_WIN
+
+
 video_session_t* pg_last_session = NULL;	// last used session
 
 #define WNDCLS_NAME	"sipmedia_video"
@@ -68,8 +81,13 @@ video_session_t* pg_last_session = NULL;	// last used session
 
 
 typedef struct picture_record_s{
+#ifdef RVC_OS_WIN
 	HANDLE evt;
 	HANDLE work_thread;
+#else
+
+#endif // RVC_OS_WIN
+
 	video_session_t* session;
 	video_frame* show_frame;
 	video_frame* record_frame;
@@ -93,10 +111,17 @@ struct video_session_t
 	IplImage*personmask;
 	IplImage*recordareaimage;
 	IplImage*recordareamask;
+
+#ifdef RVC_OS_WIN
 	HANDLE ui_thread;
 	HANDLE ui_event;
 	HWND local_hwnd; // preview window
 	HWND remote_hwnd; // remote window
+#else
+
+#endif // RVC_OS_WIN
+
+
 	picture_record_t* pic_record;
 };
 
@@ -316,10 +341,16 @@ static void local_put_frame(void *user_data, video_frame *frame)
 				int offset = (REC_COMMON_VIDEO_RTP_WIDTH - REC_COMMON_VIDEO_RTP_OPT_WIDTH) / 2;
 				unsigned char *dst_data[4] = {tt.data[0], 0, 0, 0};
 				dst_data[0] += offset * 3;
+#ifdef RVC_OS_WIN
 				IppiSize size;
 				size.width = frame->width;
 				size.height = frame->height;
 				ippiCopy_8u_C3R(frame->data[0], frame->linesize[0], tt.data[0] + offset * 3, tt.linesize[0], size);
+#else
+
+#endif // RVC_OS_WIN
+
+
 			}
 			sws_scale(session->local_encode_sws_ctx_opt, tt.data, tt.linesize, 0, tt.height, tmp_frame_encode->data, tmp_frame_encode->linesize);
 			video_frame_free(&tt);
@@ -408,32 +439,37 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 	return used;
 }
 
-int GetCurrentRunPath(char *pPath)
+
+#ifdef RVC_OS_WIN
+int GetCurrentRunPath(char* pPath)
 {
-	char *pBuf = new char[MAX_PATH_SIZE];
+	char* pBuf = new char[MAX_PATH_SIZE];
 	if (pBuf == NULL)
 		return -1;
-	ZeroMemory(pBuf,MAX_PATH_SIZE);
-	GetModuleFileName(NULL,pBuf,MAX_PATH_SIZE);
-	int len = strnlen_s(pBuf,MAX_PATH_SIZE);
+	ZeroMemory(pBuf, MAX_PATH_SIZE);
+	GetModuleFileName(NULL, pBuf, MAX_PATH_SIZE);
+	int len = strnlen_s(pBuf, MAX_PATH_SIZE);
 	if (len <= 0)
 	{
-		delete []pBuf;
+		delete[]pBuf;
 		return -2;
 	}
-	char *pch;
-	pch = strstr (pBuf,"bin");
+	char* pch;
+	pch = strstr(pBuf, "bin");
 	if (pch == NULL)
 		return -3;
-	int lenDel = strnlen_s(pch,MAX_PATH_SIZE);
+	int lenDel = strnlen_s(pch, MAX_PATH_SIZE);
 	if (len <= 0)
 	{
-		delete []pBuf;
+		delete[]pBuf;
 		return -3;
 	}
-	strncpy_s(pPath,MAX_PATH_SIZE,pBuf,len-lenDel);
-	delete []pBuf;   return strnlen_s(pPath,MAX_PATH_SIZE);
+	strncpy_s(pPath, MAX_PATH_SIZE, pBuf, len - lenDel);
+	delete[]pBuf;   return strnlen_s(pPath, MAX_PATH_SIZE);
 }
+#endif // RVC_OS_WIN
+
+
 //远端视频窗口状态回调
 static int on_remoteWinstate(videoplayer_t *player, void *user_data, video_frame **frame)
 {
@@ -494,10 +530,14 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 			video_frame_fill_black(tmp_frame_preview);
 			if (session->video_error == NULL)
 			{
-				char strPath[MAX_PATH_SIZE];
+				char strPath[MAX_PATH_SIZE] = {0};
+#ifdef RVC_OS_WIN
 				GetCurrentRunPath(strPath);
-				sprintf(strPath,"%s\\bin\\looklowerscreen.jpg",strPath);
-				if (_access(strPath,0)!=-1)
+				sprintf(strPath, "%s\\bin\\looklowerscreen.jpg", strPath);
+#else
+
+#endif // RVC_OS_WIN
+				if (ExistsFile(strPath))
 				{
 					IplImage*img = cvLoadImage(strPath,1);
 					if (img != NULL)
@@ -648,7 +688,8 @@ int show_agent_picture_proc(void *arg)
 		Dbg("show_agent_picture_proc param valid.");
 		return -1;
 	}
-	
+
+#ifdef RVC_OS_WIN
 	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
 	
 	for (;;) {
@@ -680,34 +721,37 @@ int show_agent_picture_proc(void *arg)
 			break;
 		}
 	}
+#else
+
+#endif
 
 	return 0;
 }
 
-static void showagentpicdump_exception(PEXCEPTION_POINTERS ExceptionInfo)
-{
-	char tmp[MAX_PATH];
-	HANDLE hDumpFile;
-	sprintf(tmp, ".\\showagnetpic_%d.dmp", GetCurrentProcessId());
-	hDumpFile = CreateFileA( tmp, GENERIC_READ | GENERIC_WRITE, 
-		0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
-	if( ( hDumpFile != NULL ) && ( hDumpFile != INVALID_HANDLE_VALUE ) ) 
-	{
-		MINIDUMP_EXCEPTION_INFORMATION mdei; 
-		MINIDUMP_TYPE mdt;
-
-		mdei.ThreadId           = GetCurrentThreadId(); 
-		mdei.ExceptionPointers  = ExceptionInfo; 
-		mdei.ClientPointers     = FALSE; 
-
-		mdt       = MiniDumpWithFullMemory;
-
-		MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), 
-			hDumpFile, mdt, (ExceptionInfo != 0) ? &mdei : 0, 0, 0 ); 
-
-		CloseHandle( hDumpFile ); 
-	}
-}
+//static void showagentpicdump_exception(PEXCEPTION_POINTERS ExceptionInfo)
+//{
+//	char tmp[MAX_PATH];
+//	HANDLE hDumpFile;
+//	sprintf(tmp, ".\\showagnetpic_%d.dmp", GetCurrentProcessId());
+//	hDumpFile = CreateFileA( tmp, GENERIC_READ | GENERIC_WRITE, 
+//		0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+//	if( ( hDumpFile != NULL ) && ( hDumpFile != INVALID_HANDLE_VALUE ) ) 
+//	{
+//		MINIDUMP_EXCEPTION_INFORMATION mdei; 
+//		MINIDUMP_TYPE mdt;
+//
+//		mdei.ThreadId           = GetCurrentThreadId(); 
+//		mdei.ExceptionPointers  = ExceptionInfo; 
+//		mdei.ClientPointers     = FALSE; 
+//
+//		mdt       = MiniDumpWithFullMemory;
+//
+//		MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), 
+//			hDumpFile, mdt, (ExceptionInfo != 0) ? &mdei : 0, 0, 0 ); 
+//
+//		CloseHandle( hDumpFile ); 
+//	}
+//}
 
 
 //坐席端图像显示线程
@@ -727,15 +771,20 @@ static unsigned int __stdcall agent_picture_show_thread(void *arg)
 static int agent_picture_video_start(picture_record_t* t_record)
 {
 	LOG_FUNCTION();
+#ifdef RVC_OS_WIN
 	t_record->evt = CreateEventA(NULL, FALSE, FALSE, NULL);
 	t_record->work_thread = (HANDLE)_beginthreadex(NULL, 0, &agent_picture_show_thread, t_record, 0, NULL);
+#else
 
+#endif // RVC_OS_WIN
 	return 0;
 }
 
 static int agent_picture_video_stop(picture_record_t* t_record)
 {
 	Dbg("agent picture video stop called, stop static picture show thread.");
+
+#ifdef RVC_OS_WIN
 	if (t_record->evt) {
 		SetEvent(t_record->evt);
 		if (t_record->work_thread) {
@@ -747,6 +796,9 @@ static int agent_picture_video_stop(picture_record_t* t_record)
 		t_record->evt = NULL;
 	}
 
+#else
+
+#endif // RVC_OS_WIN
 	if (t_record->record_frame){
 		video_frame_delete(t_record->record_frame);
 		t_record->record_frame = NULL;
@@ -815,13 +867,17 @@ static void	show_remote_agnet_picture(video_session_t *t_session)
 		irecord_video_frame_heigt = /*REC_COMMON_VIDEO_DSM_AGENT_HEIGHT*/REC_COMMON_VIDEO_SNAPSHOT_PREVIEW_HEIGHT;
 	}
 
+#ifdef RVC_OS_WIN
 	GetCurrentRunPath(strPath);
-	sprintf(strImgPath,"%s\\bin\\agent.jpg",strPath);
+	sprintf(strImgPath, "%s\\bin\\agent.jpg", strPath);
+#else
+
+#endif // RVC_OS_WIN
 
 	video_frame* remote_frame = video_frame_new(irecord_video_frame_width, irecord_video_frame_heigt, VIDEO_FORMAT_RGB24);
 	video_frame_fill_black(remote_frame);
 
-	if (_access(strImgPath,0)!=-1)
+	if (ExistsFile(strImgPath))
 	{
 		IplImage*img = cvLoadImage(strImgPath,1);
 		videoq_frame* vframe = new videoq_frame;
@@ -885,8 +941,9 @@ static void	show_remote_agnet_picture(video_session_t *t_session)
 static int start_video(video_session_t *session)
 {
 	LOG_FUNCTION();
+	int rc = -1;
 
-	int rc;
+#ifdef RVC_OS_WIN
 	if (session->video_shm_q_env) 
 	{
 		session->local_encode_sws_ctx_env = sws_getContext(
@@ -1223,6 +1280,10 @@ static int start_video(video_session_t *session)
 	}
 
 on_error:
+
+#else
+
+#endif // RVC_OS_WIN
 	
 	return rc;
 }
@@ -1230,8 +1291,10 @@ on_error:
 static void stop_video(video_session_t *session)
 {
 	LOG_FUNCTION();
+
+#ifdef RVC_OS_WIN
 	Dbg("stop_video param video_session %0x, session->local_clock is %0x, session->remote_hwnd is %0x.", session, session->local_clock, session->remote_hwnd);
-	if (session->local_clock&&session->remote_hwnd) 
+	if (session->local_clock && session->remote_hwnd)
 	{
 		Dbg("videoclock_stop local_clock addr is %0x", session->local_clock);
 		videoclock_stop(session->local_clock);
@@ -1241,14 +1304,14 @@ static void stop_video(video_session_t *session)
 		pg_local_hwnd = NULL;
 	}
 
-	if (session->rtp/*&&session->remote_hwnd*/) 
+	if (session->rtp/*&&session->remote_hwnd*/)
 	{
 		Dbg("begin stop video rtp.");
 		videortp_stop(session->rtp);
 		videortp_destroy(session->rtp);
 		session->rtp = NULL;
 	}
-	else{
+	else {
 		Dbg("session->rtp == null");
 	}
 
@@ -1258,7 +1321,7 @@ static void stop_video(video_session_t *session)
 		Dbg("local video player destroy.");
 	}
 
-	if (session->remote_player&&session->remote_hwnd)
+	if (session->remote_player && session->remote_hwnd)
 	{
 		videoplayer_destroy(session->remote_player);
 		session->remote_player = NULL;
@@ -1273,8 +1336,13 @@ static void stop_video(video_session_t *session)
 		sws_freeContext(session->local_encode_sws_ctx_opt);
 		session->local_encode_sws_ctx_opt = NULL;
 	}
+#else
+
+
+#endif // RVC_OS_WIN
 }
 
+#ifdef RVC_OS_WIN
 static bool ReMoveOutOfScreenVideoWindow(HWND hWnd, RECT rect)
 {
 	bool bret = false;
@@ -1286,28 +1354,28 @@ static bool ReMoveOutOfScreenVideoWindow(HWND hWnd, RECT rect)
 	int iVideoWidth = rect.right - rect.left;
 	int iVideoHight = rect.bottom - rect.top;
 
-	if (rect.left < 0){
-		if (rect.bottom <= iScreenHight){
+	if (rect.left < 0) {
+		if (rect.bottom <= iScreenHight) {
 			MoveWindow(hWnd, 0, rect.top, iVideoWidth, iVideoHight, TRUE);
-		} 
-		else{
+		}
+		else {
 			MoveWindow(hWnd, 0, iScreenHight - iVideoHight, iVideoWidth, iVideoHight, TRUE);
 		}
 		bret = true;
 	}
 
-	if (rect.right > iScreenWidth){
-		if (rect.bottom <= iScreenHight){
+	if (rect.right > iScreenWidth) {
+		if (rect.bottom <= iScreenHight) {
 			MoveWindow(hWnd, iScreenWidth - iVideoWidth, rect.top, iVideoWidth, iVideoHight, TRUE);
-		} 
-		else{
+		}
+		else {
 			MoveWindow(hWnd, iScreenWidth - iVideoWidth, iScreenHight - iVideoHight, iVideoWidth, iVideoHight, TRUE);
 		}
 		bret = true;
 	}
 
-	if (rect.bottom > iScreenHight){
-		if (rect.left >= 0 && rect.right <= iScreenWidth){
+	if (rect.bottom > iScreenHight) {
+		if (rect.left >= 0 && rect.right <= iScreenWidth) {
 			MoveWindow(hWnd, rect.left, iScreenHight - iVideoHight, iVideoWidth, iVideoHight, TRUE);
 			bret = true;
 		}
@@ -1327,28 +1395,28 @@ static bool ReMoveCenterOtherVideoWindow(HWND hWnd, RECT rect, RECT otherect)
 	int iOtherVideoWidth = otherect.right - otherect.left;
 	int iOtherVideoHight = otherect.bottom - otherect.top;
 
-	if (iVideoWidth > iOtherVideoHight || iVideoHight > iOtherVideoHight){
+	if (iVideoWidth > iOtherVideoHight || iVideoHight > iOtherVideoHight) {
 		return bret;
 	}
 
-	if (rect.left > otherect.left + iVideoWidth && rect.right < otherect.right){
-		if (rect.top > otherect.top && rect.bottom < otherect.bottom){
-			if (otherect.right - rect.right <= rect.left - otherect.left){
+	if (rect.left > otherect.left + iVideoWidth && rect.right < otherect.right) {
+		if (rect.top > otherect.top && rect.bottom < otherect.bottom) {
+			if (otherect.right - rect.right <= rect.left - otherect.left) {
 				MoveWindow(hWnd, otherect.right - iVideoWidth, rect.top, iVideoWidth, iVideoHight, TRUE);
-			} 
-			else{
+			}
+			else {
 				MoveWindow(hWnd, otherect.left, rect.top, iVideoWidth, iVideoHight, TRUE);
 			}
 			bret = true;
 		}
 	}
 
-	if (rect.right < otherect.right - iVideoWidth && rect.left > otherect.left){
-		if (rect.top > otherect.top && rect.bottom < otherect.bottom){
-			if (otherect.right - rect.right <= rect.left - otherect.left){
+	if (rect.right < otherect.right - iVideoWidth && rect.left > otherect.left) {
+		if (rect.top > otherect.top && rect.bottom < otherect.bottom) {
+			if (otherect.right - rect.right <= rect.left - otherect.left) {
 				MoveWindow(hWnd, otherect.right - iVideoWidth, rect.top, iVideoWidth, iVideoHight, TRUE);
-			} 
-			else{
+			}
+			else {
 				MoveWindow(hWnd, otherect.left, rect.top, iVideoWidth, iVideoHight, TRUE);
 			}
 			bret = true;
@@ -1363,7 +1431,7 @@ static bool ReMoveVideoWindow(HWND hWnd, RECT rect, RECT otherect)
 	LOG_FUNCTION();
 
 	bool bret = false;
-	
+
 	bret = ReMoveOutOfScreenVideoWindow(hWnd, rect);
 	bret = ReMoveCenterOtherVideoWindow(hWnd, rect, otherect);
 
@@ -1371,57 +1439,62 @@ static bool ReMoveVideoWindow(HWND hWnd, RECT rect, RECT otherect)
 }
 
 
-static int HandleVideoMoveEvent(int iMessageType, HWND hWnd, video_session_t *pSession)
+static int HandleVideoMoveEvent(int iMessageType, HWND hWnd, video_session_t* pSession)
 {
 	LOG_FUNCTION();
 	int iRet = -1;
-	if (NULL == pSession || NULL == hWnd){
+	if (NULL == pSession || NULL == hWnd) {
 		return iRet;
 	}
 
 	HWND hOtherWnd = NULL;
 	//本地和远端标识 1为本地,2为远端
 	int iVideoType = 2;
-	if (hWnd == pSession->local_hwnd){
+	if (hWnd == pSession->local_hwnd) {
 		iVideoType = 1;
 		hOtherWnd = pSession->remote_hwnd;
 	}
-	else{
+	else {
 		hOtherWnd = pSession->local_hwnd;
 	}
 
-	if (NULL == hOtherWnd){
+	if (NULL == hOtherWnd) {
 		return iRet;
 	}
 
 	bool bMoved = false;
 	RECT rect;
 	GetWindowRect(hWnd, &rect);
-	Dbg("MessageType = %d, VideoType = %d, rect.left = %d, rect.right = %d, rect.bottom = %d, rect.top = %d",iMessageType, iVideoType, rect.left, rect.right, rect.bottom, rect.top);
-	
+	Dbg("MessageType = %d, VideoType = %d, rect.left = %d, rect.right = %d, rect.bottom = %d, rect.top = %d", iMessageType, iVideoType, rect.left, rect.right, rect.bottom, rect.top);
+
 	RECT otherect;
 	GetWindowRect(hOtherWnd, &otherect);
 	Dbg("other video Window left = %d, right = %d, bottom = %d, top = %d", otherect.left, otherect.right, otherect.bottom, otherect.top);
 
 	bMoved = ReMoveVideoWindow(hWnd, rect, otherect);
-	
-	if (bMoved){
+
+	if (bMoved) {
 		Dbg("has removed video window.");
 		GetWindowRect(hWnd, &rect);
 	}
-	
-	if (NULL != pSession->conf.video_echo_cb && NULL != pSession->conf.video_echo_cb->on_video_box_move){
+
+	if (NULL != pSession->conf.video_echo_cb && NULL != pSession->conf.video_echo_cb->on_video_box_move) {
 		pSession->conf.video_echo_cb->on_video_box_move(iMessageType, iVideoType, rect.left, rect.bottom, pSession->conf.video_echo_cb->user_data);
 		iRet = 0;
 	}
-	
+
 	return iRet;
 }
 
+#else
+
+#endif // RVC_OS_WIN
+
 
+#ifdef RVC_OS_WIN
 static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
-	video_session_t *session = (video_session_t*)GetWindowLongPtrA(hWnd, GWLP_USERDATA);
+	video_session_t* session = (video_session_t*)GetWindowLongPtrA(hWnd, GWLP_USERDATA);
 
 	switch (msg) {
 	case WM_DESTROY:
@@ -1429,7 +1502,8 @@ static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 		if (session->local_hwnd == hWnd) {
 			Dbg("session->local_hwnd = 0");
 			session->local_hwnd = 0;
-		} else if (session->remote_hwnd == hWnd) {
+		}
+		else if (session->remote_hwnd == hWnd) {
 			Dbg("session->remote_hwnd = 0");
 			session->remote_hwnd = 0;
 		}
@@ -1439,10 +1513,10 @@ static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 		}
 		return 0;
 	case WM_NCHITTEST:
-		if (((session->local_hwnd == hWnd)&&(0 != session->conf.local_move)) || ((session->remote_hwnd == hWnd)&&(0 != session->conf.remote_move))){
+		if (((session->local_hwnd == hWnd) && (0 != session->conf.local_move)) || ((session->remote_hwnd == hWnd) && (0 != session->conf.remote_move))) {
 			return HTCAPTION;
 		}
-		else{
+		else {
 			break;
 		}
 	case WM_ACTIVATE:
@@ -1452,17 +1526,18 @@ static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 		return 0;
 #if 1
 	case WM_WINDOWPOSCHANGED:
-		{
-			LPWINDOWPOS pPos = (LPWINDOWPOS)lParam;
-			if (pPos->hwndInsertAfter != HWND_TOPMOST && pPos->hwndInsertAfter != HWND_TOP) {
-				//BringWindowToTop(hWnd);
-				SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
-			} else {
-				return DefWindowProc(hWnd, msg, wParam, lParam);
-			}
+	{
+		LPWINDOWPOS pPos = (LPWINDOWPOS)lParam;
+		if (pPos->hwndInsertAfter != HWND_TOPMOST && pPos->hwndInsertAfter != HWND_TOP) {
+			//BringWindowToTop(hWnd);
+			SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
 		}
-		return 0;
-		//return DefWindowProc(hWnd, msg, wParam, lParam);
+		else {
+			return DefWindowProc(hWnd, msg, wParam, lParam);
+		}
+	}
+	return 0;
+	//return DefWindowProc(hWnd, msg, wParam, lParam);
 #endif
 	case WM_MBUTTONDOWN:
 	case WM_MBUTTONUP:
@@ -1490,29 +1565,34 @@ static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 		break;
 
 	case WM_ENTERSIZEMOVE:
-		{
-			Dbg("***WM_ENTERSIZEMOVE***");
-			HandleVideoMoveEvent(0, hWnd, session);
-		}
-		break;
+	{
+		Dbg("***WM_ENTERSIZEMOVE***");
+		HandleVideoMoveEvent(0, hWnd, session);
+	}
+	break;
 
 	case WM_EXITSIZEMOVE:
-		{
-			Dbg("***WM_EXITSIZEMOVE***");
-			HandleVideoMoveEvent(1, hWnd, session);
-		}
-		break;
+	{
+		Dbg("***WM_EXITSIZEMOVE***");
+		HandleVideoMoveEvent(1, hWnd, session);
+	}
+	break;
 
 	default:
 		return DefWindowProc(hWnd, msg, wParam, lParam);
 	}
 }
 
+#endif // 
+
+
 static unsigned int __stdcall ui_proc(void *arg)
 {
 	video_session_t *session = (video_session_t*)arg;
 	Dbg("ui_proc session addr is %0x", session);
 
+#ifdef RVC_OS_WIN
+
 	WNDCLASSA wc = {0};
 	ATOM a = 0;
 	HWND hWnd = NULL;
@@ -1651,6 +1731,10 @@ static unsigned int __stdcall ui_proc(void *arg)
 
 	CoUninitialize();
 
+#else
+
+#endif // RVC_OS_WIN
+
 	return 0;
 }
 
@@ -1658,6 +1742,8 @@ static int start_ui(video_session_t *session)
 {
 	LOG_FUNCTION();
 	Dbg("start ui session addr is 0x%8x", session);
+
+#ifdef RVC_OS_WIN
 	session->ui_event = CreateEventA(NULL, FALSE, FALSE, NULL);
 	if (!session->ui_event) {
 		Dbg("phonemedia_start create ui event failed!");
@@ -1696,6 +1782,9 @@ static int start_ui(video_session_t *session)
 			return Error_Resource;
 		}
 	}
+#else
+
+#endif // RVC_OS_WIN
 	return 0;
 }
 
@@ -1703,8 +1792,10 @@ static void stop_ui(video_session_t *session)
 {
 	LOG_FUNCTION();
 	Dbg("stop ui session addr is %0x.", session);
-	if (DOUBLERECORD_CALLTYPE == session->conf.nCallType){
-		if (NULL != pg_last_session){
+
+#ifdef RVC_OS_WIN
+	if (DOUBLERECORD_CALLTYPE == session->conf.nCallType) {
+		if (NULL != pg_last_session) {
 			pg_last_session->rtp = session->rtp;
 			pg_last_session->local_clock = session->local_clock;
 
@@ -1714,10 +1805,10 @@ static void stop_ui(video_session_t *session)
 			session->ui_event = NULL;
 			session = pg_last_session;
 		}
-	}
+}
 
-	if (NULL != session->pic_record){
-		if (NULL != session->pic_record->work_thread){
+	if (NULL != session->pic_record) {
+		if (NULL != session->pic_record->work_thread) {
 			SetEvent(session->pic_record->evt);
 
 			Dbg("CloseHandle pic_record ui_thread %0x", session->pic_record->work_thread);
@@ -1732,11 +1823,11 @@ static void stop_ui(video_session_t *session)
 
 	if (session->local_hwnd) {
 		Dbg("PostMessageA WM_CLOSE session addr is %0x, session->local_hwnd = %0x", session, session->local_hwnd);
-		
+
 		BOOL bRet = PostMessageA(session->local_hwnd, WM_CLOSE, 0, 0);
 		Dbg("WaitForSingleObject session addr is %8x, and session->ui_thread is %8x.", session, session->ui_thread);
 		DWORD dCode = WaitForSingleObject(session->ui_thread, INFINITE);
-		Dbg("After WaitForSingleObject (session->ui_thread, INFINITE) session addr is %8x, and session->ui_thread = %0x.",session,  session->ui_thread);
+		Dbg("After WaitForSingleObject (session->ui_thread, INFINITE) session addr is %8x, and session->ui_thread = %0x.", session, session->ui_thread);
 
 		Dbg("CloseHandle ui_thread %0x", session->ui_thread);
 		CloseHandle(session->ui_thread);
@@ -1750,6 +1841,10 @@ static void stop_ui(video_session_t *session)
 	pg_local_hwnd = NULL;
 	pg_remote_hwnd = NULL;
 	Dbg("set pg_last_session  to null.");
+
+#else
+
+#endif // RVC_OS_WIN
 }
 
 static int load_record_area_png(video_session_t *session)
@@ -1761,10 +1856,16 @@ static int load_record_area_png(video_session_t *session)
 
 	//加载双录人形背景框
 	char strPath[MAX_PATH_SIZE]={0};
+	char strRecordAreaPath[MAX_PATH_SIZE] = { 0 };
+
+#ifdef RVC_OS_WIN
 	GetCurrentRunPath(strPath);
-	char strRecordAreaPath[MAX_PATH_SIZE]={0} ;
-	sprintf(strRecordAreaPath,"%s\\bin\\recordarea.png",strPath);
-	if (_access(strRecordAreaPath,0)!=-1)
+	sprintf(strRecordAreaPath, "%s\\bin\\recordarea.png", strPath);
+#else
+
+#endif // RVC_OS_WIN
+
+	if (ExistsFile(strRecordAreaPath))
 	{
 		if (session->recordareaimage == NULL)
 		{
@@ -1915,9 +2016,13 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
 
 		char strPath[MAX_PATH_SIZE]={0};
 		char strImgPath[MAX_PATH_SIZE]={0};
+#ifdef RVC_OS_WIN
 		GetCurrentRunPath(strPath);
-		sprintf(strImgPath,"%s\\bin\\error.jpg",strPath);
-		if (_access(strImgPath,0)!=-1)
+		sprintf(strImgPath, "%s\\bin\\error.jpg", strPath);
+#else
+
+#endif // RVC_OS_WIN		
+		if (ExistsFile(strImgPath))
 		{
 			IplImage*img = cvLoadImage(strImgPath,1);
 			if (img != NULL)
@@ -1939,9 +2044,14 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
 			session->video_error = NULL;
 		}
 		//加载人形背景框
-		char strPersonPath[MAX_PATH_SIZE] ;
-		sprintf(strPersonPath,"%s\\bin\\rxk.png",strPath);
-		if (_access(strPersonPath,0)!=-1)
+		char strPersonPath[MAX_PATH_SIZE] = {0};
+
+#ifdef RVC_OS_WIN
+		sprintf(strPersonPath, "%s\\bin\\rxk.png", strPath);
+#else
+
+#endif // RVC_OS_WIN
+		if (ExistsFile(strPersonPath))
 		{
 			if (session->personimage == NULL)
 			{
@@ -2029,6 +2139,8 @@ void video_session_stop(video_session_t *session)
 void double_record_broadcast_video_session_stop()
 {
 	LOG_FUNCTION();
+#ifdef RVC_OS_WIN
+
 	if (NULL != pg_last_session){
 		if (NULL != pg_last_session->pic_record){
 			if (NULL != pg_last_session->pic_record->work_thread){
@@ -2066,15 +2178,20 @@ void double_record_broadcast_video_session_stop()
 	pg_local_hwnd = NULL;
 	pg_remote_hwnd = NULL;
 	Dbg("set pg_last_session, pg_local_hwnd, pg_remote_hwnd to null.");
+
+#else
+
+#endif // RVC_OS_WIN
 }
 
 void video_session_destroy(video_session_t *session)
 {
 	LOG_FUNCTION();
 
-	if (NULL != session){
-		if (NULL != session->pic_record){
-			if (NULL != session->pic_record->work_thread){
+#ifdef RVC_OS_WIN
+	if (NULL != session) {
+		if (NULL != session->pic_record) {
+			if (NULL != session->pic_record->work_thread) {
 				SetEvent(session->pic_record->evt);
 
 				Dbg("CloseHandle pic_record ui_thread %0x", session->pic_record->work_thread);
@@ -2086,7 +2203,10 @@ void video_session_destroy(video_session_t *session)
 				session->pic_record->evt = NULL;
 			}
 		}
-	}
+#else
+
+#endif // RVC_OS_WIN
+
 
 	if (session->video_shm_q_env) {
 		delete session->video_shm_q_env;
@@ -2135,8 +2255,8 @@ static void av_log_cb(void*ptr, int level, const char*fmt, va_list list)
 
 int video_lib_init()
 {
+#ifdef RVC_OS_WIN
 	CoInitialize(NULL);
-
 	{
 		int i, n;
 
@@ -2155,13 +2275,21 @@ int video_lib_init()
 	av_log_set_callback(&av_log_cb);
 	//av_log_set_level(AV_LOG_DEBUG);
 	av_log_set_level(AV_LOG_QUIET);
+#else
+
+#endif // RVC_OS_WIN
 
 	return 0;
 }
 
 void video_lib_deinit()
 {
+#ifdef RVC_OS_WIN
 	CoUninitialize();
+#else
+
+#endif // RVC_OS_WIN
+
 	videoframework_term();
 }
 

+ 0 - 5
Module/mod_sipphone/video_session.h

@@ -1,6 +1,3 @@
-#ifndef MEDIACONTROLLER_VIDEO_H
-#define MEDIACONTROLLER_VIDEO_H
-
 #pragma once
 #include "../include/EventCode.h"
 #include "../mod_counterconnector/CallType.h"
@@ -65,5 +62,3 @@ void double_record_broadcast_video_session_stop();
 
 int video_lib_init();
 void video_lib_deinit();
-
-#endif

+ 1 - 1
Other/libaudioframework/CMakeLists.txt

@@ -119,7 +119,7 @@ conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
-conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
+conan_cmake_run(REQUIRES apache-apr/1.6.3@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)

+ 1 - 1
Other/libvideocapture/libvideocapture.h

@@ -1,7 +1,7 @@
 #pragma once
 
 #include "ivideocaptureinterface.h"
-#include "../rvcmediacommon/common_video/videoutil.h"
+#include "../libvideoframework/videoutil.h"
 #include "../rvcmediacommon/common_video/videocommon.h"
 
 static const int mode_width[VIDEOCAP_MAX_MODE] = {

+ 3 - 3
Other/libvideoframework/video_common/ffmpeg_api_cpp_adapter.h

@@ -13,9 +13,9 @@
 #include <stdint.h>
 extern "C"
 {
-#include <libavutil\avutil.h>
-#include <libavcodec\avcodec.h>
-#include <libswscale\swscale.h>
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+#include <libswscale/swscale.h>
 
 #include "libavutil/opt.h"
 #include "libavutil/imgutils.h"

+ 6 - 1
Other/libvideoframework/videoutil.h

@@ -24,7 +24,12 @@ typedef union video_timestamp {
         unsigned int lo;
         int hi;
     }u32;
-    __int64 u64;
+#ifdef _WIN32
+	__int64 u64;
+#else
+	long long u64;
+#endif // _WIN32
+
 }video_timestamp;
 
 typedef struct __video_frame_scale_t video_frame_scale_t;

+ 0 - 247
Other/rvcmediacommon/common_video/videoutil.c

@@ -1,247 +0,0 @@
-
-#include "videoutil.h"
-#include <malloc.h>
-
-int video_frame_alloc(int width, int height, int format, video_frame *frame)
-{
-    if (!frame)
-        return -1;
-    if (format != VIDEO_FORMAT_I420 && format != VIDEO_FORMAT_RGB24)
-        return -1;
-
-    memset(frame, 0, sizeof(video_frame));
-
-    frame->width = width;
-    frame->height = height;
-    frame->format = format;
-
-    if (format == VIDEO_FORMAT_RGB24) {
-        frame->linesize[0] = width * 3;
-        frame->data[0] = _aligned_malloc(frame->linesize[0]*height, 16);
-        if (frame->data[0] == NULL)
-            return -1;
-    } else {
-        frame->data[0] = _aligned_malloc(width*height*3/2, 16);
-        if (frame->data[0] == NULL)
-            return -1;
-        frame->linesize[0] = width;
-        frame->linesize[1] = frame->linesize[2] = width / 2;
-        frame->data[1] = frame->data[0] + width * height;
-        frame->data[2] = frame->data[1] + width * height / 4;
-    }
-
-    return 0;
-}
-
-void video_frame_free(video_frame *frame)
-{
-    if (frame->format == VIDEO_FORMAT_RGB24 || frame->format == VIDEO_FORMAT_I420) {
-        _aligned_free(frame->data[0]);
-    }
-}
-
-static void videohorflip_fast_copy(void *dst, const void *src, int size)
-{
-#if 0
-	if (((int)dst&0xf) == 0 && ((int)src&0xf)==0) { // 16 byte alignment
-		int i;
-		int n = size / 128;
-		__m128i xmm0;
-		__m128i xmm1;
-		__m128i xmm2;
-		__m128i xmm3;
-		__m128i xmm4;
-		__m128i xmm5;
-		__m128i xmm6;
-		__m128i xmm7;
-		const __m128i *source = reinterpret_cast<const __m128i *>(src);
-		__m128i *destination = reinterpret_cast<__m128i*>(dst);
-		for (i = 0; i < n; ++i) {
-			_mm_prefetch((const char*)source, _MM_HINT_NTA);
-			_mm_prefetch((const char*)source+64, _MM_HINT_NTA);
-			_mm_prefetch((const char*)source+128, _MM_HINT_NTA);
-			xmm0 = _mm_load_si128(source++);
-			xmm1 = _mm_load_si128(source++);
-			xmm2 = _mm_load_si128(source++);
-			xmm3 = _mm_load_si128(source++);
-			xmm4 = _mm_load_si128(source++);
-			xmm5 = _mm_load_si128(source++);
-			xmm6 = _mm_load_si128(source++);
-			xmm7 = _mm_load_si128(source++);
-			_mm_stream_si128(destination++, xmm0);
-			_mm_stream_si128(destination++, xmm1);
-			_mm_stream_si128(destination++, xmm2);
-			_mm_stream_si128(destination++, xmm3);
-			_mm_stream_si128(destination++, xmm4);
-			_mm_stream_si128(destination++, xmm5);
-			_mm_stream_si128(destination++, xmm6);
-			_mm_stream_si128(destination++, xmm7);
-		}
-		n = (size % 128) / 16;
-		for (i = 0; i < n; ++i) {
-			_mm_prefetch((const char*)source, _MM_HINT_NTA);
-			xmm0 = _mm_load_si128(source++);
-			_mm_stream_si128(destination++, xmm0);
-		}
-	} else {
-		memcpy(dst, src, size);
-	}
-#else
-	memcpy(dst, src, size);
-#endif
-}
-
-int video_frame_copy(video_frame *dst, video_frame *src)
-{
-    if (!dst)
-        return -1;
-    if (!src)
-        return -1;
-    if (src->format != dst->format)
-        return -1;
-    if (src->width != dst->width)
-        return -1;
-    if (src->height != dst->height)
-        return -1;
-
-    if (src->format == VIDEO_FORMAT_RGB24) {
-        //memcpy(dst->data[0], src->data[0], src->width*src->height*3);
-		videohorflip_fast_copy(dst->data[0], src->data[0], src->width*src->height*3);
-    } else {
-        videohorflip_fast_copy(dst->data[0], src->data[0], src->width*src->height);
-        videohorflip_fast_copy(dst->data[1], src->data[1], src->width*src->height/4);
-        videohorflip_fast_copy(dst->data[2], src->data[2], src->width*src->height/4);
-    }
-
-    return 0;
-}
-
-int video_get_timestamp(video_timestamp *p_ts)
-{
-#ifdef _WIN32
-    LARGE_INTEGER val;
-    if (!QueryPerformanceCounter(&val))
-        return -1;
-    p_ts->u64 = val.QuadPart;
-#else
-
-#endif // _WIN32
-    return 0;
-}
-
-int video_get_timestamp_freq(video_timestamp *p_freq)
-{
-#ifdef _WIN32
-    LARGE_INTEGER val;
-    if (!QueryPerformanceFrequency(&val))
-        return -1;
-    p_freq->u64 = val.QuadPart;
-#else
-
-#endif // _WIN32
-    return 0;
-}
-
-int video_frame_save_bmpfile(const char*bmpfile, video_frame *frame)
-{
-#ifdef _WIN32
-    HANDLE hFile;
-    BITMAPFILEHEADER filehdr;
-    BITMAPINFOHEADER infohdr;
-    BYTE *lpImage;
-    DWORD dwBytesWritten;
-    UINT nLen;
-    UINT nPadding;
-    BYTE padding[4];
-
-    if (!bmpfile || !frame)
-        return -1;
-    if (frame->format != VIDEO_FORMAT_RGB24)
-        return -1;
-
-    nLen = frame->width * frame->height * 3;
-    if (frame->width%4)
-        nPadding = 4 - frame->width%4;
-    else
-        nPadding = 0;
-
-    lpImage = frame->data[0];
-
-    hFile = CreateFileA(bmpfile, GENERIC_WRITE, FILE_SHARE_READ, 
-        NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-
-    ZeroMemory(&filehdr, sizeof(filehdr));
-    filehdr.bfOffBits = sizeof(filehdr) + sizeof(infohdr);
-    filehdr.bfSize = sizeof(filehdr) + sizeof(infohdr) + nLen + nPadding*frame->height;
-    filehdr.bfType = 'MB';
-    dwBytesWritten = 0;
-    WriteFile(hFile, &filehdr, sizeof(filehdr), &dwBytesWritten, NULL);
-
-	ZeroMemory(&infohdr, sizeof(infohdr));
-	infohdr.biSize = sizeof(infohdr);
-	infohdr.biBitCount = 24;
-	infohdr.biHeight = frame->height;
-	infohdr.biWidth = frame->width;
-	infohdr.biPlanes = 1;
-	infohdr.biSizeImage = nLen;
-	dwBytesWritten = 0;
-    WriteFile(hFile, &infohdr, sizeof(infohdr), &dwBytesWritten, NULL);
-
-    if (nPadding == 0) {
-        dwBytesWritten = 0;
-        WriteFile(hFile, lpImage, nLen, &dwBytesWritten, NULL);
-		if (GetLastError()) {
-			char tmp[32];
-			sprintf(tmp, "%d", GetLastError());
-			OutputDebugStringA(tmp);
-		}
-    } else {
-        int i;
-        for (i = 0; i < frame->height; ++i) {
-            dwBytesWritten = 0;
-            WriteFile(hFile, lpImage+frame->width*3*i, frame->width*3, &dwBytesWritten, NULL);
-            dwBytesWritten = 0;
-            WriteFile(hFile, &padding[0], nPadding, &dwBytesWritten, NULL);
-        }
-    }
-
-    CloseHandle(hFile);
-#else
-
-#endif // _WIN32
-
-    return 0;
-}
-
-video_frame *video_frame_new(int width, int height, int format)
-{
-	video_frame *frm = (video_frame*)malloc(sizeof(video_frame));
-	int rc = video_frame_alloc(width, height, format, frm);
-	if (rc != 0) {
-		free(frm);
-		frm = NULL;
-	}
-	return frm;
-}
-
-void video_frame_delete(video_frame *frame)
-{
-	if (frame) {
-		video_frame_free(frame);
-		free(frame);
-	}
-}
-
-int video_frame_fill_black(video_frame *frame)
-{
-	if (frame->format == VIDEO_FORMAT_I420) {
-		memset(frame->data[0], 0, frame->linesize[0]*frame->height);
-		memset(frame->data[1], 128, frame->linesize[1]*frame->height/2);
-		memset(frame->data[2], 128, frame->linesize[2]*frame->height/2);
-	} else if (frame->format == VIDEO_FORMAT_RGB24) {
-		memset(frame->data[0], 0, frame->linesize[0]*frame->height);
-	} else {
-		return -1;
-	}
-	return 0;
-}

+ 0 - 68
Other/rvcmediacommon/common_video/videoutil.h

@@ -1,68 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define VIDEO_FORMAT_I420       0x01
-#define VIDEO_FORMAT_RGB24      0x02
-
-#define IP_UDP_HEADER_SIZE 		(20 + 8)
-#define RTP_HEADER_SIZE			12
-
-typedef struct video_frame {
-    unsigned char *data[4];
-    int linesize[4];
-    int width;
-    int height;
-    int format; /* VIDEO_FORMAT_xxx */
-}video_frame;
-
-typedef union video_timestamp {
-    struct {
-        unsigned int lo;
-        int hi;
-    }u32;
-    long long u64;
-}video_timestamp;
-
-typedef struct __video_frame_scale_t video_frame_scale_t;
-
-/**
- * alloc memory for a video frame, return 0 on success
- */
-int video_frame_alloc(int width, int height, int format, video_frame *frame);
-
-/**
- * free memory of a video frame
- */
-void video_frame_free(video_frame *frame);
-
-/**
- * copy src frame to dst frame, return 0 on success
- */
-int video_frame_copy(video_frame *dst, video_frame *src);
-
-int video_get_timestamp(video_timestamp *p_ts);
-int video_get_timestamp_freq(video_timestamp *p_freq);
-
-/**
- * save videoframe as bmp file, only accept rgb24 frame
- * @param bmpfile save file path
- * @param frame the rgb24 format frame
- * @return 0 on success
- */
-int video_frame_save_bmpfile(const char*bmpfile, video_frame *frame);
-
-video_frame *video_frame_new(int width, int height, int format);
-void video_frame_delete(video_frame *frame);
-
-int video_frame_fill_black(video_frame *frame);
-
-//video_frame_scale_t *video_frame_scale_create(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
-//void video_frame_scale_destroy(video_frame_scale_t *);
-//int video_frame_scale_process(video_frame_scale_t *scale, unsigned char **src_data, int *src_linesize, int y, int h, unsigned char **dst_data, int *dst_linesize);
-
-#ifdef __cplusplus
-}//extern "C" {
-#endif

+ 1 - 1
Other/showdev/CMakeLists.txt

@@ -26,7 +26,7 @@ conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
-conan_cmake_run(REQUIRES apache-apr/1.4.2@LR04.02_ThirdParty/testing
+conan_cmake_run(REQUIRES apache-apr/1.6.3@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)