Commit d63af8a7 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Created replacements for methods returning const char ** using bctbx_lists

parent def3a31e
......@@ -4142,6 +4142,24 @@ const char** linphone_core_get_video_devices(const LinphoneCore *lc){
return lc->video_conf.cams;
}
const bctbx_list_t * linphone_core_get_sound_devices_list(LinphoneCore *lc){
bctbx_list_t *cards_list = NULL;
const char** cards = lc->sound_conf.cards;
for (const char* c = *cards; c; c=*++cards) {
cards_list = bctbx_list_append(cards_list, (char *)c);
}
return cards_list;
}
const bctbx_list_t * linphone_core_get_video_devices_list(const LinphoneCore *lc){
bctbx_list_t *cards_list = NULL;
const char** cards = lc->video_conf.cams;
for (const char* c = *cards; c; c=*++cards) {
cards_list = bctbx_list_append(cards_list, (char *)c);
}
return cards_list;
}
void linphone_core_set_default_sound_devices(LinphoneCore *lc){
linphone_core_set_ringer_device(lc, NULL);
linphone_core_set_playback_device(lc, NULL);
......
......@@ -1127,6 +1127,19 @@ const char** linphone_config_get_sections_names(LpConfig *lpconfig) {
return sections_names;
}
const bctbx_list_t * linphone_config_get_sections_names_list(LpConfig *lpconfig) {
const bctbx_list_t *sections = lpconfig->sections;
bctbx_list_t *sections_names = NULL;
int i;
for (i = 0; sections != NULL; sections = sections->next, i++) {
LpSection *section = (LpSection *)sections->data;
sections_names = bctbx_list_append(sections_names, section->name);
}
return sections_names;
}
char* linphone_config_dump_as_xml(const LpConfig *lpconfig) {
char *buffer;
......
......@@ -824,6 +824,15 @@ const char ** linphone_core_get_supported_file_formats(LinphoneCore *core){
return core->supported_formats;
}
bctbx_list_t * linphone_core_get_supported_file_formats_list(LinphoneCore *core){
bctbx_list_t *file_formats = NULL;
file_formats = bctbx_list_append(file_formats, ms_strdup("wav"));
if (ms_factory_lookup_filter_by_id(core->factory,MS_MKV_RECORDER_ID)){
file_formats = bctbx_list_append(file_formats, ms_strdup("mkv"));
}
return file_formats;
}
bool_t linphone_core_file_format_supported(LinphoneCore *lc, const char *fmt){
const char **formats=linphone_core_get_supported_file_formats(lc);
for(;*formats!=NULL;++formats){
......
......@@ -2686,9 +2686,19 @@ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_get_nat_policy(const LinphoneC
* @param[in] lc LinphoneCore object
* @return An unmodifiable array of strings contanining the names of the available sound devices that is NULL terminated
* @ingroup media_parameters
* @donotwrap
* @deprecated use linphone_core_get_sound_devices_list instead
**/
LINPHONE_PUBLIC const char** linphone_core_get_sound_devices(LinphoneCore *lc);
/**
* Gets the list of the available sound devices.
* @param[in] lc LinphoneCore object
* @return \bctbx_list{char *} An unmodifiable array of strings contanining the names of the available sound devices that is NULL terminated
* @ingroup media_parameters
**/
LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_sound_devices_list(LinphoneCore *lc);
/**
* Use this function when you want to set the default sound devices
**/
......@@ -3592,9 +3602,19 @@ LINPHONE_PUBLIC void linphone_core_reload_video_devices(LinphoneCore *lc);
* @param[in] lc LinphoneCore object
* @return An unmodifiable array of strings contanining the names of the available video capture devices that is NULL terminated
* @ingroup media_parameters
* @deprecated use linphone_core_get_video_devices_list instead
* @donotwrap
**/
LINPHONE_PUBLIC const char** linphone_core_get_video_devices(const LinphoneCore *lc);
/**
* Gets the list of the available video capture devices.
* @param[in] lc LinphoneCore object
* @return \bctbx_list{char *} An unmodifiable array of strings contanining the names of the available video capture devices that is NULL terminated
* @ingroup media_parameters
**/
LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_video_devices_list(LinphoneCore *lc);
/**
* Sets the active video device.
* @param[in] lc LinphoneCore object
......@@ -4474,9 +4494,19 @@ LINPHONE_PUBLIC const char * linphone_core_get_file_transfer_server(LinphoneCore
* @param core the core
* @return the supported formats, typically 'wav' and 'mkv'
* @ingroup media_parameters
* @deprecated use linphone_core_get_supported_file_formats_list instead
* @donotwrap
**/
LINPHONE_PUBLIC const char ** linphone_core_get_supported_file_formats(LinphoneCore *core);
/**
* Returns a null terminated table of strings containing the file format extension supported for call recording.
* @param core the core
* @return \bctbx_list{char *} the supported formats, typically 'wav' and 'mkv'
* @ingroup media_parameters
**/
LINPHONE_PUBLIC bctbx_list_t * linphone_core_get_supported_file_formats_list(LinphoneCore *core);
/**
* Returns whether a specific file format is supported.
* @see linphone_core_get_supported_file_formats
......
......@@ -220,9 +220,18 @@ LINPHONE_PUBLIC void linphone_config_clean_entry(LinphoneConfig *lpconfig, const
* Returns the list of sections' names in the LinphoneConfig.
* @param[in] lpconfig The LinphoneConfig object
* @return a null terminated static array of strings
* @deprecated use linphone_config_get_sections_names_list instead
* @donotwrap
**/
LINPHONE_PUBLIC const char** linphone_config_get_sections_names(LinphoneConfig *lpconfig);
/**
* Returns the list of sections' names in the LinphoneConfig.
* @param[in] lpconfig The LinphoneConfig object
* @return \bctbx_list{char *} a null terminated static array of strings
**/
LINPHONE_PUBLIC const bctbx_list_t * linphone_config_get_sections_names_list(LpConfig *lpconfig);
/**
* Call a function for each section present in the configuration.
**/
......
......@@ -537,12 +537,14 @@ typedef enum _LinphoneIceState {
/**
* IM encryption engine.
* @ingroup misc
* @donotwrap
*/
typedef struct _LinphoneImEncryptionEngine LinphoneImEncryptionEngine;
/**
* An object to handle the callbacks for the handling a LinphoneImEncryptionEngine object.
* @ingroup misc
* @donotwrap
*/
typedef struct _LinphoneImEncryptionEngineCbs LinphoneImEncryptionEngineCbs;
......
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