mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-03 11:49:31 +00:00
test for: save video cam used in call object when switched
This commit is contained in:
parent
b852503f55
commit
b534eb5cea
3 changed files with 49 additions and 6 deletions
|
|
@ -1759,7 +1759,7 @@ static void call_with_declined_video_using_policy(void) {
|
|||
call_with_declined_video_base(TRUE);
|
||||
}
|
||||
|
||||
static void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) {
|
||||
void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) {
|
||||
LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0};
|
||||
LinphoneCall* marie_call;
|
||||
LinphoneCall* pauline_call;
|
||||
|
|
@ -1837,7 +1837,7 @@ static void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager*
|
|||
}
|
||||
|
||||
}
|
||||
void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) {
|
||||
static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) {
|
||||
video_call_base_2(pauline,marie,using_policy,mode,callee_video_enabled,caller_video_enabled);
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1));
|
||||
|
|
|
|||
|
|
@ -328,6 +328,6 @@ static const int audio_cmp_max_shift=20;
|
|||
* this function return max value in the last 3 seconds*/
|
||||
int linphone_core_manager_get_max_audio_down_bw(const LinphoneCoreManager *mgr);
|
||||
int linphone_core_manager_get_max_audio_up_bw(const LinphoneCoreManager *mgr);
|
||||
void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled);
|
||||
void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled);
|
||||
#endif /* LIBLINPHONE_TESTER_H_ */
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@
|
|||
*/
|
||||
#include "private.h"
|
||||
|
||||
#if defined(VIDEO_ENABLED) && defined(HAVE_GTK)
|
||||
#if defined(VIDEO_ENABLED)
|
||||
|
||||
|
||||
#include "linphonecore.h"
|
||||
#include "liblinphone_tester.h"
|
||||
#include "lpconfig.h"
|
||||
|
||||
|
||||
#if HAVE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include <gdk/gdkx.h>
|
||||
|
|
@ -485,12 +485,55 @@ static void forked_outgoing_early_media_video_call_with_inactive_audio_test(void
|
|||
linphone_core_manager_destroy(marie2);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
#endif /*HAVE_GTK*/
|
||||
|
||||
static void enable_disable_camera_after_camera_switches() {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
|
||||
const char *currentCamId = (char*)linphone_core_get_video_device(marie->lc);
|
||||
const char **cameras=linphone_core_get_video_devices(marie->lc);
|
||||
const char *newCamId=NULL;
|
||||
int i;
|
||||
|
||||
|
||||
video_call_base_2(marie,pauline,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE);
|
||||
|
||||
for (i=0;cameras[i]!=NULL;++i){
|
||||
if (strcmp(cameras[i],currentCamId)!=0){
|
||||
newCamId=cameras[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (newCamId){
|
||||
LinphoneCall *call = linphone_core_get_current_call(marie->lc);
|
||||
ms_message("Switching from [%s] to [%s]", currentCamId, newCamId);
|
||||
linphone_core_set_video_device(marie->lc, newCamId);
|
||||
if(call != NULL) {
|
||||
linphone_core_update_call(marie->lc, call, NULL);
|
||||
}
|
||||
BC_ASSERT_STRING_EQUAL(newCamId,ms_web_cam_get_string_id(linphone_call_get_video_device(call)));
|
||||
linphone_call_enable_camera(call,FALSE);
|
||||
linphone_core_iterate(marie->lc);
|
||||
linphone_call_enable_camera(call,TRUE);
|
||||
BC_ASSERT_STRING_EQUAL(newCamId,ms_web_cam_get_string_id(linphone_call_get_video_device(call)));
|
||||
}
|
||||
|
||||
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1));
|
||||
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1));
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
test_t video_tests[] = {
|
||||
#if HAVE_GTK
|
||||
{ "Early-media video during video call", early_media_video_during_video_call_test },
|
||||
{ "Two incoming early-media video calls", two_incoming_early_media_video_calls_test },
|
||||
{ "Early-media video with inactive audio", early_media_video_with_inactive_audio },
|
||||
{ "Forked outgoing early-media video call with inactive audio", forked_outgoing_early_media_video_call_with_inactive_audio_test }
|
||||
{ "Forked outgoing early-media video call with inactive audio", forked_outgoing_early_media_video_call_with_inactive_audio_test },
|
||||
#endif /*HAVE_GTK*/
|
||||
{ "Enable/disable camera after camera switches", enable_disable_camera_after_camera_switches}
|
||||
|
||||
};
|
||||
|
||||
test_suite_t video_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue