Commit c94a1a71 authored by Julien Wadel's avatar Julien Wadel
Browse files

Fix video tester : randomize record file

parent 178bcd63
......@@ -28,6 +28,12 @@
#ifdef VIDEO_ENABLED
std::string g_display_filter = "";// Global variable to test unit in order to select the display filter to use : "" use the default
static std::string generateRandomFilename(const std::string& name){
char token[6];
belle_sip_random_token(token, sizeof(token));
return name + token;
}
static void call_paused_resumed_with_video_base_call_cb(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message) {
if (cstate == LinphoneCallUpdatedByRemote) {
LinphoneCallParams *params = linphone_core_create_call_params(lc, call);
......@@ -1724,7 +1730,7 @@ static void classic_video_entry_phone_setup(void) {
LinphoneCall *callee_call = NULL;
LinphoneVideoPolicy vpol;
bctbx_list_t *lcs = NULL;
char *video_recording_file = bc_tester_file("video_entry_phone_record.mkv");
char *video_recording_file = bc_tester_file((generateRandomFilename("video_entry_phone_record_")+".mkv").c_str());
bool_t ok;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
......@@ -1829,16 +1835,18 @@ end:
bctbx_list_free(lcs);
bc_free(video_recording_file);
}
static void video_call_recording_h264_test(void) {
record_call("recording", TRUE, "H264");
record_call(generateRandomFilename("recording_").c_str(), TRUE, "H264");
}
static void video_call_recording_vp8_test(void) {
record_call("recording", TRUE, "VP8");
record_call(generateRandomFilename("recording_").c_str(), TRUE, "VP8");
}
static void snapshot_taken(LinphoneCall *call, const char *filepath) {
char *filename = bc_tester_file("snapshot.jpeg");
// This is a check on file name. It must not by dynamic : based from filter should be enough
char *filename = bc_tester_file((g_display_filter+"snapshot.jpeg").c_str());
LinphoneCore *lc = linphone_call_get_core(call);
stats *callstats = get_stats(lc);
BC_ASSERT_STRING_EQUAL(filepath, filename);
......@@ -1852,7 +1860,8 @@ static void video_call_snapshot(void) {
LinphoneCallParams *marieParams = linphone_core_create_call_params(marie->lc, NULL);
LinphoneCallParams *paulineParams = linphone_core_create_call_params(pauline->lc, NULL);
LinphoneCall *callInst = NULL;
char *filename = bc_tester_file("snapshot.jpeg");
// This is a check on file name. It must not by dynamic : based from filter should be enough
char *filename = bc_tester_file((g_display_filter+"snapshot.jpeg").c_str());
bool_t call_succeeded = FALSE;
if(g_display_filter != ""){
......@@ -1899,7 +1908,8 @@ static void video_call_snapshots(void) {
LinphoneCallParams *marieParams = linphone_core_create_call_params(marie->lc, NULL);
LinphoneCallParams *paulineParams = linphone_core_create_call_params(pauline->lc, NULL);
LinphoneCall *callInst = NULL;
char *filename = bc_tester_file("snapshot.jpeg");
// This is a check on file name. It must not by dynamic : based from filter should be enough
char *filename = bc_tester_file((g_display_filter+"snapshot.jpeg").c_str());
bool_t call_succeeded = FALSE;
int dummy = 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