Commit 1896a794 authored by Jehan Monnier's avatar Jehan Monnier

prepare wince port

parent 798b8e72
...@@ -36,7 +36,7 @@ AM_PROG_CC_C_O ...@@ -36,7 +36,7 @@ AM_PROG_CC_C_O
case $target_os in case $target_os in
*mingw32ce) *mingw32ce)
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501 -Dstrerror=" CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501" CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2 -liphlpapi" LIBS="$LIBS -lws2 -liphlpapi"
mingw_found=yes mingw_found=yes
......
...@@ -26,10 +26,12 @@ ...@@ -26,10 +26,12 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef _WIN32_WCE
#include <errno.h> #include <errno.h>
#include <unistd.h>
#endif /*_WIN32_WCE*/
#include <limits.h> #include <limits.h>
#include <ctype.h> #include <ctype.h>
#include <unistd.h>
#include <linphonecore.h> #include <linphonecore.h>
#include "linphonec.h" #include "linphonec.h"
...@@ -282,7 +284,7 @@ linphonec_command_generator(const char *text, int state) ...@@ -282,7 +284,7 @@ linphonec_command_generator(const char *text, int state)
if (strncmp(name, text, len) == 0) if (strncmp(name, text, len) == 0)
{ {
return strdup(name); return ortp_strdup(name);
} }
} }
...@@ -577,10 +579,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args) ...@@ -577,10 +579,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
args+=4; args+=4;
if ( ! *args ) return 0; if ( ! *args ) return 0;
friend_num = strtol(args, NULL, 10); friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) { if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n"); linphonec_out("Invalid friend number\n");
return 0; return 0;
} }
#endif /*_WIN32_WCE*/
linphonec_friend_call(lc, friend_num); linphonec_friend_call(lc, friend_num);
return 1; return 1;
} }
...@@ -597,10 +601,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args) ...@@ -597,10 +601,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
else else
{ {
friend_num = strtol(args, NULL, 10); friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) { if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n"); linphonec_out("Invalid friend number\n");
return 0; return 0;
} }
#endif /*_WIN32_WCE*/
} }
linphonec_friend_delete(lc, friend_num); linphonec_friend_delete(lc, friend_num);
return 1; return 1;
...@@ -1401,9 +1407,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){ ...@@ -1401,9 +1407,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){
static int lpc_cmd_status(LinphoneCore *lc, char *args) static int lpc_cmd_status(LinphoneCore *lc, char *args)
{ {
if ( ! args ) return 0;
LinphoneProxyConfig *cfg; LinphoneProxyConfig *cfg;
if ( ! args ) return 0;
linphone_core_get_default_proxy(lc,&cfg); linphone_core_get_default_proxy(lc,&cfg);
if (strstr(args,"register")) if (strstr(args,"register"))
{ {
......
This diff is collapsed.
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#endif #endif
#endif #endif
/************************************************************************** /**************************************************************************
* *
* Compile-time defines * Compile-time defines
...@@ -98,7 +99,7 @@ typedef struct { ...@@ -98,7 +99,7 @@ typedef struct {
/*************************************************************************** /***************************************************************************
* *
* Forward declarations * Forward declarations
* *
***************************************************************************/ ***************************************************************************/
......
...@@ -42,9 +42,9 @@ endif ...@@ -42,9 +42,9 @@ endif
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \ AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
$(ORTP_CFLAGS) \
$(OSIP_CFLAGS) \ $(OSIP_CFLAGS) \
$(EXOSIP_CFLAGS) \ $(EXOSIP_CFLAGS) \
$(ORTP_CFLAGS) \
-DENABLE_TRACE \ -DENABLE_TRACE \
-DLOG_DOMAIN=\"LinphoneCore\" \ -DLOG_DOMAIN=\"LinphoneCore\" \
$(IPV6_CFLAGS) \ $(IPV6_CFLAGS) \
......
This diff is collapsed.
...@@ -163,7 +163,12 @@ void linphone_call_destroy(LinphoneCall *obj) ...@@ -163,7 +163,12 @@ void linphone_call_destroy(LinphoneCall *obj)
/*prevent a gcc bug with %c*/ /*prevent a gcc bug with %c*/
static size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm){ static size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm){
#if !defined(_WIN32_WCE)
return strftime(s, max, fmt, tm); return strftime(s, max, fmt, tm);
#else
return 0;
/*FIXME*/
#endif /*_WIN32_WCE*/
} }
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to){ LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to){
...@@ -171,7 +176,10 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to ...@@ -171,7 +176,10 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to
struct tm loctime; struct tm loctime;
cl->dir=call->dir; cl->dir=call->dir;
#ifdef WIN32 #ifdef WIN32
#if !defined(_WIN32_WCE)
loctime=*localtime(&call->start_time); loctime=*localtime(&call->start_time);
/*FIXME*/
#endif /*_WIN32_WCE*/
#else #else
localtime_r(&call->start_time,&loctime); localtime_r(&call->start_time,&loctime);
#endif #endif
...@@ -396,7 +404,7 @@ void sound_config_read(LinphoneCore *lc) ...@@ -396,7 +404,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING; tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf); tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
if (access(tmpbuf,F_OK)==-1) { if (ortp_file_exist(tmpbuf)==-1) {
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING; tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
} }
if (strstr(tmpbuf,".wav")==NULL){ if (strstr(tmpbuf,".wav")==NULL){
...@@ -408,7 +416,7 @@ void sound_config_read(LinphoneCore *lc) ...@@ -408,7 +416,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","remote_ring",tmpbuf); tmpbuf=lp_config_get_string(lc->config,"sound","remote_ring",tmpbuf);
if (access(tmpbuf,F_OK)==-1){ if (ortp_file_exist(tmpbuf)==-1){
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
} }
if (strstr(tmpbuf,".wav")==NULL){ if (strstr(tmpbuf,".wav")==NULL){
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#if !defined(_WIN32_WCE)
#include <errno.h> #include <errno.h>
#endif /*_WIN32_WCE*/
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -76,8 +78,8 @@ void list_node_foreach(ListNode *head, ListNodeForEachFunc func){ ...@@ -76,8 +78,8 @@ void list_node_foreach(ListNode *head, ListNodeForEachFunc func){
#define LIST_PREPEND(e1,e2) ( (e2)->_prev=NULL,(e2)->_next=(e1),(e1)->_prev=(e2),(e2) ) #define LIST_PREPEND(e1,e2) ( (e2)->_prev=NULL,(e2)->_next=(e1),(e1)->_prev=(e2),(e2) )
#define LIST_APPEND(head,elem) ((head)==0 ? (elem) : (list_node_append((ListNode*)(head),(ListNode*)(elem)), (head)) ) #define LIST_APPEND(head,elem) ((head)==0 ? (elem) : (list_node_append((ListNode*)(head),(ListNode*)(elem)), (head)) )
#define LIST_REMOVE(head,elem) #define LIST_REMOVE(head,elem)
/* returns void */ /* returns void */
#define LIST_FOREACH(head) list_node_foreach((ListNode*)head) #define LIST_FOREACH(head) list_node_foreach((ListNode*)head)
...@@ -102,14 +104,14 @@ struct _LpConfig{ ...@@ -102,14 +104,14 @@ struct _LpConfig{
LpItem * lp_item_new(const char *key, const char *value){ LpItem * lp_item_new(const char *key, const char *value){
LpItem *item=lp_new0(LpItem,1); LpItem *item=lp_new0(LpItem,1);
item->key=strdup(key); item->key=ortp_strdup(key);
item->value=strdup(value); item->value=ortp_strdup(value);
return item; return item;
} }
LpSection *lp_section_new(const char *name){ LpSection *lp_section_new(const char *name){
LpSection *sec=lp_new0(LpSection,1); LpSection *sec=lp_new0(LpSection,1);
sec->name=strdup(name); sec->name=ortp_strdup(name);
return sec; return sec;
} }
...@@ -151,9 +153,9 @@ static bool_t is_first_char(const char *start, const char *pos){ ...@@ -151,9 +153,9 @@ static bool_t is_first_char(const char *start, const char *pos){
void lp_config_parse(LpConfig *lpconfig){ void lp_config_parse(LpConfig *lpconfig){
char tmp[MAX_LEN]; char tmp[MAX_LEN];
LpSection *cur=NULL; LpSection *cur=NULL;
if (lpconfig->file==NULL) return; if (lpconfig->file==NULL) return;
while(fgets(tmp,MAX_LEN,lpconfig->file)!=NULL){ while(fgets(tmp,MAX_LEN,lpconfig->file)!=NULL){
char *pos1,*pos2; char *pos1,*pos2;
pos1=strchr(tmp,'['); pos1=strchr(tmp,'[');
...@@ -180,10 +182,10 @@ void lp_config_parse(LpConfig *lpconfig){ ...@@ -180,10 +182,10 @@ void lp_config_parse(LpConfig *lpconfig){
if (pos1!=NULL){ if (pos1!=NULL){
char key[MAX_LEN]; char key[MAX_LEN];
key[0]='\0'; key[0]='\0';
*pos1='\0'; *pos1='\0';
if (sscanf(tmp,"%s",key)>0){ if (sscanf(tmp,"%s",key)>0){
pos1++; pos1++;
pos2=strchr(pos1,'\n'); pos2=strchr(pos1,'\n');
if (pos2==NULL) pos2=pos1+strlen(pos1); if (pos2==NULL) pos2=pos1+strlen(pos1);
...@@ -211,16 +213,18 @@ void lp_config_parse(LpConfig *lpconfig){ ...@@ -211,16 +213,18 @@ void lp_config_parse(LpConfig *lpconfig){
LpConfig * lp_config_new(const char *filename){ LpConfig * lp_config_new(const char *filename){
LpConfig *lpconfig=lp_new0(LpConfig,1); LpConfig *lpconfig=lp_new0(LpConfig,1);
if (filename!=NULL){ if (filename!=NULL){
lpconfig->filename=strdup(filename); lpconfig->filename=ortp_strdup(filename);
lpconfig->file=fopen(filename,"rw"); lpconfig->file=fopen(filename,"rw");
if (lpconfig->file!=NULL){ if (lpconfig->file!=NULL){
lp_config_parse(lpconfig); lp_config_parse(lpconfig);
fclose(lpconfig->file); fclose(lpconfig->file);
#if !defined(_WIN32_WCE)
/* make existing configuration files non-group/world-accessible */ /* make existing configuration files non-group/world-accessible */
if (chmod(filename, S_IRUSR | S_IWUSR) == -1) if (chmod(filename, S_IRUSR | S_IWUSR) == -1)
ms_warning("unable to correct permissions on " ms_warning("unable to correct permissions on "
"configuration file: %s", "configuration file: %s",
strerror(errno)); strerror(errno));
#endif /*_WIN32_WCE*/
lpconfig->file=NULL; lpconfig->file=NULL;
lpconfig->modified=0; lpconfig->modified=0;
} }
...@@ -230,7 +234,7 @@ LpConfig * lp_config_new(const char *filename){ ...@@ -230,7 +234,7 @@ LpConfig * lp_config_new(const char *filename){
void lp_item_set_value(LpItem *item, const char *value){ void lp_item_set_value(LpItem *item, const char *value){
free(item->value); free(item->value);
item->value=strdup(value); item->value=ortp_strdup(value);
} }
......
...@@ -30,7 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,7 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <strings.h> #include <strings.h>
#if !defined(_WIN32_WCE)
#include <errno.h> #include <errno.h>
#endif /*_WIN32_WCE*/
#undef snprintf #undef snprintf
#include <ortp/stun.h> #include <ortp/stun.h>
...@@ -100,15 +102,17 @@ char *int2str(int number) ...@@ -100,15 +102,17 @@ char *int2str(int number)
void check_sound_device(LinphoneCore *lc) void check_sound_device(LinphoneCore *lc)
{ {
int fd,len; int fd=0;
int len;
int a; int a;
char *file=NULL; char *file=NULL;
char *i810_audio=NULL; char *i810_audio=NULL;
char *snd_pcm_oss=NULL; char *snd_pcm_oss=NULL;
char *snd_mixer_oss=NULL; char *snd_mixer_oss=NULL;
char *snd_pcm=NULL; char *snd_pcm=NULL;
#if !defined(_WIN32_WCE)
fd=open("/proc/modules",O_RDONLY); fd=open("/proc/modules",O_RDONLY);
#endif /*_WIN32_WCE*/
if (fd>0){ if (fd>0){
/* read the entire /proc/modules file and check if sound conf seems correct */ /* read the entire /proc/modules file and check if sound conf seems correct */
/*a=fstat(fd,&statbuf); /*a=fstat(fd,&statbuf);
...@@ -158,7 +162,9 @@ void check_sound_device(LinphoneCore *lc) ...@@ -158,7 +162,9 @@ void check_sound_device(LinphoneCore *lc)
*/ */
end: end:
if (file!=NULL) ms_free(file); if (file!=NULL) ms_free(file);
#if !defined(_WIN32_WCE)
if (fd>0) close(fd); if (fd>0) close(fd);
#endif /*_WIN32_WCE*/
} }
#define UDP_HDR_SZ 8 #define UDP_HDR_SZ 8
...@@ -353,12 +359,10 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc) ...@@ -353,12 +359,10 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
PayloadType *payload; PayloadType *payload;
bool_t prepend; bool_t prepend;
lc->local_profile=rtp_profile_clone_full(&av_profile); lc->local_profile=rtp_profile_clone_full(&av_profile);
/* first look at the list given by configuration file to see if /* first look at the list given by configuration file to see if
it is correct */ it is correct */
audiopt=fix_codec_list(lc->local_profile,lc->codecs_conf.audio_codecs); audiopt=fix_codec_list(lc->local_profile,lc->codecs_conf.audio_codecs);
videopt=fix_codec_list(lc->local_profile,lc->codecs_conf.video_codecs); videopt=fix_codec_list(lc->local_profile,lc->codecs_conf.video_codecs);
/* now find and add payloads that are not listed in the configuration /* now find and add payloads that are not listed in the configuration
codec list */ codec list */
for (i=0;i<127;i++) for (i=0;i<127;i++)
...@@ -798,7 +802,7 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){ ...@@ -798,7 +802,7 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){
if (err<0) { if (err<0) {
ms_error("Error in connect: %s",strerror(errno)); ms_error("Error in connect: %s",strerror(errno));
freeaddrinfo(res); freeaddrinfo(res);
close(sock); close_socket(sock);
return -1; return -1;
} }
freeaddrinfo(res); freeaddrinfo(res);
...@@ -807,14 +811,14 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){ ...@@ -807,14 +811,14 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){
err=getsockname(sock,(struct sockaddr*)&addr,&s); err=getsockname(sock,(struct sockaddr*)&addr,&s);
if (err!=0) { if (err!=0) {
ms_error("Error in getsockname: %s",strerror(errno)); ms_error("Error in getsockname: %s",strerror(errno));
close(sock); close_socket(sock);
return -1; return -1;
} }
err=getnameinfo((struct sockaddr *)&addr,s,result,LINPHONE_IPADDR_SIZE,NULL,0,NI_NUMERICHOST); err=getnameinfo((struct sockaddr *)&addr,s,result,LINPHONE_IPADDR_SIZE,NULL,0,NI_NUMERICHOST);
if (err!=0){ if (err!=0){
ms_error("getnameinfo error: %s",strerror(errno)); ms_error("getnameinfo error: %s",strerror(errno));
} }
close(sock); close_socket(sock);
ms_message("Local interface to reach %s is %s.",dest,result); ms_message("Local interface to reach %s is %s.",dest,result);
return 0; return 0;
} }
...@@ -174,7 +174,7 @@ sdp_context_generate_template (sdp_context_t * ctx) ...@@ -174,7 +174,7 @@ sdp_context_generate_template (sdp_context_t * ctx)
} }
static void add_relay_info(sdp_message_t *sdp, int mline, const char *relay, const char *relay_session_id){ static void add_relay_info(sdp_message_t *sdp, int mline, const char *relay, const char *relay_session_id){
if (relay) sdp_message_a_attribute_add(sdp, mline, if (relay) sdp_message_a_attribute_add(sdp, mline,
osip_strdup ("relay-addr"),osip_strdup(relay)); osip_strdup ("relay-addr"),osip_strdup(relay));
if (relay_session_id) sdp_message_a_attribute_add(sdp, mline, if (relay_session_id) sdp_message_a_attribute_add(sdp, mline,
...@@ -191,7 +191,12 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med ...@@ -191,7 +191,12 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med
{ {
eXosip_trace (OSIP_ERROR, eXosip_trace (OSIP_ERROR,
("You must not call sdp_context_add_*_payload outside the write_offer callback\n")); ("You must not call sdp_context_add_*_payload outside the write_offer callback\n"));
abort (); #if !defined(_WIN32_WCE)
abort();
#else
exit(-1);
#endif /*_WIN32_WCE*/
} }
if (payload->proto == NULL) if (payload->proto == NULL)
payload->proto = "RTP/AVP"; payload->proto = "RTP/AVP";
...@@ -225,7 +230,7 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med ...@@ -225,7 +230,7 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med
attr_field); attr_field);
} }
if (payload->b_as_bandwidth != 0) if (payload->b_as_bandwidth != 0)
{ {
if (sdp_message_bandwidth_get(offer,payload->line,0)==NULL){ if (sdp_message_bandwidth_get(offer,payload->line,0)==NULL){
attr_field = attr_field =
sstrdup_sprintf ("%i", payload->b_as_bandwidth); sstrdup_sprintf ("%i", payload->b_as_bandwidth);
...@@ -326,7 +331,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote) ...@@ -326,7 +331,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote)
else eXosip_trace(OSIP_INFO1,("Using firewall address in sdp.")); else eXosip_trace(OSIP_INFO1,("Using firewall address in sdp."));
answer = sdp_context_generate_template (ctx); answer = sdp_context_generate_template (ctx);
/* for each m= line */ /* for each m= line */
for (i = 0; !sdp_message_endof_media (remote, i); i++){ for (i = 0; !sdp_message_endof_media (remote, i); i++){
sdp_payload_init(&init_payload); sdp_payload_init(&init_payload);
...@@ -373,7 +378,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote) ...@@ -373,7 +378,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote)
sdp_message_a_attr_value_get_with_pt sdp_message_a_attr_value_get_with_pt
(remote, i, payload.pt, (remote, i, payload.pt,
"fmtp"); "fmtp");
/* ask the application if this codec is supported */ /* ask the application if this codec is supported */
err = sdph->accept_audio_codecs (ctx, err = sdph->accept_audio_codecs (ctx,
&payload); &payload);
...@@ -447,7 +452,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote) ...@@ -447,7 +452,7 @@ sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote)
{ {
/* refuse the line */ /* refuse the line */
refuse_mline(answer,mtype,proto,i); refuse_mline(answer,mtype,proto,i);
} }
else else
m_lines_accepted++; m_lines_accepted++;
......
...@@ -125,6 +125,7 @@ if test $GCC = yes && test $wall_werror = yes; then ...@@ -125,6 +125,7 @@ if test $GCC = yes && test $wall_werror = yes; then
fi fi
macosx_found=no macosx_found=no
mingw32ce_found=no
dnl add thread flags dnl add thread flags
case $target_os in case $target_os in
...@@ -138,8 +139,9 @@ case $target_os in ...@@ -138,8 +139,9 @@ case $target_os in
CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC" CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC"
CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE" CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE"
dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
LIBS="$LIBS -lws2" LIBS="$LIBS -lws2"
mingw_found=yes mingw_found=yes
mingw32ce_found=yes
build_tests=no build_tests=no
;; ;;
*mingw*) *mingw*)
...@@ -480,6 +482,7 @@ MS_CHECK_VIDEO ...@@ -480,6 +482,7 @@ MS_CHECK_VIDEO
AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true") AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes") AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes") AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
dnl ********************************************* dnl *********************************************
dnl setup oRTP dependency dnl setup oRTP dependency
......
...@@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/event.h" #include "ortp/event.h"
#include <time.h> #include <time.h>
#if defined(_WIN32_WCE)
#define time ms_time
time_t ms_time (time_t *t);
#endif /*_WIN32_WCE*/
typedef enum EchoLimiterType{ typedef enum EchoLimiterType{
ELInactive, ELInactive,
ELControlMic, ELControlMic,
...@@ -100,7 +105,7 @@ void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const ...@@ -100,7 +105,7 @@ void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const
void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno); void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno);
/* those two function do the same as audio_stream_start() but in two steps /* those two function do the same as audio_stream_start() but in two steps
this is useful to make sure that sockets are open before sending an invite; this is useful to make sure that sockets are open before sending an invite;
or to start to stream only after receiving an ack.*/ or to start to stream only after receiving an ack.*/
AudioStream *audio_stream_new(int locport, bool_t ipv6); AudioStream *audio_stream_new(int locport, bool_t ipv6);
int audio_stream_start_now(AudioStream * stream, RtpProfile * prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp,MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel); int audio_stream_start_now(AudioStream * stream, RtpProfile * prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp,MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel);
......
...@@ -162,7 +162,9 @@ libmediastreamer_la_LIBADD+= -lole32 \ ...@@ -162,7 +162,9 @@ libmediastreamer_la_LIBADD+= -lole32 \
endif endif
endif endif
if BUILD_WIN32_WCE
libmediastreamer_la_LIBADD+= -lmmtimer
endif
AM_CFLAGS= -I$(top_srcdir) \ AM_CFLAGS= -I$(top_srcdir) \
$(ORTP_CFLAGS) \ $(ORTP_CFLAGS) \
......
...@@ -95,7 +95,7 @@ bool_t ms_is_ipv6(const char *remote){ ...@@ -95,7 +95,7 @@ bool_t ms_is_ipv6(const char *remote){
bool_t ret=FALSE; bool_t ret=FALSE;
#ifdef INET6 #ifdef INET6
struct addrinfo hints, *res0; struct addrinfo hints, *res0;
int err; int err;
memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC; hints.ai_family = PF_UNSPEC;
...@@ -105,7 +105,7 @@ bool_t ms_is_ipv6(const char *remote){ ...@@ -105,7 +105,7 @@ bool_t ms_is_ipv6(const char *remote){
ms_warning ("get_local_addr_for: %s", gai_strerror(err)); ms_warning ("get_local_addr_for: %s", gai_strerror(err));
return FALSE; return FALSE;
} }
ret=(res0->ai_addr->sa_family==AF_INET6); ret=(res0->ai_addr->sa_family==AF_INET6);
freeaddrinfo(res0); freeaddrinfo(res0);
#endif #endif
return ret; return ret;
...@@ -127,7 +127,7 @@ RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){ ...@@ -127,7 +127,7 @@ RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
time_t time_t
time (time_t *t) ms_time (time_t *t)
{ {
DWORD timemillis = GetTickCount(); DWORD timemillis = GetTickCount();
if (timemillis>0) if (timemillis>0)
...@@ -179,7 +179,7 @@ void audio_stream_change_decoder(AudioStream *stream, int payload){ ...@@ -179,7 +179,7 @@ void audio_stream_change_decoder(AudioStream *stream, int payload){
ms_filter_link (stream->rtprecv, 0, stream->decoder, 0); ms_filter_link (stream->rtprecv, 0, stream->decoder, 0);
ms_filter_link (stream->decoder,0 , stream->dtmfgen, 0); ms_filter_link (stream->decoder,0 , stream->dtmfgen, 0);
ms_filter_preprocess(stream->decoder,stream->ticker); ms_filter_preprocess(stream->decoder,stream->ticker);
}else{ }else{
ms_warning("No decoder found for %s",pt->mime_type); ms_warning("No decoder found for %s",pt->mime_type);
} }
...@@ -208,17 +208,17 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char ...@@ -208,17 +208,17 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
if (remport>0) rtp_session_set_remote_addr_full(rtps,remip,remport,rem_rtcp_port); if (remport>0) rtp_session_set_remote_addr_full(rtps,remip,remport,rem_rtcp_port);
rtp_session_set_payload_type(rtps,payload); rtp_session_set_payload_type(rtps,payload);
rtp_session_set_jitter_compensation(rtps,jitt_comp); rtp_session_set_jitter_compensation(rtps,jitt_comp);
if (remport>0) if (remport>0)
ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SET_SESSION,rtps); ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SET_SESSION,rtps);
stream->rtprecv=ms_filter_new(MS_RTP_RECV_ID); stream->rtprecv=ms_filter_new(MS_RTP_RECV_ID);
ms_filter_call_method(stream->rtprecv,MS_RTP_RECV_SET_SESSION,rtps); ms_filter_call_method(stream->rtprecv,MS_RTP_RECV_SET_SESSION,rtps);
stream->session=rtps; stream->session=rtps;
stream->dtmfgen=ms_filter_new(MS_DTMF_GEN_ID); stream->dtmfgen=ms_filter_new(MS_DTMF_GEN_ID);
rtp_session_signal_connect(rtps,"telephone-event",(RtpCallback)on_dtmf_received,(unsigned long)stream); rtp_session_signal_connect(rtps,"telephone-event",(RtpCallback)on_dtmf_received,(unsigned long)stream);
rtp_session_signal_connect(rtps,"payload_type_changed",(RtpCallback)payload_type_changed,(unsigned long)stream); rtp_session_signal_connect(rtps,"payload_type_changed",(RtpCallback)payload_type_changed,(unsigned long)stream);
/* creates the local part */ /* creates the local part */
if (captcard!=NULL) stream->soundread=ms_snd_card_create_reader(captcard); if (captcard!=NULL) stream->soundread=ms_snd_card_create_reader(captcard);
else { else {
...@@ -231,7 +231,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char ...@@ -231,7 +231,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
stream->soundwrite=ms_filter_new(MS_FILE_REC_ID);