Commit b2df35fd authored by François Grisez's avatar François Grisez
Browse files

Fix bug #1416

Data are written in a .part suffixed temporary file while snapshot is going on.
Once snapsot is completed, the temporary file is renamed into the specified name.
parent 0373b595
......@@ -1346,7 +1346,6 @@ int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file){
return ms_filter_call_method(call->videostream->jpegwriter,MS_JPEG_WRITER_TAKE_SNAPSHOT,(void*)file);
}
ms_warning("Cannot take snapshot: no currently running video stream on this call.");
return -1;
#endif
return -1;
}
......
mediastreamer2 @ 7a0842cb
Subproject commit 171a79e39e023e8689deef9e070dc8b80259673b
Subproject commit 7a0842cbfc9afe794feff095a2a864a57e9c1e81
......@@ -2852,10 +2852,41 @@ static void audio_call_recording_test(void) {
record_call("recording", FALSE);
}
#ifdef VIDEO_ENABLED
static void video_call_recording_test(void) {
record_call("recording", TRUE);
}
static void video_call_snapshot(void) {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc");
LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc);
LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc);
LinphoneCall *callInst = NULL;
char *filename = create_filepath(liblinphone_tester_writable_dir_prefix, "snapshot", "jpeg");
int dummy = 0;
linphone_core_enable_video_capture(marie->lc, TRUE);
linphone_core_enable_video_display(marie->lc, TRUE);
linphone_core_enable_video_capture(pauline->lc, TRUE);
linphone_core_enable_video_display(pauline->lc, FALSE);
linphone_call_params_enable_video(marieParams, TRUE);
linphone_call_params_enable_video(paulineParams, TRUE);
if((CU_ASSERT_TRUE(call_with_params(marie, pauline, marieParams, paulineParams)))
&& (CU_ASSERT_PTR_NOT_NULL(callInst = linphone_core_get_current_call(marie->lc)))) {
linphone_call_take_video_snapshot(callInst, filename);
wait_for_until(marie->lc, pauline->lc, &dummy, 1, 5000);
CU_ASSERT_EQUAL(access(filename, F_OK), 0);
// remove(filename);
}
ms_free(filename);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
#endif
test_t call_tests[] = {
{ "Early declined call", early_declined_call },
{ "Call declined", call_declined },
......@@ -2904,6 +2935,7 @@ test_t call_tests[] = {
{ "Call with ICE and video added", call_with_ice_video_added },
{ "Video call with ICE no matching audio codecs", video_call_with_ice_no_matching_audio_codecs },
{ "Video call recording", video_call_recording_test },
{ "Snapshot", video_call_snapshot },
#endif
{ "SRTP ice call", srtp_ice_call },
{ "ZRTP ice call", zrtp_ice_call },
......
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