Commit 0e4d2550 authored by Ghislain MARY's avatar Ghislain MARY

Fix compilation of linphonec and linphone-gtk.

parent e7fbd59a
......@@ -2376,12 +2376,12 @@ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args)
#ifdef VIDEO_ENABLED
static int _lpc_cmd_video_window(LinphoneCore *lc, char *args, bool_t is_preview){
char subcommand[64];
int a,b;
long a,b;
int err;
VideoParams *params=is_preview ? &lpc_preview_params : &lpc_video_params;
if (!args) return 0;
err=sscanf(args,"%63s %i %i",subcommand,&a,&b);
err=sscanf(args,"%63s %ld %ld",subcommand,&a,&b);
if (err>=1){
if (strcmp(subcommand,"pos")==0){
if (err<3) return 0;
......@@ -2403,15 +2403,15 @@ static int _lpc_cmd_video_window(LinphoneCore *lc, char *args, bool_t is_preview
if (is_preview) linphone_core_enable_video_preview (lc,FALSE);
}else if (strcmp(subcommand,"id")==0){
if (err == 1){
linphonec_out("vwindow id: 0x%x\n",is_preview ? linphone_core_get_native_preview_window_id (lc) :
linphonec_out("vwindow id: 0x%p\n",is_preview ? linphone_core_get_native_preview_window_id (lc) :
linphone_core_get_native_video_window_id (lc));
return 1;
} else if (err != 2) return 0;
params->wid=a;
params->wid=(void *)a;
if (is_preview)
linphone_core_set_native_preview_window_id (lc,a);
linphone_core_set_native_preview_window_id(lc, (void *)a);
else
linphone_core_set_native_video_window_id(lc,a);
linphone_core_set_native_video_window_id(lc, (void *)a);
}else if (is_preview==TRUE){
if (strcmp(subcommand,"integrated")==0){
linphone_core_use_preview_window (lc,FALSE);
......
......@@ -164,7 +164,7 @@ static char zrtpsecrets[PATH_MAX];
static char usr_certificates_path[PATH_MAX];
static const char *factory_configfile_name=NULL;
static char *sip_addr_to_call = NULL; /* for autocall */
static int window_id = 0; /* 0=standalone window, or window id for embedding video */
static void *window_id = NULL; /* NULL=standalone window, or window id for embedding video */
#if !defined(_WIN32_WCE)
static ortp_pipe_t client_sock=ORTP_PIPE_INVALID;
#endif /*_WIN32_WCE*/
......@@ -759,9 +759,9 @@ linphonec_init(int argc, char **argv)
linphone_core_set_user_certificates_path(linphonec,usr_certificates_path);
linphone_core_enable_video_capture(linphonec, vcap_enabled);
linphone_core_enable_video_display(linphonec, display_enabled);
if (display_enabled && window_id != 0)
if (display_enabled && (window_id != NULL))
{
printf("Setting window_id: 0x%x\n", window_id);
printf("Setting window_id: 0x%p\n", window_id);
linphone_core_set_native_video_window_id(linphonec,window_id);
}
......@@ -985,11 +985,12 @@ static void x11_apply_video_params(VideoParams *params, Window window){
static void lpc_apply_video_params(){
static unsigned long old_wid=0,old_pwid=0;
unsigned long wid=linphone_core_get_native_video_window_id (linphonec);
unsigned long pwid=linphone_core_get_native_preview_window_id (linphonec);
static void *old_wid=NULL;
static void *old_pwid=NULL;
void *wid=linphone_core_get_native_video_window_id(linphonec);
void *pwid=linphone_core_get_native_preview_window_id(linphonec);
if (wid!=0 && (lpc_video_params.refresh || old_wid!=wid)){
if (wid!=NULL && (lpc_video_params.refresh || old_wid!=wid)){
lpc_video_params.refresh=FALSE;
#ifdef HAVE_X11_XLIB_H
if (lpc_video_params.wid==0){ // do not manage window if embedded
......@@ -1000,11 +1001,11 @@ static void lpc_apply_video_params(){
#endif
}
old_wid=wid;
if (pwid!=0 && (lpc_preview_params.refresh || old_pwid!=pwid)){
if (pwid!=NULL && (lpc_preview_params.refresh || old_pwid!=pwid)){
lpc_preview_params.refresh=FALSE;
#ifdef HAVE_X11_XLIB_H
/*printf("wid=%lu pwid=%lu\n",wid,pwid);*/
if (lpc_preview_params.wid==0){ // do not manage window if embedded
/*printf("wid=%p pwid=%p\n",wid,pwid);*/
if (lpc_preview_params.wid==NULL){ // do not manage window if embedded
printf("Refreshing\n");
x11_apply_video_params(&lpc_preview_params,pwid);
}
......@@ -1303,7 +1304,7 @@ linphonec_parse_cmdline(int argc, char **argv)
arg_num++;
if (arg_num < argc) {
char *tmp;
window_id = strtol( argv[arg_num], &tmp, 0 );
window_id = (void *)strtol( argv[arg_num], &tmp, 0 );
lpc_video_params.wid = window_id;
}
}
......
......@@ -99,7 +99,7 @@ typedef struct {
typedef struct {
int x,y,w,h;
unsigned long wid;
void *wid;
bool_t show;
bool_t refresh;
} VideoParams;
......
......@@ -306,7 +306,7 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
g_free(user_certificates_dir);
linphone_core_enable_video_capture(the_core, TRUE);
linphone_core_enable_video_display(the_core, TRUE);
linphone_core_set_native_video_window_id(the_core,-1);/*don't create the window*/
linphone_core_set_native_video_window_id(the_core,(void *)(unsigned int)-1);/*don't create the window*/
if (no_video) {
_linphone_gtk_enable_video(FALSE);
linphone_gtk_set_ui_config_int("videoselfview",0);
......
......@@ -94,13 +94,13 @@ static gboolean drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint
return TRUE;
}
static unsigned long get_native_handle(GdkWindow *gdkw){
static void *get_native_handle(GdkWindow *gdkw){
#ifdef GDK_WINDOWING_X11
return (unsigned long)GDK_WINDOW_XID(gdkw);
return (void *)GDK_WINDOW_XID(gdkw);
#elif defined(WIN32)
return (unsigned long)GDK_WINDOW_HWND(gdkw);
return (void *)GDK_WINDOW_HWND(gdkw);
#elif defined(__APPLE__)
return (unsigned long)gdk_quartz_window_get_nsview(gdkw);
return (void *)gdk_quartz_window_get_nsview(gdkw);
#endif
g_warning("No way to get the native handle from gdk window");
return 0;
......@@ -132,7 +132,7 @@ static gint resize_video_window(LinphoneCall *call){
static void on_video_window_destroy(GtkWidget *w, guint timeout){
g_source_remove(timeout);
linphone_core_set_native_video_window_id(linphone_gtk_get_core(),(unsigned long)-1);
linphone_core_set_native_video_window_id(linphone_gtk_get_core(),(void *)(unsigned long)-1);
}
static void video_window_set_fullscreen(GtkWidget *w, gboolean val){
......@@ -314,7 +314,7 @@ static void on_video_preview_destroyed(GtkWidget *video_preview, GtkWidget *mw){
guint timeout_id=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(video_preview),"timeout-id"));
g_object_set_data(G_OBJECT(mw),"video_preview",NULL);
linphone_core_enable_video_preview(lc,FALSE);
linphone_core_set_native_preview_window_id(lc,-1);
linphone_core_set_native_preview_window_id(lc,(void *)(unsigned long)-1);
g_source_remove(timeout_id);
}
......
......@@ -38,13 +38,13 @@ extern void *gdk_quartz_window_get_nsview(GdkWindow *window);
#include <gdk/gdkkeysyms.h>
static unsigned long get_native_handle(GdkWindow *gdkw) {
static void *get_native_handle(GdkWindow *gdkw) {
#ifdef GDK_WINDOWING_X11
return (unsigned long)GDK_WINDOW_XID(gdkw);
return (void *)GDK_WINDOW_XID(gdkw);
#elif defined(_WIN32)
return (unsigned long)GDK_WINDOW_HWND(gdkw);
return (void *)GDK_WINDOW_HWND(gdkw);
#elif defined(__APPLE__)
return (unsigned long)gdk_quartz_window_get_nsview(gdkw);
return (void *)gdk_quartz_window_get_nsview(gdkw);
#endif
g_warning("No way to get the native handle from gdk window");
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment