Commit 9205b33a authored by jehan's avatar jehan
Browse files

Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone

parents 1a4af622 d975effd
dnl Process this file with autoconf to produce a configure script.
AC_INIT([linphone],[3.3.99.6],[linphone-developers@nongnu.org])
AC_INIT([linphone],[3.3.99.7],[linphone-developers@nongnu.org])
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
......
......@@ -51,6 +51,3 @@ linphonecsh_LDADD = $(ORTP_LIBS)
endif
......@@ -91,6 +91,7 @@ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args);
#ifdef VIDEO_ENABLED
static int lpc_cmd_camera(LinphoneCore *lc, char *args);
static int lpc_cmd_video_window(LinphoneCore *lc, char *args);
static int lpc_cmd_preview_window(LinphoneCore *lc, char *args);
static int lpc_cmd_snapshot(LinphoneCore *lc, char *args);
#endif
static int lpc_cmd_states(LinphoneCore *lc, char *args);
......@@ -125,7 +126,7 @@ static LPC_COMMAND *lpc_find_command(const char *name);
void linphonec_out(const char *fmt,...);
VideoParams lpc_video_params={-1,-1,-1,-1,0,TRUE};
VideoParams lpc_preview_params={-1,-1,-1,-1,0,TRUE};
/***************************************************************************
*
......@@ -273,7 +274,17 @@ static LPC_COMMAND advanced_commands[] = {
"'vwindow show': shows video window\n"
"'vwindow hide': hides video window\n"
"'vwindow pos <x> <y>': Moves video window to x,y pixel coordinates\n"
"'vwindow size <width> <height>': Resizes video window"
"'vwindow size <width> <height>': Resizes video window\n"
"'vwindow id <window id>': embeds video display into supplied window id."
},
{ "pwindow", lpc_cmd_preview_window, "Control local camera video display (preview window)",
"'pwindow show': shows the local camera video display\n"
"'pwindow hide': hides the local camera video display\n"
"'pwindow pos <x> <y>': Moves preview window to x,y pixel coordinates\n"
"'pwindow size <width> <height>': Resizes preview window\n"
"'pwindow id <window id>': embeds preview display into supplied window id.\n"
"'pwindow integrated': integrate preview display within the video window of current call.\n"
"'pwindow standalone': use standalone window for preview display."
},
{ "snapshot", lpc_cmd_snapshot, "Take a snapshot of currently received video stream",
"'snapshot <file path>': take a snapshot and records it in jpeg format into the supplied path\n"
......@@ -2200,44 +2211,62 @@ 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){
static int _lpc_cmd_video_window(LinphoneCore *lc, char *args, bool_t is_preview){
char subcommand[64];
int a,b;
int err;
VideoParams *params=is_preview ? &lpc_preview_params : &lpc_video_params;
if (!args) return 0;
err=sscanf(args,"%s %i %i",subcommand,&a,&b);
if (err>=1){
if (strcmp(subcommand,"pos")==0){
if (err<3) return 0;
lpc_video_params.x=a;
lpc_video_params.y=b;
lpc_video_params.refresh=TRUE;
params->x=a;
params->y=b;
params->refresh=TRUE;
}else if (strcmp(subcommand,"size")==0){
if (err<3) return 0;
lpc_video_params.w=a;
lpc_video_params.h=b;
lpc_video_params.refresh=TRUE;
params->w=a;
params->h=b;
params->refresh=TRUE;
}else if (strcmp(subcommand,"show")==0){
lpc_video_params.show=TRUE;
lpc_video_params.refresh=TRUE;
params->show=TRUE;
params->refresh=TRUE;
if (is_preview) linphone_core_enable_video_preview (lc,TRUE);
}else if (strcmp(subcommand,"hide")==0){
lpc_video_params.show=FALSE;
lpc_video_params.refresh=TRUE;
params->show=FALSE;
params->refresh=TRUE;
if (is_preview) linphone_core_enable_video_preview (lc,FALSE);
}else if (strcmp(subcommand,"id")==0){
static char envbuf[128];
if (err == 1){
linphonec_out("vwindow id: 0x%x / SDL_WINDOWID='%s'\n",(unsigned int)lpc_video_params.wid, getenv("SDL_WINDOWID"));
linphonec_out("vwindow id: 0x%x\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;
lpc_video_params.wid=a;
snprintf(envbuf, sizeof(envbuf)-1, "SDL_WINDOWID=0x%x", (unsigned int)lpc_video_params.wid);
err = putenv(envbuf);
linphonec_out("vwindow id: 0x%x / SDL_WNIDOWID='%s'\n",(unsigned int)lpc_video_params.wid, getenv("SDL_WINDOWID"));
params->wid=a;
if (is_preview)
linphone_core_set_native_preview_window_id (lc,a);
else
linphone_core_set_native_video_window_id(lc,a);
}else if (is_preview==TRUE){
if (strcmp(subcommand,"integrated")==0){
linphone_core_use_preview_window (lc,FALSE);
}else if (strcmp(subcommand,"standalone")==0){
linphone_core_use_preview_window(lc,TRUE);
}else return 0;
}else return 0;
}
return 1;
}
static int lpc_cmd_video_window(LinphoneCore *lc, char *args){
return _lpc_cmd_video_window(lc, args, FALSE);
}
static int lpc_cmd_preview_window(LinphoneCore *lc, char *args){
return _lpc_cmd_video_window(lc, args, TRUE);
}
#endif
static void lpc_display_global_state(LinphoneCore *lc){
......
......@@ -177,7 +177,6 @@ static ortp_pipe_t server_sock;
bool_t linphonec_camera_enabled=TRUE;
extern VideoParams lpc_video_params;
void linphonec_call_identify(LinphoneCall* call){
static long callid=1;
......@@ -869,63 +868,68 @@ usage: linphonec [-c file] [-s sipaddr] [-a] [-V] [-d level ] [-l logfile]\n\
#ifdef VIDEO_ENABLED
#ifdef HAVE_X11_XLIB_H
static void sdl_x11_apply_video_params(){
static SDL_SysWMinfo info;
bool_t wminfo_ready=FALSE;
SDL_VERSION(&info.version);
if ( SDL_GetWMInfo(&info) ) {
if ( info.subsystem == SDL_SYSWM_X11 ) {
wminfo_ready=TRUE;
}
static void x11_apply_video_params(VideoParams *params, Window window){
XWindowChanges wc;
unsigned int flags=0;
static Display *display = NULL;
const char *dname=getenv("DISPLAY");
if (display==NULL && dname!=NULL){
display=XOpenDisplay(dname);
}
if ( !wminfo_ready) return;
{
XWindowChanges wc;
unsigned int flags=0;
Display *display = info.info.x11.display;
Window window = info.info.x11.wmwindow;
memset(&wc,0,sizeof(wc));
wc.x=lpc_video_params.x;
wc.y=lpc_video_params.y;
wc.width=lpc_video_params.w;
wc.height=lpc_video_params.h;
if (lpc_video_params.x!=-1 ){
flags|=CWX|CWY;
}
if (lpc_video_params.w!=-1){
flags|=CWWidth|CWHeight;
}
info.info.x11.lock_func();
XConfigureWindow(display,window,flags,&wc);
if (lpc_video_params.show)
XMapWindow(display,window);
else
XUnmapWindow(display,window);
info.info.x11.unlock_func();
if (display==NULL){
ms_error("Could not open display %s",dname);
return;
}
memset(&wc,0,sizeof(wc));
wc.x=params->x;
wc.y=params->y;
wc.width=params->w;
wc.height=params->h;
if (params->x!=-1 ){
flags|=CWX|CWY;
}
if (params->w!=-1){
flags|=CWWidth|CWHeight;
}
/*printf("XConfigureWindow x=%i,y=%i,w=%i,h=%i\n",
wc.x, wc.y ,wc.width, wc.height);*/
XConfigureWindow(display,window,flags,&wc);
if (params->show)
XMapWindow(display,window);
else
XUnmapWindow(display,window);
XSync(display,FALSE);
}
#endif
static void lpc_apply_video_params(){
static unsigned long prev_wid=0;
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);
if (wid!=0 && (lpc_video_params.refresh || prev_wid!=wid)){
if (wid!=0 && (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
sdl_x11_apply_video_params();
x11_apply_video_params(&lpc_video_params,wid);
}
#endif
}
old_wid=wid;
if (pwid!=0 && (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("Refreshing\n");
x11_apply_video_params(&lpc_preview_params,pwid);
}
#endif
}
prev_wid=wid;
old_pwid=pwid;
}
#endif
......
......@@ -104,6 +104,10 @@ typedef struct {
bool_t refresh;
} VideoParams;
extern VideoParams lpc_video_params;
extern VideoParams lpc_preview_params;
/***************************************************************************
*
* Forward declarations
......
......@@ -297,6 +297,8 @@ static void call_ack(SalOp *op){
static void call_updating(SalOp *op){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
LinphoneCallState prevstate=LinphoneCallIdle;
if (call->resultdesc)
sal_media_description_unref(call->resultdesc);
call->resultdesc=sal_call_get_final_media_description(op);
......@@ -319,7 +321,9 @@ static void call_updating(SalOp *op){
linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)");
}
else if(call->state==LinphoneCallStreamsRunning &&
sal_media_description_has_dir(call->resultdesc,SalStreamRecvOnly) && !strcmp(call->resultdesc->addr,"0.0.0.0")){
( sal_media_description_has_dir(call->resultdesc,SalStreamRecvOnly)
|| sal_media_description_has_dir(call->resultdesc,SalStreamInactive)
|| strcmp(call->resultdesc->addr,"0.0.0.0")==0)){
if(lc->vtable.display_status)
lc->vtable.display_status(lc,_("We are being paused..."));
linphone_call_set_state (call,LinphoneCallPausedByRemote,"Call paused by remote");
......@@ -327,6 +331,7 @@ static void call_updating(SalOp *op){
ms_error("Inconsitency detected: current call is %p but call %p is being paused !",lc->current_call,call);
}
}else{
prevstate=call->state;
linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
}
/*accept the modification (sends a 200Ok)*/
......@@ -334,6 +339,9 @@ static void call_updating(SalOp *op){
linphone_call_stop_media_streams (call);
linphone_call_init_media_streams (call);
linphone_call_start_media_streams (call);
if (prevstate!=LinphoneCallIdle){
linphone_call_set_state (call,prevstate,"Connected (streams running)");
}
}
if (lc->current_call==NULL) linphone_core_start_pending_refered_calls (lc);
}
......
......@@ -33,7 +33,6 @@
cr->lc=lc;
cr->peer=linphone_address_as_string(parsed_url);
cr->peer_url=parsed_url;
cr->route=ms_strdup(linphone_core_get_route(lc));
lc->chatrooms=ms_list_append(lc->chatrooms,(void *)cr);
return cr;
}
......@@ -46,11 +45,13 @@
lc->chatrooms=ms_list_remove(lc->chatrooms,(void *) cr);
linphone_address_destroy(cr->peer_url);
ms_free(cr->peer);
ms_free(cr->route);
if (cr->op)
sal_op_release(cr->op);
}
void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg){
const char *identity=linphone_core_get_identity(cr->lc);
const char *route=NULL;
const char *identity=linphone_core_find_best_identity(cr->lc,cr->peer_url,&route);
SalOp *op;
LinphoneCall *call;
if((call = linphone_core_get_call_by_remote_address(cr->lc,cr->peer))!=NULL)
......@@ -61,7 +62,12 @@ void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg){
else
{
op = sal_op_new(cr->lc->sal);
sal_op_set_route(op,cr->route);
sal_op_set_route(op,route);
if (cr->op!=NULL){
sal_op_release (cr->op);
cr->op=NULL;
}
cr->op=op;
}
sal_text_send(op,identity,cr->peer,msg);
}
......
......@@ -128,6 +128,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
char *friend=NULL;
const char *route=NULL;
const char *from=NULL;
const char *fixed_contact=NULL;
LinphoneProxyConfig *cfg;
friend=linphone_address_as_string(fr->uri);
......@@ -135,6 +136,12 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
if (cfg!=NULL){
route=linphone_proxy_config_get_route(cfg);
from=linphone_proxy_config_get_identity(cfg);
if (cfg->op){
fixed_contact=sal_op_get_contact(cfg->op);
if (fixed_contact) {
ms_message("Contact for subscribe has been fixed using proxy to %s",fixed_contact);
}
}
}else from=linphone_core_get_primary_contact(fr->lc);
if (fr->outsub==NULL){
/* people for which we don't have yet an answer should appear as offline */
......@@ -149,6 +156,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
}
fr->outsub=sal_op_new(fr->lc->sal);
sal_op_set_route(fr->outsub,route);
sal_op_set_contact(fr->outsub,fixed_contact);
sal_subscribe_presence(fr->outsub,from,friend);
fr->subscribe_active=TRUE;
ms_free(friend);
......@@ -367,6 +375,7 @@ void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc){
}
ms_message("linphone_friend_apply() done.");
lc->bl_refresh=TRUE;
fr->commit=FALSE;
}
void linphone_friend_edit(LinphoneFriend *fr){
......@@ -391,7 +400,8 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
return ;
}
lc->friends=ms_list_append(lc->friends,lf);
linphone_friend_apply(lf,lc);
if ( linphone_core_ready(lc)) linphone_friend_apply(lf,lc);
else lf->commit=TRUE;
return ;
}
......@@ -404,6 +414,15 @@ void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend* fl){
}
}
void linphone_core_send_initial_subscribes(LinphoneCore *lc){
const MSList *elem;
for(elem=lc->friends;elem!=NULL;elem=elem->next){
LinphoneFriend *f=(LinphoneFriend*)elem->data;
if (f->commit)
linphone_friend_apply(f,lc);
}
}
void linphone_friend_set_ref_key(LinphoneFriend *lf, const char *key){
if (lf->refkey!=NULL){
ms_free(lf->refkey);
......@@ -562,7 +581,7 @@ void linphone_core_write_friends_config(LinphoneCore* lc)
{
MSList *elem;
int i;
if (!lc->ready) return; /*dont write config when reading it !*/
if (! linphone_core_ready(lc)) return; /*dont write config when reading it !*/
for (elem=lc->friends,i=0; elem!=NULL; elem=ms_list_next(elem),i++){
linphone_friend_write_to_config_file(lc->config,(LinphoneFriend*)elem->data,i);
}
......
EXTRA_DIST = Doxyfile.in doxygen.dox
SOURCES= doxygen.dox *.c $(top_srcdir)/coreapi/*.c $(top_srcdir)/coreapi/*.h
SOURCES= doxygen.dox $(top_srcdir)/coreapi/help/*.c $(top_srcdir)/coreapi/*.c $(top_srcdir)/coreapi/*.h
#html doc
......
......@@ -824,7 +824,12 @@ static void _linphone_call_start_media_streams(LinphoneCall *call, bool_t send_e
video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
video_stream_enable_self_view(call->videostream,lc->video_conf.selfview);
if (lc->video_window_id!=0)
video_stream_set_native_window_id(call->videostream,lc->video_window_id);
if (lc->preview_window_id!=0)
video_stream_set_native_preview_window_id (call->videostream,lc->preview_window_id);
video_stream_use_preview_video_window (call->videostream,lc->use_preview_window);
if (stream->dir==SalStreamSendOnly && lc->video_conf.capture ){
cam=get_nowebcam_device();
dir=VideoStreamSendOnly;
......
......@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*#define UNSTANDART_GSM_11K 1*/
static const char *liblinphone_version=LIBLINPHONE_VERSION;
static void set_network_reachable(LinphoneCore* lc,bool_t isReachable);
static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t curtime);
#include "enum.h"
......@@ -52,6 +52,7 @@ static void toggle_video_preview(LinphoneCore *lc, bool_t val);
extern SalCallbacks linphone_sal_callbacks;
void lc_callback_obj_init(LCCallbackObj *obj,LinphoneCoreCbFunc func,void* ud)
{
obj->_func=func;
......@@ -103,7 +104,7 @@ static void call_logs_write_to_config_file(LinphoneCore *lc){
char *tmp;
LpConfig *cfg=lc->config;
if (!lc->ready) return;
if (linphone_core_get_global_state (lc)==LinphoneGlobalStartup) return;
for(i=0,elem=lc->call_logs;elem!=NULL;elem=elem->next,++i){
LinphoneCallLog *cl=(LinphoneCallLog*)elem->data;
......@@ -996,10 +997,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
ui_config_read(lc);
if (lc->vtable.display_status)
lc->vtable.display_status(lc,_("Ready"));
linphone_core_set_state(lc,LinphoneGlobalOn,"Ready");
lc->auto_net_state_mon=lc->sip_conf.auto_net_state_mon;
lc->ready=TRUE;
linphone_core_set_state(lc,LinphoneGlobalOn,"Ready");
}
/**
......@@ -1529,7 +1528,7 @@ static void monitor_network_state(LinphoneCore *lc, time_t curtime){
if (new_status){
ms_message("New local ip address is %s",result);
}
set_network_reachable(lc,new_status);
set_network_reachable(lc,new_status, curtime);
last_status=new_status;
}
}
......@@ -1724,6 +1723,12 @@ void linphone_core_iterate(LinphoneCore *lc){
linphone_core_do_plugin_tasks(lc);
if (lc->initial_subscribes_sent==FALSE && lc->netup_time!=0 &&
(curtime-lc->netup_time)>3){
linphone_core_send_initial_subscribes(lc);
lc->initial_subscribes_sent=TRUE;
}
if (one_second_elapsed && lp_config_needs_commit(lc->config)){
lp_config_sync(lc->config);
}
......@@ -1861,6 +1866,17 @@ LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const L
return found_cfg;
}
const char *linphone_core_find_best_identity(LinphoneCore *lc, const LinphoneAddress *to, const char **route){
LinphoneProxyConfig *cfg=linphone_core_lookup_known_proxy(lc,to);
if (cfg==NULL)
linphone_core_get_default_proxy (lc,&cfg);
if (cfg!=NULL){
*route=linphone_proxy_config_get_route(cfg);
return linphone_proxy_config_get_identity (cfg);
}
return linphone_core_get_primary_contact (lc);
}
static char *get_fixed_contact(LinphoneCore *lc, LinphoneCall *call , LinphoneProxyConfig *dest_proxy){
LinphoneAddress *ctt;
const char *localip=call->localip;
......@@ -2669,7 +2685,7 @@ bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *dev
int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid){
MSSndCard *card=get_card_from_string_id(devid,MS_SND_CARD_CAP_PLAYBACK);
lc->sound_conf.ring_sndcard=card;
if (card && lc->ready)
if (card && linphone_core_ready(lc))
lp_config_set_string(lc->config,"sound","ringer_dev_id",ms_snd_card_get_string_id(card));
return 0;
}
......@@ -2683,7 +2699,7 @@ int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid){
int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid){
MSSndCard *card=get_card_from_string_id(devid,MS_SND_CARD_CAP_PLAYBACK);
lc->sound_conf.play_sndcard=card;
if (card && lc->ready)
if (card && linphone_core_ready(lc))
lp_config_set_string(lc->config,"sound","playback_dev_id",ms_snd_card_get_string_id(card));
return 0;
}
......@@ -2697,7 +2713,7 @@ int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid){
int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid){
MSSndCard *card=get_card_from_string_id(devid,MS_SND_CARD_CAP_CAPTURE);
lc->sound_conf.capt_sndcard=card;
if (card && lc->ready)
if (card && linphone_core_ready(lc))
lp_config_set_string(lc->config,"sound","capture_dev_id",ms_snd_card_get_string_id(card));
return 0;
}
......@@ -2788,7 +2804,7 @@ void linphone_core_set_ring(LinphoneCore *lc,const char *path){
ms_free(lc->sound_conf.local_ring);
}
lc->sound_conf.local_ring=ms_strdup(path);
if (lc->ready && lc->sound_conf.local_ring)
if ( linphone_core_ready(lc) && lc->sound_conf.local_ring)
lp_config_set_string(lc->config,"sound","local_ring",lc->sound_conf.local_ring);
}
......@@ -2852,7 +2868,7 @@ const char * linphone_core_get_ringback(const LinphoneCore *lc){
**/
void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val){
lc->sound_conf.ec=val;
if (lc->ready)
if ( linphone_core_ready(lc))
lp_config_set_int(lc->config,"sound","echocancellation",val);
}
......@@ -3042,8 +3058,13 @@ static void toggle_video_preview(LinphoneCore *lc, bool_t val){
#ifdef VIDEO_ENABLED
if (val){
if (lc->previewstream==NULL){
lc->previewstream=video_preview_start(lc->video_conf.device,
lc->video_conf.vsize,lc->video_conf.displaytype);
lc->previewstream=video_preview_new();
video_preview_set_size(lc->previewstream,lc->video_conf.vsize);
if (lc->video_conf.displaytype)
video_preview_set_display_filter_name(lc->previewstream,lc->video_conf.displaytype);
if (lc->preview_window_id!=0)
video_preview_set_native_window_id(lc->previewstream,lc->preview_window_id);
video_preview_start(lc->previewstream,lc->video_conf.device);
}
}else{
if (lc->previewstream!=NULL){
......@@ -3157,7 +3178,7 @@ int linphone_core_set_video_device(LinphoneCore *lc, const char *id){
if (olddev!=NULL && olddev!=lc->video_conf.device){
toggle_video_preview(lc,FALSE);/*restart the video local preview*/
}
if (lc->ready && lc->video_conf.device){
if ( linphone_core_ready(lc) && lc->video_conf.device){
vd=ms_web_cam_get_string_id(lc->video_conf.device);
if (vd && strstr(vd,"Static picture")!=NULL){
vd=NULL;
......@@ -3269,7 +3290,49 @@ unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc){
if (lc->previewstream)
return video_stream_get_native_window_id(lc->previewstream);
#endif
return 0;
return lc->video_window_id;
}
/**
* Set the native video window id where the video is to be displayed.
* If not set the core will create its own window.
**/
void linphone_core_set_native_video_window_id(LinphoneCore *lc, unsigned long id){
lc->video_window_id=id;
}
/**
* Returns the native window handle of the video preview window, casted as an unsigned long.
*
* @ingroup media_parameters
**/
unsigned long linphone_core_get_native_preview_window_id(const LinphoneCore *lc){
#ifdef VIDEO_ENABLED
LinphoneCall *call=linphone_core_get_current_call (lc);
if (call && call->videostream)
return video_stream_get_native_preview_window_id(call->videostream);
if (lc->previewstream)
return video_preview_get_native_window_id(lc->previewstream);
#endif
return lc->preview_window_id;
}
/**
* Set the native window id where the preview video (local camera) is to be displayed.
* This has to be used in conjonction with linphone_core_use_preview_window().
* If not set the core will create its own window.