From 136d8379fe708a2cc9e7248556e5c3a296078c49 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 23 Jun 2014 15:31:16 +0200 Subject: [PATCH] Fix compilation for Windows Phone 8. --- build/vsx/LibLinphone/LibLinphone.vcxproj | 33 ++++++++++------------- coreapi/chat.c | 18 +++++++------ coreapi/private.h | 10 +++---- mediastreamer2 | 2 +- oRTP | 2 +- 5 files changed, 31 insertions(+), 34 deletions(-) diff --git a/build/vsx/LibLinphone/LibLinphone.vcxproj b/build/vsx/LibLinphone/LibLinphone.vcxproj index bc1f56695..814314f15 100644 --- a/build/vsx/LibLinphone/LibLinphone.vcxproj +++ b/build/vsx/LibLinphone/LibLinphone.vcxproj @@ -66,7 +66,7 @@ Level4 - $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\linphone\oRTP\include;$(ProjectDir)..\..\..\..\linphone\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) __STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR="";UNICODE;%(PreprocessorDefinitions) false Default @@ -90,7 +90,7 @@ Level4 - $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\linphone\oRTP\include;$(ProjectDir)..\..\..\..\linphone\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) __STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR="";UNICODE;%(PreprocessorDefinitions) true true @@ -116,7 +116,7 @@ Level4 - $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\linphone\oRTP\include;$(ProjectDir)..\..\..\..\linphone\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) __STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR="";UNICODE;_XKEYCHECK_H;%(PreprocessorDefinitions) false Default @@ -146,7 +146,7 @@ Level4 - $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\belle-sip\include;$(ProjectDir)..\..\..\..\linphone\oRTP\include;$(ProjectDir)..\..\..\..\linphone\mediastreamer2\include;$(ProjectDIr)..\..\..\..\tunnel\include;$(ProjectDir)..\..\..\coreapi;$(ProjectDir)..\..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories) __STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR="";UNICODE;_XKEYCHECK_H;%(PreprocessorDefinitions) true true @@ -204,11 +204,13 @@ + + @@ -222,40 +224,33 @@ + {4c225a82-800b-427b-ba7b-61686a9b347f} - - {027bad0e-9179-48c1-9733-7aa7e2c2ec70} - {9924ac72-f96c-4e56-94d9-2b025da43c6b} {072fad20-7007-4da2-b2e7-16ce2b219f67} - - {b16b81a9-bef2-44c9-b603-1065183ae844} - {36b528f9-fb79-4078-a16b-0a7442581bb7} {d22bd217-d0f8-4274-9b3a-f3f35f46482c} - - {ffc7b532-0502-4d88-ac98-9e89071cbc97} - false - true - false - true - false - {59500dd1-b192-4ddf-a402-8a8e3739e032} + + {027bad0e-9179-48c1-9733-7aa7e2c2ec70} + + + {ffc7b532-0502-4d88-ac98-9e89071cbc97} + {5dfa07b4-0be9-46a9-ba32-fdf5a55c580b} @@ -276,4 +271,4 @@ - + \ No newline at end of file diff --git a/coreapi/chat.c b/coreapi/chat.c index 280c4353b..39fe39a8c 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -80,7 +80,7 @@ static void linphone_chat_message_file_transfer_on_progress(belle_sip_body_handl * @param size size in byte of the data requested, as output it will contain the effective copied size * */ -static int linphone_chat_message_file_transfer_on_send_body(belle_sip_user_body_handler_t *bh, belle_sip_message_t *msg, void *data, size_t offset, void *buffer, size_t *size){ +static int linphone_chat_message_file_transfer_on_send_body(belle_sip_user_body_handler_t *bh, belle_sip_message_t *msg, void *data, size_t offset, char *buffer, size_t *size){ LinphoneChatMessage* chatMsg=(LinphoneChatMessage *)data; LinphoneCore *lc = chatMsg->chat_room->lc; @@ -445,16 +445,19 @@ void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessag cr=linphone_core_create_chat_room(lc,cleanfrom); } if (sal_msg->content_type != NULL) { /* content_type field is, for now, used only for rcs file transfer bu twe shall strcmp it with "application/vnd.gsma.rcs-ft-http+xml" */ + xmlChar *file_url = NULL; + xmlDocPtr xmlMessageBody; + xmlNodePtr cur; + msg = linphone_chat_room_create_message(cr, NULL); /* create a message with empty body */ msg->content_type = ms_strdup(sal_msg->content_type); /* add the content_type "application/vnd.gsma.rcs-ft-http+xml" */ msg->file_transfer_information = (LinphoneContent *)malloc(sizeof(LinphoneContent)); memset(msg->file_transfer_information, 0, sizeof(*(msg->file_transfer_information))); - xmlChar *file_url = NULL; /* parse the message body to get all informations from it */ - xmlDocPtr xmlMessageBody = xmlParseDoc((const xmlChar *)sal_msg->text); + xmlMessageBody = xmlParseDoc((const xmlChar *)sal_msg->text); - xmlNodePtr cur = xmlDocGetRootElement(xmlMessageBody); + cur = xmlDocGetRootElement(xmlMessageBody); if (cur != NULL) { cur = cur->xmlChildrenNode; while (cur!=NULL) { @@ -943,7 +946,7 @@ const LinphoneContent *linphone_chat_message_get_file_transfer_information(const return message->file_transfer_information; } -static void on_recv_body(belle_sip_user_body_handler_t *bh, belle_sip_message_t *msg, void *data, size_t offset, const void *buffer, size_t size){ +static void on_recv_body(belle_sip_user_body_handler_t *bh, belle_sip_message_t *msg, void *data, size_t offset, const char *buffer, size_t size){ //printf("Receive %ld bytes\n\n%s\n\n", size, (char *)buffer); LinphoneChatMessage* chatMsg=(LinphoneChatMessage *)data; LinphoneCore *lc = chatMsg->chat_room->lc; @@ -962,7 +965,7 @@ static void linphone_chat_process_response_headers_from_get_file(void *data, con if (event->response){ /*we are receiving a response, set a specific body handler to acquire the response. * if not done, belle-sip will create a memory body handler, the default*/ - LinphoneChatMessage *message=belle_sip_object_data_get(BELLE_SIP_OBJECT(event->request),"message"); + LinphoneChatMessage *message=(LinphoneChatMessage *)belle_sip_object_data_get(BELLE_SIP_OBJECT(event->request),"message"); belle_sip_message_set_body_handler( (belle_sip_message_t*)event->response, (belle_sip_body_handler_t*)belle_sip_user_body_handler_new(message->file_transfer_information->size, linphone_chat_message_file_transfer_on_progress,on_recv_body,NULL,message) @@ -998,11 +1001,10 @@ void linphone_chat_message_start_file_download(const LinphoneChatMessage *messag belle_generic_uri_t *uri; belle_http_request_t *req; const char *url=message->external_body_url; + char* ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version()); uri=belle_generic_uri_parse(url); - char* ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version()); - req=belle_http_request_create("GET", uri, belle_sip_header_create("User-Agent",ua), diff --git a/coreapi/private.h b/coreapi/private.h index 9cb1b45da..5c174fb64 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -294,24 +294,24 @@ void linphone_core_get_local_ip(LinphoneCore *lc, int af, char *result); bool_t host_has_ipv6_network(); bool_t lp_spawn_command_line_sync(const char *command, char **result,int *command_ret); -static inline int get_min_bandwidth(int dbw, int ubw){ +static MS2_INLINE int get_min_bandwidth(int dbw, int ubw){ if (dbw<=0) return ubw; if (ubw<=0) return dbw; return MIN(dbw,ubw); } -static inline bool_t bandwidth_is_greater(int bw1, int bw2){ +static MS2_INLINE bool_t bandwidth_is_greater(int bw1, int bw2){ if (bw1<0) return TRUE; else if (bw2<0) return FALSE; else return bw1>=bw2; } -static inline int get_remaining_bandwidth_for_video(int total, int audio){ +static MS2_INLINE int get_remaining_bandwidth_for_video(int total, int audio){ if (total<=0) return 0; return total-audio-10; } -static inline void set_string(char **dest, const char *src){ +static MS2_INLINE void set_string(char **dest, const char *src){ if (*dest){ ms_free(*dest); *dest=NULL; @@ -903,7 +903,7 @@ xmlXPathObjectPtr linphone_get_xml_xpath_object_for_node_list(xmlparsing_context char * linphone_timestamp_to_rfc3339_string(time_t timestamp); -static inline const LinphoneErrorInfo *linphone_error_info_from_sal_op(const SalOp *op){ +static MS2_INLINE const LinphoneErrorInfo *linphone_error_info_from_sal_op(const SalOp *op){ if (op==NULL) return (LinphoneErrorInfo*)sal_error_info_none(); return (const LinphoneErrorInfo*)sal_op_get_error_info(op); } diff --git a/mediastreamer2 b/mediastreamer2 index 999768a69..fdf4db8e0 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 999768a69bd0b6ead9de0930c6d6ebd4a020ffcf +Subproject commit fdf4db8e0c2a5aa9b7c054f22df6fdb31a21fa46 diff --git a/oRTP b/oRTP index e4a235076..d0e9c7c3d 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit e4a235076787acef6e97eb7a15b400f91fd4f481 +Subproject commit d0e9c7c3d961ac1a400bf2796b03ebefab77541d