Commit e78a360a authored by Svalorzen's avatar Svalorzen Committed by Gautier Pelloux-Prayer

Modified soundcard show command to show whether we are using files or not

parent d08bd4a4
...@@ -1243,12 +1243,16 @@ static int lpc_cmd_soundcard(LinphoneCore *lc, char *args) ...@@ -1243,12 +1243,16 @@ static int lpc_cmd_soundcard(LinphoneCore *lc, char *args)
if (strcmp(arg1, "show")==0) if (strcmp(arg1, "show")==0)
{ {
linphonec_out("Ringer device: %s\n", if (linphone_core_get_use_files(lc)) {
linphone_core_get_ringer_device(lc)); linphonec_out("Using files.\n");
linphonec_out("Playback device: %s\n", } else {
linphone_core_get_playback_device(lc)); linphonec_out("Ringer device: %s\n",
linphonec_out("Capture device: %s\n", linphone_core_get_ringer_device(lc));
linphone_core_get_capture_device(lc)); linphonec_out("Playback device: %s\n",
linphone_core_get_playback_device(lc));
linphonec_out("Capture device: %s\n",
linphone_core_get_capture_device(lc));
}
return 1; return 1;
} }
......
...@@ -1235,7 +1235,7 @@ static MSList *add_missing_supported_codecs(LinphoneCore *lc, const MSList *defa ...@@ -1235,7 +1235,7 @@ static MSList *add_missing_supported_codecs(LinphoneCore *lc, const MSList *defa
if (!elem2){ if (!elem2){
PayloadType *pt=(PayloadType*)elem->data; PayloadType *pt=(PayloadType*)elem->data;
/*this codec from default list should be inserted in the list*/ /*this codec from default list should be inserted in the list*/
if (!linphone_core_codec_supported(lc, payload_type_get_stream_type(pt), pt->mime_type)) continue; if (!linphone_core_codec_supported(lc, payload_type_get_stream_type(pt), pt->mime_type)) continue;
if (!last_inserted){ if (!last_inserted){
l=ms_list_prepend(l,pt); l=ms_list_prepend(l,pt);
...@@ -1712,14 +1712,14 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab ...@@ -1712,14 +1712,14 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up"); linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up");
ortp_init(); ortp_init();
linphone_core_activate_log_serialization_if_needed(); linphone_core_activate_log_serialization_if_needed();
lc->factory = ms_factory_new_with_voip(); lc->factory = ms_factory_new_with_voip();
linphone_core_register_default_codecs(lc); linphone_core_register_default_codecs(lc);
linphone_core_register_offer_answer_providers(lc); linphone_core_register_offer_answer_providers(lc);
/* Get the mediastreamer2 event queue */ /* Get the mediastreamer2 event queue */
/* This allows to run event's callback in linphone_core_iterate() */ /* This allows to run event's callback in linphone_core_iterate() */
lc->msevq=ms_factory_create_event_queue(lc->factory); lc->msevq=ms_factory_create_event_queue(lc->factory);
lc->sal=sal_init(lc->factory); lc->sal=sal_init(lc->factory);
sal_set_http_proxy_host(lc->sal, linphone_core_get_http_proxy_host(lc)); sal_set_http_proxy_host(lc->sal, linphone_core_get_http_proxy_host(lc));
sal_set_http_proxy_port(lc->sal, linphone_core_get_http_proxy_port(lc)); sal_set_http_proxy_port(lc->sal, linphone_core_get_http_proxy_port(lc));
...@@ -5884,6 +5884,10 @@ void linphone_core_set_use_files(LinphoneCore *lc, bool_t yesno){ ...@@ -5884,6 +5884,10 @@ void linphone_core_set_use_files(LinphoneCore *lc, bool_t yesno){
lc->use_files=yesno; lc->use_files=yesno;
} }
bool_t linphone_core_get_use_files(LinphoneCore *lc) {
return lc->use_files;
}
const char * linphone_core_get_play_file(const LinphoneCore *lc) { const char * linphone_core_get_play_file(const LinphoneCore *lc) {
return lc->play_file; return lc->play_file;
} }
...@@ -6466,7 +6470,7 @@ static void linphone_core_uninit(LinphoneCore *lc) ...@@ -6466,7 +6470,7 @@ static void linphone_core_uninit(LinphoneCore *lc)
linphone_core_set_state(lc,LinphoneGlobalOff,"Off"); linphone_core_set_state(lc,LinphoneGlobalOff,"Off");
linphone_core_deactivate_log_serialization_if_needed(); linphone_core_deactivate_log_serialization_if_needed();
ms_list_free_with_data(lc->vtable_refs,(void (*)(void *))v_table_reference_destroy); ms_list_free_with_data(lc->vtable_refs,(void (*)(void *))v_table_reference_destroy);
ms_factory_destroy(lc->factory); ms_factory_destroy(lc->factory);
} }
......
...@@ -3685,6 +3685,15 @@ void linphone_core_show_video(LinphoneCore *lc, bool_t show); ...@@ -3685,6 +3685,15 @@ void linphone_core_show_video(LinphoneCore *lc, bool_t show);
**/ **/
LINPHONE_PUBLIC void linphone_core_set_use_files(LinphoneCore *lc, bool_t yesno); LINPHONE_PUBLIC void linphone_core_set_use_files(LinphoneCore *lc, bool_t yesno);
/**
* Gets whether linphone is currently streaming audio from and to files, rather
* than using the soundcard.
* @ingroup media_parameters
* @param[in] lc LinphoneCore object
* @return A boolean value representing whether linphone is streaming audio from and to files or not.
**/
LINPHONE_PUBLIC bool_t linphone_core_get_use_files(LinphoneCore *lc);
/** /**
* Get the wav file that is played when putting somebody on hold, * Get the wav file that is played when putting somebody on hold,
* or when files are used instead of soundcards (see linphone_core_set_use_files()). * or when files are used instead of soundcards (see linphone_core_set_use_files()).
......
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