Enable setting a different video window id for each call.

This commit is contained in:
Ghislain MARY 2015-02-02 14:25:57 +01:00
parent ac2cbd71af
commit ecf4ba1b5c
3 changed files with 38 additions and 2 deletions

View file

@ -2394,7 +2394,9 @@ static void linphone_call_start_video_stream(LinphoneCall *call, bool_t all_inpu
video_stream_set_fps(call->videostream,linphone_core_get_preferred_framerate(lc));
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)
if (call->video_window_id != 0)
video_stream_set_native_window_id(call->videostream,call->video_window_id);
else 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);
@ -3596,3 +3598,24 @@ void linphone_call_cancel_dtmfs(LinphoneCall *call) {
call->dtmf_sequence = NULL;
}
}
unsigned long linphone_call_get_native_video_window_id(const LinphoneCall *call) {
if (call->video_window_id) {
/* The video id was previously set by the app. */
return call->video_window_id;
}
#ifdef VIDEO_ENABLED
else if (call->videostream) {
/* It was not set but we want to get the one automatically created by mediastreamer2 (desktop versions only). */
return video_stream_get_native_window_id(call->videostream);
}
#endif
return 0;
}
void linphone_call_set_native_video_window_id(LinphoneCall *call, unsigned long id) {
call->video_window_id = id;
if (call->videostream) {
video_stream_set_native_window_id(call->videostream, id);
}
}

View file

@ -757,6 +757,19 @@ LINPHONE_PUBLIC int linphone_call_send_dtmfs(LinphoneCall *call,char *dtmfs);
**/
LINPHONE_PUBLIC void linphone_call_cancel_dtmfs(LinphoneCall *call);
/**
* Get the native window handle of the video window, casted as an unsigned long.
* @ingroup media_parameters
**/
LINPHONE_PUBLIC unsigned long linphone_call_get_native_video_window_id(const LinphoneCall *call);
/**
* Set the native video window id where the video is to be displayed.
* For MacOS, Linux, Windows: if not set or 0 a window will be automatically created, unless the special id -1 is given.
* @ingroup media_parameters
**/
LINPHONE_PUBLIC void linphone_call_set_native_video_window_id(LinphoneCall *call, unsigned long id);
/**
* Return TRUE if this call is currently part of a conference
* @param call #LinphoneCall

View file

@ -226,7 +226,7 @@ struct _LinphoneCall{
StunCandidate ac,vc; /*audio video ip/port discovered by STUN*/
struct _AudioStream *audiostream; /**/
struct _VideoStream *videostream;
unsigned long video_window_id;
MSAudioEndpoint *endpoint; /*used for conferencing*/
char *refer_to;
LinphoneCallParams *params;