mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
FS-7504: allow <modname>.<codecname> support so multiple modules can exist for the same codec
This commit is contained in:
committed by
Michael Jerris
parent
52d15f6398
commit
7c294f242f
@@ -115,9 +115,9 @@ SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoin
|
||||
\param name the name of the codec
|
||||
\return the desired codec interface
|
||||
*/
|
||||
SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(const char *name);
|
||||
SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(const char *name, const char *modname);
|
||||
|
||||
SWITCH_DECLARE(char *) switch_parse_codec_buf(char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit, uint32_t *channels);
|
||||
SWITCH_DECLARE(char *) switch_parse_codec_buf(char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit, uint32_t *channels, char **modname);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the dialplan interface by it's registered name
|
||||
@@ -415,6 +415,7 @@ SWITCH_DECLARE(uint32_t) switch_core_codec_next_id(void);
|
||||
#define SWITCH_ADD_CODEC(codec_int, int_name) \
|
||||
for (;;) { \
|
||||
codec_int = (switch_codec_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_CODEC_INTERFACE); \
|
||||
codec_int->modname = switch_core_strdup(pool, (*module_interface)->module_name); \
|
||||
codec_int->interface_name = switch_core_strdup(pool, int_name); \
|
||||
codec_int->codec_id = switch_core_codec_next_id(); \
|
||||
break; \
|
||||
@@ -523,6 +524,7 @@ static inline void switch_core_codec_add_implementation(switch_memory_pool_t *po
|
||||
impl->codec_id = codec_interface->codec_id;
|
||||
impl->next = codec_interface->implementations;
|
||||
impl->impl_id = switch_core_codec_next_id();
|
||||
impl->modname = codec_interface->modname;
|
||||
codec_interface->implementations = impl;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Rejected codec name: %s rate: %u ptime: %d channels: %d\n",
|
||||
@@ -571,6 +573,7 @@ static inline void switch_core_codec_add_video_implementation(switch_memory_pool
|
||||
impl->codec_id = codec_interface->codec_id;
|
||||
impl->next = codec_interface->implementations;
|
||||
impl->impl_id = switch_core_codec_next_id();
|
||||
impl->modname = codec_interface->modname;
|
||||
codec_interface->implementations = impl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user