add LINPHONE_VIDEO_DISPLAY_AUTO/NONE to avoid manipulating scalar values directly

This commit is contained in:
Jehan Monnier 2015-07-22 12:04:29 +02:00
parent f1aca46bb6
commit 44987d644d
4 changed files with 19 additions and 7 deletions

View file

@ -5317,11 +5317,6 @@ static void unset_video_window_id(LinphoneCore *lc, bool_t preview, void *id){
#endif
}
/**
* @ingroup media_parameters
* Set the native video window id where the video is to be displayed.
* For MacOS, Linux, Windows: if not set or zero the core will create its own window, unless the special id -1 is given.
**/
void linphone_core_set_native_video_window_id(LinphoneCore *lc, void *id){
if ((id == NULL)
#ifndef _WIN32

View file

@ -3605,6 +3605,23 @@ LINPHONE_PUBLIC float linphone_core_get_static_picture_fps(LinphoneCore *lc);
/*function to be used for eventually setting window decorations (icons, title...)*/
LINPHONE_PUBLIC void * linphone_core_get_native_video_window_id(const LinphoneCore *lc);
/**
* @ingroup media_parameters
* For MacOS, Linux, Windows: core will create its own window
* */
#define LINPHONE_VIDEO_DISPLAY_AUTO (void*)((unsigned long) 0)
/**
* @ingroup media_parameters
* For MacOS, Linux, Windows: do nothing
* */
#define LINPHONE_VIDEO_DISPLAY_NONE (void*)((unsigned long) -1)
/**
* @ingroup media_parameters
* Set the native video window id where the video is to be displayed.
* For MacOS, Linux, Windows: if not set or LINPHONE_VIDEO_DISPLAY_AUTO the core will create its own window, unless the special id LINPHONE_VIDEO_DISPLAY_NONE is given.
**/
LINPHONE_PUBLIC void linphone_core_set_native_video_window_id(LinphoneCore *lc, void *id);
LINPHONE_PUBLIC void * linphone_core_get_native_preview_window_id(const LinphoneCore *lc);

View file

@ -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,(void *)(unsigned int)-1);/*don't create the window*/
linphone_core_set_native_video_window_id(the_core,LINPHONE_VIDEO_DISPLAY_NONE);/*don't create the window*/
if (no_video) {
_linphone_gtk_enable_video(FALSE);
linphone_gtk_set_ui_config_int("videoselfview",0);

View file

@ -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(),(void *)(unsigned long)-1);
linphone_core_set_native_video_window_id(linphone_gtk_get_core(),LINPHONE_VIDEO_DISPLAY_NONE);
}
static void video_window_set_fullscreen(GtkWidget *w, gboolean val){