FS-7504: allow <modname>.<codecname> support so multiple modules can exist for the same codec

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2015-05-28 12:47:13 -05:00
1 parent 52d15f6398
commit 7c294f242f
49 files changed
+307 -157

No files matched your search

@@ -550,6 +550,7 @@ SWITCH_STANDARD_APP(record_av_function)
if (switch_core_codec_init(&codec,
"L16",
NULL,
NULL,
force_sample_rate,
read_impl.microseconds_per_packet / 1000,
read_impl.number_of_channels, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
@@ -174,7 +174,7 @@ static switch_status_t engage_device(portaudio_stream_source_t *source, int rest
if (!switch_core_codec_ready(&source->read_codec)) {
if (switch_core_codec_init(&source->read_codec,
"L16",
NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL, NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
return SWITCH_STATUS_FALSE;
@@ -186,7 +186,7 @@ static switch_status_t engage_device(portaudio_stream_source_t *source, int rest
if (!switch_core_codec_ready(&source->write_codec)) {
if (switch_core_codec_init(&source->write_codec,
"L16",
NULL,
NULL, NULL,
sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_core_codec_destroy(&source->read_codec);
+10 -6
View File
@@ -1417,6 +1417,7 @@ SWITCH_STANDARD_APP(play_video_function)
if (switch_core_codec_init(&codec,
"L16",
NULL,
NULL,
read_impl.actual_samples_per_second,
read_impl.microseconds_per_packet/1000,
read_impl.number_of_channels, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
@@ -2301,6 +2302,7 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
if (switch_core_codec_init(&tech_pvt->read_codec,
"L16",
NULL,
NULL,
tech_pvt->read_impl.actual_samples_per_second,
tech_pvt->read_impl.microseconds_per_packet / 1000,
tech_pvt->read_impl.number_of_channels,
@@ -2312,6 +2314,7 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
if (switch_core_codec_init(&tech_pvt->write_codec,
tech_pvt->read_impl.iananame,
tech_pvt->read_impl.modname,
NULL,
tech_pvt->read_impl.actual_samples_per_second,
tech_pvt->read_impl.microseconds_per_packet / 1000,
@@ -2337,12 +2340,13 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
}
if (switch_core_codec_init(&tech_pvt->video_codec,
codec_str,
NULL,
90000,
0,
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) == SWITCH_STATUS_SUCCESS) {
codec_str,
NULL,
NULL,
90000,
0,
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG, "Video Codec Activation Success\n");
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_ERROR, "Video Codec Activation Fail\n");
+2
View File
@@ -171,6 +171,7 @@ static switch_status_t webm_file_open(switch_file_handle_t *handle, const char *
if (switch_core_codec_init(&context->audio_codec,
AUDIO_CODEC,
NULL,
fmtp,
handle->samplerate,
20,//ms
@@ -186,6 +187,7 @@ static switch_status_t webm_file_open(switch_file_handle_t *handle, const char *
if (switch_core_codec_init(&context->video_codec,
"VP8",
NULL,
NULL,
90000,
0,//ms
1, SWITCH_CODEC_FLAG_ENCODE,