Commit ae4298fa authored by Simon Morlat's avatar Simon Morlat

video recorder in place

parent 26e13f37
...@@ -5930,7 +5930,7 @@ static void linphone_core_uninit(LinphoneCore *lc) ...@@ -5930,7 +5930,7 @@ static void linphone_core_uninit(LinphoneCore *lc)
linphone_presence_model_unref(lc->presence_model); linphone_presence_model_unref(lc->presence_model);
} }
linphone_core_free_payload_types(lc); linphone_core_free_payload_types(lc);
if (lc->supported_formats) ms_free(lc->supported_formats);
linphone_core_message_storage_close(lc); linphone_core_message_storage_close(lc);
ms_exit(); ms_exit();
linphone_core_set_state(lc,LinphoneGlobalOff,"Off"); linphone_core_set_state(lc,LinphoneGlobalOff,"Off");
......
...@@ -2602,6 +2602,14 @@ LINPHONE_PUBLIC void linphone_core_set_tone(LinphoneCore *lc, LinphoneToneID id, ...@@ -2602,6 +2602,14 @@ LINPHONE_PUBLIC void linphone_core_set_tone(LinphoneCore *lc, LinphoneToneID id,
* */ * */
LINPHONE_PUBLIC void linphone_core_set_file_transfer_server(LinphoneCore *core, const char * server_url); LINPHONE_PUBLIC void linphone_core_set_file_transfer_server(LinphoneCore *core, const char * server_url);
/**
* Returns a null terminated table of strings containing the file format extension supported for call recording.
* @param core the core
* @return the supported formats, typically 'wav' and 'mkv'
* @ingroup media_parameters
**/
LINPHONE_PUBLIC const char ** linphone_core_get_supported_file_formats(LinphoneCore *core);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -1522,3 +1522,18 @@ const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc){ ...@@ -1522,3 +1522,18 @@ const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc){
lc->rtp_conf.srtp_suites=result; lc->rtp_conf.srtp_suites=result;
return result; return result;
} }
const char ** linphone_core_get_supported_file_formats(LinphoneCore *core){
static const char *mkv="mkv";
static const char *wav="wav";
if (core->supported_formats==NULL){
core->supported_formats=ms_malloc0(3*sizeof(char*));
core->supported_formats[0]=wav;
if (ms_factory_lookup_filter_by_id(ms_factory_get_fallback(),MS_MKV_WRITER_ID)){
core->supported_formats[1]=mkv;
}
}
return core->supported_formats;
}
...@@ -726,6 +726,7 @@ struct _LinphoneCore ...@@ -726,6 +726,7 @@ struct _LinphoneCore
MSList *tones; MSList *tones;
LinphoneReason chat_deny_code; LinphoneReason chat_deny_code;
char *file_transfer_server; char *file_transfer_server;
const char **supported_formats;
}; };
......
...@@ -983,6 +983,9 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_ ...@@ -983,6 +983,9 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_
char date[64]={0}; char date[64]={0};
time_t curtime=time(NULL); time_t curtime=time(NULL);
struct tm loctime; struct tm loctime;
const char **fmts=linphone_core_get_supported_file_formats(linphone_gtk_get_core());
int i;
const char *ext="wav";
#ifdef WIN32 #ifdef WIN32
loctime=*localtime(&curtime); loctime=*localtime(&curtime);
...@@ -991,19 +994,26 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_ ...@@ -991,19 +994,26 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_
#endif #endif
snprintf(date,sizeof(date)-1,"%i%02i%02i-%02i%02i",loctime.tm_year+1900,loctime.tm_mon+1,loctime.tm_mday, loctime.tm_hour, loctime.tm_min); snprintf(date,sizeof(date)-1,"%i%02i%02i-%02i%02i",loctime.tm_year+1900,loctime.tm_mon+1,loctime.tm_mday, loctime.tm_hour, loctime.tm_min);
for (i=0;fmts[i]!=NULL;++i){
if (strcmp(fmts[i],"mkv")==0){
ext="mkv";
break;
}
}
if (address){ if (address){
id=linphone_address_get_username(address); id=linphone_address_get_username(address);
if (id==NULL) id=linphone_address_get_domain(address); if (id==NULL) id=linphone_address_get_domain(address);
} }
if (is_conference){ if (is_conference){
snprintf(filename,sizeof(filename)-1,"%s-conference-%s.wav", snprintf(filename,sizeof(filename)-1,"%s-conference-%s.%s",
linphone_gtk_get_ui_config("title","Linphone"), linphone_gtk_get_ui_config("title","Linphone"),
date); date,ext);
}else{ }else{
snprintf(filename,sizeof(filename)-1,"%s-call-%s-%s.wav", snprintf(filename,sizeof(filename)-1,"%s-call-%s-%s.%s",
linphone_gtk_get_ui_config("title","Linphone"), linphone_gtk_get_ui_config("title","Linphone"),
date, date,
id); id,ext);
} }
if (!dir) { if (!dir) {
ms_message ("No directory for music, using [%s] instead",dir=getenv("HOME")); ms_message ("No directory for music, using [%s] instead",dir=getenv("HOME"));
......
mediastreamer2 @ a7846bc2
Subproject commit df42f0d73d930079c43ef92808529a4716e72d99 Subproject commit a7846bc24f3e5bb1cc89faf879f6d64638665585
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