RTS API Documentation  1.10.11
Macros | Functions
Codec Functions
+ Collaboration diagram for Codec Functions:

Macros

#define switch_core_codec_init(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, _flags, _codec_settings, _pool)   switch_core_codec_init_with_bitrate(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, 0, _flags, _codec_settings, _pool)
 Initialize a codec handle. More...
 

Functions

switch_status_t switch_core_codec_init_with_bitrate (switch_codec_t *codec, const char *codec_name, const char *fmtp, const char *modname, uint32_t rate, int ms, int channels, uint32_t bitrate, uint32_t flags, const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
 
switch_status_t switch_core_codec_copy (switch_codec_t *codec, switch_codec_t *new_codec, const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
 
switch_status_t switch_core_codec_parse_fmtp (const char *codec_name, const char *fmtp, uint32_t rate, switch_codec_fmtp_t *codec_fmtp)
 
switch_status_t switch_core_codec_reset (switch_codec_t *codec)
 
switch_status_t switch_core_codec_encode (switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data, uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
 Encode data using a codec handle. More...
 
switch_status_t switch_core_codec_decode (switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data, uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
 Decode data using a codec handle. More...
 
switch_status_t switch_core_codec_encode_video (switch_codec_t *codec, switch_frame_t *frame)
 Encode video data using a codec handle. More...
 
switch_status_t switch_core_codec_control (switch_codec_t *codec, switch_codec_control_command_t cmd, switch_codec_control_type_t ctype, void *cmd_data, switch_codec_control_type_t atype, void *cmd_arg, switch_codec_control_type_t *rtype, void **ret_data)
 send control data using a codec handle More...
 
switch_status_t switch_core_codec_decode_video (switch_codec_t *codec, switch_frame_t *frame)
 Decode video data using a codec handle. More...
 
switch_status_t switch_core_codec_destroy (switch_codec_t *codec)
 Destroy an initalized codec handle. More...
 
switch_status_t switch_core_session_set_read_codec (_In_ switch_core_session_t *session, switch_codec_t *codec)
 Assign the read codec to a given session. More...
 
switch_status_t switch_core_session_set_real_read_codec (_In_ switch_core_session_t *session, switch_codec_t *codec)
 Assign the original read codec to a given session. This is the read codec used by an endpoint. More...
 
void switch_core_session_unset_read_codec (_In_ switch_core_session_t *session)
 
void switch_core_session_unset_write_codec (_In_ switch_core_session_t *session)
 
void switch_core_session_lock_codec_write (_In_ switch_core_session_t *session)
 
void switch_core_session_unlock_codec_write (_In_ switch_core_session_t *session)
 
void switch_core_session_lock_codec_read (_In_ switch_core_session_t *session)
 
void switch_core_session_unlock_codec_read (_In_ switch_core_session_t *session)
 
void switch_core_codec_lock_full (switch_core_session_t *session)
 Lock codec read mutex and codec write mutex using trylock in an infinite loop. More...
 
void switch_core_codec_unlock_full (switch_core_session_t *session)
 Unlock codec read mutex and codec write mutex. More...
 
switch_status_t switch_core_session_get_read_impl (switch_core_session_t *session, switch_codec_implementation_t *impp)
 
switch_status_t switch_core_session_get_real_read_impl (switch_core_session_t *session, switch_codec_implementation_t *impp)
 
switch_status_t switch_core_session_get_write_impl (switch_core_session_t *session, switch_codec_implementation_t *impp)
 
switch_status_t switch_core_session_get_video_read_impl (switch_core_session_t *session, switch_codec_implementation_t *impp)
 
switch_status_t switch_core_session_get_video_write_impl (switch_core_session_t *session, switch_codec_implementation_t *impp)
 
switch_codec_tswitch_core_session_get_read_codec (_In_ switch_core_session_t *session)
 Retrieve the read codec from a given session. More...
 
switch_codec_tswitch_core_session_get_effective_read_codec (_In_ switch_core_session_t *session)
 Retrieve the effevtive read codec from a given session. More...
 
switch_status_t switch_core_session_set_write_codec (_In_ switch_core_session_t *session, switch_codec_t *codec)
 Assign the write codec to a given session. More...
 
switch_codec_tswitch_core_session_get_write_codec (_In_ switch_core_session_t *session)
 Retrieve the write codec from a given session. More...
 
switch_codec_tswitch_core_session_get_effective_write_codec (_In_ switch_core_session_t *session)
 Retrieve the effevtive write codec from a given session. More...
 
switch_status_t switch_core_session_set_video_read_codec (_In_ switch_core_session_t *session, switch_codec_t *codec)
 Assign the video_read codec to a given session. More...
 
switch_codec_tswitch_core_session_get_video_read_codec (_In_ switch_core_session_t *session)
 Retrieve the video_read codec from a given session. More...
 
switch_status_t switch_core_session_set_video_write_codec (_In_ switch_core_session_t *session, switch_codec_t *codec)
 Assign the video_write codec to a given session. More...
 
switch_codec_tswitch_core_session_get_video_write_codec (_In_ switch_core_session_t *session)
 Retrieve the video_write codec from a given session. More...
 

Detailed Description

Macro Definition Documentation

◆ switch_core_codec_init

#define switch_core_codec_init (   _codec,
  _codec_name,
  _modname,
  _fmtp,
  _rate,
  _ms,
  _channels,
  _flags,
  _codec_settings,
  _pool 
)    switch_core_codec_init_with_bitrate(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, 0, _flags, _codec_settings, _pool)

Initialize a codec handle.

Parameters
codecthe handle to initilize
codec_namethe name of the codec module to use
fmtpcodec parameters to send
ratethe desired rate (0 for any)
msthe desired number of milliseconds (0 for any)
channelsthe desired number of channels (0 for any)
flagsflags to alter behaviour
codec_settingsdesired codec settings
poolthe memory pool to use
Returns
SWITCH_STATUS_SUCCESS if the handle is allocated

Definition at line 1693 of file switch_core.h.

Referenced by audio_bridge_thread(), early_thread_run(), setup_ringback(), switch_core_codec_copy(), switch_core_media_set_video_codec(), switch_core_session_set_codec_slin(), switch_ivr_activate_unicast(), switch_ivr_collect_digits_count(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), and switch_rtp_enable_vad().

Function Documentation

◆ switch_core_codec_control()

switch_status_t switch_core_codec_control ( switch_codec_t codec,
switch_codec_control_command_t  cmd,
switch_codec_control_type_t  ctype,
void *  cmd_data,
switch_codec_control_type_t  atype,
void *  cmd_arg,
switch_codec_control_type_t rtype,
void **  ret_data 
)

send control data using a codec handle

Parameters
codecthe codec handle to use
cmdthe command to send
ctypethe type of the arguement
cmd_dataa void pointer to the data matching the passed type
atypethe type of the extra arguement
cmd_arga void pointer to the data matching the passed type
rtypethe type of the response if any
ret_dataa void pointer to a pointer of return data
Returns
SWITCH_STATUS_SUCCESS if the command was received

Definition at line 903 of file switch_core_codec.c.

References switch_codec_implementation::codec_control, switch_codec::implementation, switch_codec::mutex, switch_assert, SWITCH_CHANNEL_LOG, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_FALSE.

Referenced by switch_core_media_codec_control(), switch_core_media_receive_message(), switch_core_media_set_outgoing_bitrate(), and switch_core_session_stop_media().

911 {
912 
914 
915 
916  switch_assert(codec != NULL);
917 
918 
919  if (!codec->implementation || !switch_core_codec_ready(codec)) {
920  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n");
921  abort();
922  //return SWITCH_STATUS_NOT_INITALIZED;
923  }
924 
925 
926  if (codec->mutex) switch_mutex_lock(codec->mutex);
927 
928  if (codec->implementation->codec_control) {
929  status = codec->implementation->codec_control(codec, cmd, ctype, cmd_data, atype, cmd_arg, rtype, ret_data);
930  }
931 
932  if (codec->mutex) switch_mutex_unlock(codec->mutex);
933 
934 
935  return status;
936 }
#define SWITCH_CHANNEL_LOG
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
const switch_codec_implementation_t * implementation
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_status_t
Common return values.
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
#define switch_assert(expr)
switch_core_codec_control_func_t codec_control

◆ switch_core_codec_copy()

switch_status_t switch_core_codec_copy ( switch_codec_t codec,
switch_codec_t new_codec,
const switch_codec_settings_t codec_settings,
switch_memory_pool_t pool 
)

Definition at line 641 of file switch_core_codec.c.

References switch_codec_implementation::actual_samples_per_second, switch_codec::flags, switch_codec::fmtp_in, switch_codec_implementation::iananame, switch_codec::implementation, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::modname, switch_codec_implementation::number_of_channels, switch_codec_implementation::samples_per_second, switch_assert, and switch_core_codec_init.

Referenced by switch_core_session_read_frame().

643 {
644  uint32_t codec_rate;
645  switch_assert(codec != NULL);
646  switch_assert(new_codec != NULL);
647 
648  codec_rate = !strcasecmp(codec->implementation->iananame, "g722")
650 
651  return switch_core_codec_init(new_codec,
652  codec->implementation->iananame,
653  codec->implementation->modname,
654  codec->fmtp_in,
655  codec_rate,
658  codec->flags,
659  codec_settings,
660  pool);
661 
662 }
switch_memory_pool_t * pool
const switch_codec_implementation_t * implementation
#define switch_core_codec_init(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, _flags, _codec_settings, _pool)
Initialize a codec handle.
Definition: switch_core.h:1693
#define switch_assert(expr)

◆ switch_core_codec_decode()

switch_status_t switch_core_codec_decode ( switch_codec_t codec,
switch_codec_t other_codec,
void *  encoded_data,
uint32_t  encoded_data_len,
uint32_t  encoded_rate,
void *  decoded_data,
uint32_t *  decoded_data_len,
uint32_t *  decoded_rate,
unsigned int *  flag 
)

Decode data using a codec handle.

Parameters
codecthe codec handle to use
other_codecthe codec handle of the last codec used
encoded_datathe buffer to read the encoded data from
encoded_data_lenthe size of the encoded_data buffer
encoded_ratethe rate of the encoded data
decoded_datathe raw data buffer
decoded_data_lenthen length of the raw buffer
decoded_ratethe new rate of the decoded data
flagflags to exchange
Returns
SWITCH_STATUS_SUCCESS if the data was decoded
Note
decoded_data_len will be rewritten to the in-use size of decoded_data

Definition at line 796 of file switch_core_codec.c.

References switch_codec_implementation::decode, switch_codec_implementation::decoded_bytes_per_packet, switch_codec_implementation::encoded_bytes_per_packet, switch_codec::implementation, memset(), switch_codec::mutex, switch_codec_implementation::number_of_channels, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_DECODE, switch_core_codec_ready(), SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, and switch_test_flag.

Referenced by main(), rtp_common_write(), switch_core_session_read_frame(), switch_core_session_write_frame(), and switch_ivr_park().

802 {
803  switch_status_t status;
804 
805  switch_assert(codec != NULL);
806  switch_assert(encoded_data != NULL);
807  switch_assert(decoded_data != NULL);
808 
809  if (!codec->implementation || !switch_core_codec_ready(codec)) {
810  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decode Codec is not initialized!\n");
812  }
813 
815  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec decoder is not initialized!\n");
817  }
818 
820  uint32_t frames = encoded_data_len / codec->implementation->encoded_bytes_per_packet / codec->implementation->number_of_channels;
821 
822  if (frames && codec->implementation->decoded_bytes_per_packet * frames > *decoded_data_len) {
823  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Buffer size sanity check failed! edl:%u ebpp:%u fr:%u ddl:%u\n",
824  encoded_data_len, codec->implementation->encoded_bytes_per_packet, frames, *decoded_data_len);
825  *decoded_data_len = codec->implementation->decoded_bytes_per_packet;
826  memset(decoded_data, 255, *decoded_data_len);
827  return SWITCH_STATUS_SUCCESS;
828  }
829  }
830 
831  if (codec->mutex) switch_mutex_lock(codec->mutex);
832  status = codec->implementation->decode(codec, other_codec, encoded_data, encoded_data_len, encoded_rate,
833  decoded_data, decoded_data_len, decoded_rate, flag);
834  if (codec->mutex) switch_mutex_unlock(codec->mutex);
835 
836  return status;
837 }
#define SWITCH_CHANNEL_LOG
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
const switch_codec_implementation_t * implementation
switch_core_codec_decode_func_t decode
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_status_t
Common return values.
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
Definition: switch_utils.h:693
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
#define switch_assert(expr)
memset(buf, 0, buflen)

◆ switch_core_codec_decode_video()

switch_status_t switch_core_codec_decode_video ( switch_codec_t codec,
switch_frame_t frame 
)

Decode video data using a codec handle.

Parameters
codecthe codec handle to use
framethe frame to be decoded
imgthe new image in I420 format, allocated by the codec
flagflags to exchange
Returns
SWITCH_STATUS_SUCCESS if the data was decoded, and a non-NULL img

Definition at line 875 of file switch_core_codec.c.

References switch_codec_implementation::decode_video, switch_codec::implementation, switch_codec::mutex, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_DECODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.

Referenced by switch_core_session_read_video_frame().

876 {
878 
879  switch_assert(codec != NULL);
880  switch_assert(frame != NULL);
881 
882  if (!codec->implementation || !switch_core_codec_ready(codec)) {
883  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decode Codec is not initialized!\n");
885  }
886 
888  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec decoder is not initialized!\n");
890  }
891 
892  if (codec->mutex) switch_mutex_lock(codec->mutex);
893 
894  if (codec->implementation->decode_video) {
895  status = codec->implementation->decode_video(codec, frame);
896  }
897  if (codec->mutex) switch_mutex_unlock(codec->mutex);
898 
899  return status;
900 }
#define SWITCH_CHANNEL_LOG
switch_core_codec_video_decode_func_t decode_video
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
const switch_codec_implementation_t * implementation
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_status_t
Common return values.
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
Definition: switch_utils.h:693
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
#define switch_assert(expr)

◆ switch_core_codec_destroy()

switch_status_t switch_core_codec_destroy ( switch_codec_t codec)

Destroy an initalized codec handle.

Parameters
codecthe codec handle to destroy
Returns
SWITCH_STATUS_SUCCESS if the codec was destroyed

Definition at line 938 of file switch_core_codec.c.

References switch_codec::codec_interface, switch_codec_implementation::destroy, switch_codec::implementation, switch_codec::memory_pool, memset(), switch_codec::mutex, mutex, pool, switch_assert, SWITCH_CHANNEL_LOG, switch_clear_flag, SWITCH_CODEC_FLAG_FREE_POOL, SWITCH_CODEC_FLAG_READY, switch_core_codec_ready(), switch_core_destroy_memory_pool, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, switch_test_flag, and UNPROTECT_INTERFACE.

Referenced by audio_bridge_thread(), early_thread_run(), main(), switch_core_media_bug_prune(), switch_core_media_bug_remove(), switch_core_media_bug_remove_all_function(), switch_core_media_bug_remove_callback(), switch_core_media_bug_transfer_callback(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_session_raw_read(), switch_core_session_reset(), switch_core_session_set_real_read_codec(), switch_ivr_clear_speech_cache(), switch_ivr_collect_digits_count(), switch_ivr_deactivate_unicast(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_wait_for_answer(), switch_ivr_wait_for_silence(), switch_media_handle_destroy(), and switch_rtp_disable_vad().

939 {
940  switch_mutex_t *mutex = NULL;
941  switch_memory_pool_t *pool = NULL;
942  int free_pool = 0;
943 
944  switch_assert(codec != NULL);
945  mutex = codec->mutex;
946  pool = codec->memory_pool;
947 
948  if (mutex) switch_mutex_lock(mutex);
949 
950  if (switch_core_codec_ready(codec)) {
952  } else {
953  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec is not initialized!\n");
954  if (mutex) switch_mutex_unlock(mutex);
956  }
957 
959  free_pool = 1;
960  }
961 
962  codec->implementation->destroy(codec);
963 
965 
966  if (mutex) switch_mutex_unlock(mutex);
967 
968  if (free_pool) {
970  }
971 
972  memset(codec, 0, sizeof(*codec));
973 
974  return SWITCH_STATUS_SUCCESS;
975 }
#define SWITCH_CHANNEL_LOG
switch_core_codec_destroy_func_t destroy
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
Definition: switch_core.h:642
switch_memory_pool_t * pool
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
#define UNPROTECT_INTERFACE(_it)
#define switch_clear_flag(obj, flag)
Clear a flag on an arbitrary object while locked.
Definition: switch_utils.h:724
const switch_codec_implementation_t * implementation
switch_codec_interface_t * codec_interface
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_memory_pool_t * memory_pool
switch_mutex_t * mutex
struct fspr_thread_mutex_t switch_mutex_t
Definition: switch_apr.h:314
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
Definition: switch_utils.h:693
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
struct fspr_pool_t switch_memory_pool_t
#define switch_assert(expr)
memset(buf, 0, buflen)

◆ switch_core_codec_encode()

switch_status_t switch_core_codec_encode ( switch_codec_t codec,
switch_codec_t other_codec,
void *  decoded_data,
uint32_t  decoded_data_len,
uint32_t  decoded_rate,
void *  encoded_data,
uint32_t *  encoded_data_len,
uint32_t *  encoded_rate,
unsigned int *  flag 
)

Encode data using a codec handle.

Parameters
codecthe codec handle to use
other_codecthe codec handle of the last codec used
decoded_datathe raw data
decoded_data_lenthen length of the raw buffer
decoded_ratethe rate of the decoded data
encoded_datathe buffer to write the encoded data to
encoded_data_lenthe size of the encoded_data buffer
encoded_ratethe new rate of the encoded data
flagflags to exchange
Returns
SWITCH_STATUS_SUCCESS if the data was encoded
Note
encoded_data_len will be rewritten to the in-use size of encoded_data

Definition at line 764 of file switch_core_codec.c.

References switch_codec_implementation::encode, switch_codec::implementation, switch_codec::mutex, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.

Referenced by main(), switch_core_session_read_frame(), and switch_core_session_write_frame().

770 {
771  switch_status_t status;
772 
773  switch_assert(codec != NULL);
774  switch_assert(encoded_data != NULL);
775  switch_assert(decoded_data != NULL);
776 
777  if (!codec->implementation || !switch_core_codec_ready(codec)) {
778  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n");
780  }
781 
783  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec encoder is not initialized!\n");
785  }
786 
787  if (codec->mutex) switch_mutex_lock(codec->mutex);
788  status = codec->implementation->encode(codec, other_codec, decoded_data, decoded_data_len,
789  decoded_rate, encoded_data, encoded_data_len, encoded_rate, flag);
790  if (codec->mutex) switch_mutex_unlock(codec->mutex);
791 
792  return status;
793 
794 }
#define SWITCH_CHANNEL_LOG
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
const switch_codec_implementation_t * implementation
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_status_t
Common return values.
switch_core_codec_encode_func_t encode
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
Definition: switch_utils.h:693
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
#define switch_assert(expr)

◆ switch_core_codec_encode_video()

switch_status_t switch_core_codec_encode_video ( switch_codec_t codec,
switch_frame_t frame 
)

Encode video data using a codec handle.

Parameters
codecthe codec handle to use
framethe frame to encode

Definition at line 839 of file switch_core_codec.c.

References switch_frame::datalen, switch_codec_implementation::encode_video, switch_frame::flags, switch_codec::implementation, switch_codec::mutex, switch_frame::packetlen, SFF_SAME_IMAGE, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_ready(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_NOT_INITALIZED, and switch_test_flag.

Referenced by switch_core_session_write_video_frame().

840 {
842 
843  switch_assert(codec != NULL);
844 
845  if (!codec->implementation || !switch_core_codec_ready(codec)) {
846  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n");
848  }
849 
851  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec encoder is not initialized!\n");
853  }
854 
855  if (codec->mutex) switch_mutex_lock(codec->mutex);
856 
857  if (codec->implementation->encode_video) {
858  status = codec->implementation->encode_video(codec, frame);
859 
860  if (status == SWITCH_STATUS_MORE_DATA) {
861  frame->flags |= SFF_SAME_IMAGE;
862  } else {
863  frame->flags &= ~SFF_SAME_IMAGE;
864  }
865 
866  frame->packetlen = frame->datalen + 12;
867  }
868 
869  if (codec->mutex) switch_mutex_unlock(codec->mutex);
870 
871  return status;
872 
873 }
#define SWITCH_CHANNEL_LOG
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
const switch_codec_implementation_t * implementation
uint32_t datalen
Definition: switch_frame.h:68
uint32_t packetlen
Definition: switch_frame.h:62
switch_frame_flag_t flags
Definition: switch_frame.h:85
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
Definition: switch_apr.c:308
switch_status_t
Common return values.
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
Definition: switch_utils.h:693
static switch_bool_t switch_core_codec_ready(switch_codec_t *codec)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
switch_mutex_t * mutex
switch_core_codec_video_encode_func_t encode_video
#define switch_assert(expr)

◆ switch_core_codec_init_with_bitrate()

switch_status_t switch_core_codec_init_with_bitrate ( switch_codec_t codec,
const char *  codec_name,
const char *  fmtp,
const char *  modname,
uint32_t  rate,
int  ms,
int  channels,
uint32_t  bitrate,
uint32_t  flags,
const switch_codec_settings_t codec_settings,
switch_memory_pool_t pool 
)

Definition at line 664 of file switch_core_codec.c.

References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::bits_per_second, switch_codec::codec_interface, switch_cache_db_handle::flags, switch_codec::flags, switch_codec::fmtp_in, switch_codec::implementation, switch_codec_interface::implementations, switch_codec_implementation::init, switch_codec::memory_pool, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec::mutex, switch_codec_implementation::next, switch_codec_implementation::number_of_channels, pool, switch_codec_implementation::samples_per_second, switch_codec::session, switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CODEC_FLAG_FREE_POOL, SWITCH_CODEC_FLAG_READY, switch_core_memory_pool_get_data(), switch_core_new_memory_pool, switch_core_strdup, switch_loadable_module_get_codec_interface(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_set_flag, SWITCH_STATUS_GENERR, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_SUCCESS, and UNPROTECT_INTERFACE.

Referenced by main(), and switch_core_media_set_codec().

667 {
668  switch_codec_interface_t *codec_interface;
669  const switch_codec_implementation_t *iptr, *implementation = NULL;
670 
671  switch_assert(codec != NULL);
672  switch_assert(codec_name != NULL);
673 
674  memset(codec, 0, sizeof(*codec));
675 
676  if (pool) {
677  codec->session = switch_core_memory_pool_get_data(pool, "__session");
678  }
679 
680  if (strchr(codec_name, '.')) {
681  char *p = NULL;
682  codec_name = switch_core_strdup(pool, codec_name);
683  if ((p = strchr(codec_name, '.'))) {
684  *p++ = '\0';
685  modname = codec_name;
686  codec_name = p;
687  }
688  }
689 
690  if ((codec_interface = switch_loadable_module_get_codec_interface(codec_name, modname)) == 0) {
691  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid codec %s!\n", codec_name);
692  return SWITCH_STATUS_GENERR;
693  }
694 
695  if (!strncasecmp(codec_name, "PROXY", 5)) {
696  for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
697  if (!channels || channels == iptr->number_of_channels) {
698  implementation = iptr;
699  break;
700  }
701  }
702 
703  goto found;
704  }
705 
706  /* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
707  if (!ms) {
708  for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
709  uint32_t crate = !strcasecmp(codec_name, "g722") ? iptr->samples_per_second : iptr->actual_samples_per_second;
710  if ((!rate || rate == crate) && (!bitrate || bitrate == (uint32_t)iptr->bits_per_second) &&
711  (20 == (iptr->microseconds_per_packet / 1000)) && (!channels || channels == iptr->number_of_channels)) {
712  implementation = iptr;
713  goto found;
714  }
715  }
716  }
717 
718  /* Either looking for a specific interval or there was no interval specified and there wasn't one @20ms available */
719  for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
720  uint32_t crate = !strcasecmp(codec_name, "g722") ? iptr->samples_per_second : iptr->actual_samples_per_second;
721  if ((!rate || rate == crate) && (!bitrate || bitrate == (uint32_t)iptr->bits_per_second) &&
722  (!ms || ms == (iptr->microseconds_per_packet / 1000)) && (!channels || channels == iptr->number_of_channels)) {
723  implementation = iptr;
724  break;
725  }
726  }
727 
728  found:
729 
730  if (implementation) {
731  switch_status_t status;
732  codec->codec_interface = codec_interface;
733  codec->implementation = implementation;
734  codec->flags = flags;
735 
736  if (pool) {
737  codec->memory_pool = pool;
738  } else {
740  return status;
741  }
743  }
744 
745  if (fmtp) {
746  codec->fmtp_in = switch_core_strdup(codec->memory_pool, fmtp);
747  }
748 
749  implementation->init(codec, flags, codec_settings);
752  return SWITCH_STATUS_SUCCESS;
753  } else {
754  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec %s Exists but not at the desired implementation. %dhz %dms %dch\n",
755  codec_name, rate, ms, channels);
756 
757  }
758 
759  UNPROTECT_INTERFACE(codec_interface);
760 
761  return SWITCH_STATUS_NOTIMPL;
762 }
switch_core_session_t * session
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
Definition: switch_core.h:633
#define switch_set_flag(obj, flag)
Set a flag on an arbitrary object.
Definition: switch_utils.h:700
#define SWITCH_CHANNEL_LOG
#define switch_core_strdup(_pool, _todup)
Copy a string using memory allocation from a given pool.
Definition: switch_core.h:733
switch_memory_pool_t * pool
switch_codec_implementation_t * implementations
void * switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key)
#define UNPROTECT_INTERFACE(_it)
#define SWITCH_MUTEX_NESTED
Definition: switch_apr.h:318
const switch_codec_implementation_t * implementation
switch_codec_interface_t * codec_interface
switch_memory_pool_t * memory_pool
Top level module interface to implement a series of codec implementations.
switch_status_t switch_mutex_init(switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool)
Definition: switch_apr.c:293
switch_codec_interface_t * switch_loadable_module_get_codec_interface(const char *name, const char *modname)
Retrieve the codec interface by it's registered name.
switch_status_t
Common return values.
switch_core_codec_init_func_t init
struct switch_codec_implementation * next
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
A table of settings and callbacks that define a paticular implementation of a codec.
switch_mutex_t * mutex
#define switch_assert(expr)
memset(buf, 0, buflen)

◆ switch_core_codec_lock_full()

void switch_core_codec_lock_full ( switch_core_session_t session)

Lock codec read mutex and codec write mutex using trylock in an infinite loop.

Parameters
sessionsession to lock the codec in

Definition at line 62 of file switch_core_codec.c.

References switch_core_session::codec_read_mutex, switch_core_session::codec_write_mutex, switch_cond_next(), switch_mutex_trylock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.

Referenced by switch_core_media_set_codec(), and switch_core_session_reset().

63 {
64  do {
67  return;
68  }
69 
71  }
72 
74  } while (1);
75 }
switch_status_t switch_mutex_trylock(switch_mutex_t *lock)
Definition: switch_apr.c:318
switch_mutex_t * codec_write_mutex
switch_mutex_t * codec_read_mutex
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313
void switch_cond_next(void)
Definition: switch_time.c:658

◆ switch_core_codec_parse_fmtp()

switch_status_t switch_core_codec_parse_fmtp ( const char *  codec_name,
const char *  fmtp,
uint32_t  rate,
switch_codec_fmtp_t codec_fmtp 
)

Definition at line 607 of file switch_core_codec.c.

References switch_codec_fmtp::actual_samples_per_second, memset(), switch_codec_interface::parse_fmtp, switch_loadable_module_get_codec_interface(), SWITCH_STATUS_FALSE, UNPROTECT_INTERFACE, and zstr.

Referenced by add_audio_codec(), and switch_core_media_negotiate_sdp().

608 {
609  switch_codec_interface_t *codec_interface;
611 
612  if (zstr(codec_name) || zstr(fmtp) || !codec_fmtp) {
613  return SWITCH_STATUS_FALSE;
614  }
615 
616  memset(codec_fmtp, 0, sizeof(*codec_fmtp));
617 
618  if ((codec_interface = switch_loadable_module_get_codec_interface(codec_name, NULL))) {
619  if (codec_interface->parse_fmtp) {
620  codec_fmtp->actual_samples_per_second = rate;
621  status = codec_interface->parse_fmtp(fmtp, codec_fmtp);
622  }
623 
624  UNPROTECT_INTERFACE(codec_interface);
625  }
626 
627  return status;
628 }
#define zstr(x)
Definition: switch_utils.h:314
#define UNPROTECT_INTERFACE(_it)
Top level module interface to implement a series of codec implementations.
switch_codec_interface_t * switch_loadable_module_get_codec_interface(const char *name, const char *modname)
Retrieve the codec interface by it's registered name.
switch_status_t
Common return values.
switch_core_codec_fmtp_parse_func_t parse_fmtp
memset(buf, 0, buflen)

◆ switch_core_codec_reset()

switch_status_t switch_core_codec_reset ( switch_codec_t codec)

Definition at line 630 of file switch_core_codec.c.

References switch_codec_implementation::destroy, switch_codec::flags, switch_codec::implementation, switch_codec_implementation::init, switch_assert, and SWITCH_STATUS_SUCCESS.

Referenced by switch_core_session_read_frame(), and switch_core_session_write_frame().

631 {
632  switch_assert(codec != NULL);
633 
634  codec->implementation->destroy(codec);
635  codec->implementation->init(codec, codec->flags, NULL);
636 
637  return SWITCH_STATUS_SUCCESS;
638 }
switch_core_codec_destroy_func_t destroy
const switch_codec_implementation_t * implementation
switch_core_codec_init_func_t init
#define switch_assert(expr)

◆ switch_core_codec_unlock_full()

void switch_core_codec_unlock_full ( switch_core_session_t session)

Unlock codec read mutex and codec write mutex.

Parameters
sessionsession to unlock the codec in

Definition at line 77 of file switch_core_codec.c.

References switch_core_session::codec_read_mutex, switch_core_session::codec_write_mutex, and switch_mutex_unlock().

Referenced by switch_core_media_set_codec(), and switch_core_session_reset().

78 {
81 }
switch_mutex_t * codec_write_mutex
switch_mutex_t * codec_read_mutex
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
Definition: switch_apr.c:313

◆ switch_core_session_get_effective_read_codec()

switch_codec_t* switch_core_session_get_effective_read_codec ( _In_ switch_core_session_t session)

Retrieve the effevtive read codec from a given session.

Parameters
sessionsession to retrieve from
Returns
a pointer to the codec

◆ switch_core_session_get_effective_write_codec()

switch_codec_t* switch_core_session_get_effective_write_codec ( _In_ switch_core_session_t session)

Retrieve the effevtive write codec from a given session.

Parameters
sessionsession to retrieve from
Returns
a pointer to the codec

◆ switch_core_session_get_read_codec()

switch_codec_t* switch_core_session_get_read_codec ( _In_ switch_core_session_t session)

◆ switch_core_session_get_read_impl()

switch_status_t switch_core_session_get_read_impl ( switch_core_session_t session,
switch_codec_implementation_t impp 
)

Definition at line 346 of file switch_core_codec.c.

References switch_codec_implementation::codec_id, memset(), switch_codec_implementation::number_of_channels, switch_core_session::read_impl, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.

Referenced by audio_bridge_thread(), early_thread_run(), inband_dtmf_generate_callback(), inherit_codec(), preprocess_callback(), record_callback(), recording_thread(), session_audio_callback(), setup_ringback(), switch_channel_event_set_basic_data(), switch_core_media_bug_add(), switch_core_media_bug_read(), switch_core_session_get_real_read_impl(), switch_core_session_set_codec_slin(), switch_core_session_transcoding(), switch_core_session_wait_for_video_input_params(), switch_ivr_collect_digits_count(), switch_ivr_delay_echo(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_detect_speech_init(), switch_ivr_displace_session(), switch_ivr_eavesdrop_session(), switch_ivr_gentones(), switch_ivr_inband_dtmf_session(), switch_ivr_insert_file(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_preprocess_session(), switch_ivr_record_file_event(), switch_ivr_record_session_event(), switch_ivr_session_audio(), switch_ivr_sleep(), switch_ivr_sound_test(), switch_ivr_speak_text(), switch_ivr_tone_detect_session(), and switch_ivr_wait_for_silence().

347 {
348  if (session->read_impl.codec_id) {
349  *impp = session->read_impl;
350  return SWITCH_STATUS_SUCCESS;
351  }
352 
353  memset(impp, 0, sizeof(*impp));
354  impp->number_of_channels = 1;
355  return SWITCH_STATUS_FALSE;
356 }
switch_codec_implementation_t read_impl
memset(buf, 0, buflen)

◆ switch_core_session_get_real_read_impl()

switch_status_t switch_core_session_get_real_read_impl ( switch_core_session_t session,
switch_codec_implementation_t impp 
)

Definition at line 358 of file switch_core_codec.c.

References switch_codec_implementation::codec_id, switch_core_session::real_read_impl, switch_core_session_get_read_impl(), and SWITCH_STATUS_SUCCESS.

Referenced by switch_ivr_eavesdrop_session().

359 {
360  if (session->real_read_impl.codec_id) {
361  *impp = session->real_read_impl;
362  return SWITCH_STATUS_SUCCESS;
363  }
364 
365  return switch_core_session_get_read_impl(session, impp);
366 }
switch_status_t switch_core_session_get_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
switch_codec_implementation_t real_read_impl

◆ switch_core_session_get_video_read_codec()

switch_codec_t* switch_core_session_get_video_read_codec ( _In_ switch_core_session_t session)

Retrieve the video_read codec from a given session.

Parameters
sessionsession to retrieve from
Returns
a pointer to the codec

Referenced by switch_core_session_outgoing_channel().

◆ switch_core_session_get_video_read_impl()

switch_status_t switch_core_session_get_video_read_impl ( switch_core_session_t session,
switch_codec_implementation_t impp 
)

Definition at line 380 of file switch_core_codec.c.

References switch_codec_implementation::codec_id, memset(), switch_codec_implementation::number_of_channels, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_core_session::video_read_impl.

Referenced by inherit_codec(), and text_bridge_thread().

381 {
382  if (session->video_read_impl.codec_id) {
383  *impp = session->video_read_impl;
384  return SWITCH_STATUS_SUCCESS;
385  }
386 
387  memset(impp, 0, sizeof(*impp));
388  impp->number_of_channels = 1;
389  return SWITCH_STATUS_FALSE;
390 }
switch_codec_implementation_t video_read_impl
memset(buf, 0, buflen)

◆ switch_core_session_get_video_write_codec()

switch_codec_t* switch_core_session_get_video_write_codec ( _In_ switch_core_session_t session)

Retrieve the video_write codec from a given session.

Parameters
sessionsession to retrieve from
Returns
a pointer to the codec

Referenced by switch_core_session_write_video_frame().

◆ switch_core_session_get_video_write_impl()

switch_status_t switch_core_session_get_video_write_impl ( switch_core_session_t session,
switch_codec_implementation_t impp 
)

Definition at line 392 of file switch_core_codec.c.

References switch_codec_implementation::codec_id, memset(), switch_codec_implementation::number_of_channels, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_core_session::video_write_impl.

Referenced by text_bridge_thread().

393 {
394  if (session->video_write_impl.codec_id) {
395  *impp = session->video_write_impl;
396  return SWITCH_STATUS_SUCCESS;
397  }
398 
399  memset(impp, 0, sizeof(*impp));
400  impp->number_of_channels = 1;
401  return SWITCH_STATUS_FALSE;
402 }
switch_codec_implementation_t video_write_impl
memset(buf, 0, buflen)

◆ switch_core_session_get_write_codec()

switch_codec_t* switch_core_session_get_write_codec ( _In_ switch_core_session_t session)

Retrieve the write codec from a given session.

Parameters
sessionsession to retrieve from
Returns
a pointer to the codec

Referenced by setup_ringback(), and switch_channel_test_ready().

◆ switch_core_session_get_write_impl()

switch_status_t switch_core_session_get_write_impl ( switch_core_session_t session,
switch_codec_implementation_t impp 
)

◆ switch_core_session_lock_codec_read()

void switch_core_session_lock_codec_read ( _In_ switch_core_session_t session)

◆ switch_core_session_lock_codec_write()

void switch_core_session_lock_codec_write ( _In_ switch_core_session_t session)

◆ switch_core_session_set_read_codec()

switch_status_t switch_core_session_set_read_codec ( _In_ switch_core_session_t session,
switch_codec_t codec 
)

Assign the read codec to a given session.

Parameters
sessionsession to add the codec to
codecthe codec to add
Returns
SWITCH_STATUS_SUCCESS if successful

Referenced by early_thread_run(), setup_ringback(), switch_core_session_reset(), switch_core_session_set_codec_slin(), switch_ivr_detect_audio(), switch_ivr_detect_silence(), switch_ivr_eavesdrop_session(), switch_ivr_record_file_event(), switch_ivr_wait_for_answer(), and switch_ivr_wait_for_silence().

◆ switch_core_session_set_real_read_codec()

switch_status_t switch_core_session_set_real_read_codec ( _In_ switch_core_session_t session,
switch_codec_t codec 
)

Assign the original read codec to a given session. This is the read codec used by an endpoint.

Parameters
sessionsession to add the codec to
codecthe codec to add
Returns
SWITCH_STATUS_SUCCESS if successful

Referenced by switch_core_media_set_codec().

◆ switch_core_session_set_video_read_codec()

switch_status_t switch_core_session_set_video_read_codec ( _In_ switch_core_session_t session,
switch_codec_t codec 
)

Assign the video_read codec to a given session.

Parameters
sessionsession to add the codec to
codecthe codec to add
Returns
SWITCH_STATUS_SUCCESS if successful

Referenced by switch_core_media_set_video_codec().

◆ switch_core_session_set_video_write_codec()

switch_status_t switch_core_session_set_video_write_codec ( _In_ switch_core_session_t session,
switch_codec_t codec 
)

Assign the video_write codec to a given session.

Parameters
sessionsession to add the codec to
codecthe codec to add
Returns
SWITCH_STATUS_SUCCESS if successful

Referenced by switch_core_media_set_video_codec().

◆ switch_core_session_set_write_codec()

switch_status_t switch_core_session_set_write_codec ( _In_ switch_core_session_t session,
switch_codec_t codec 
)

Assign the write codec to a given session.

Parameters
sessionsession to add the codec to
codecthe codec to add
Returns
SWITCH_STATUS_SUCCESS if successful

Referenced by switch_core_media_set_codec().

◆ switch_core_session_unlock_codec_read()

void switch_core_session_unlock_codec_read ( _In_ switch_core_session_t session)

◆ switch_core_session_unlock_codec_write()

void switch_core_session_unlock_codec_write ( _In_ switch_core_session_t session)

◆ switch_core_session_unset_read_codec()

void switch_core_session_unset_read_codec ( _In_ switch_core_session_t session)

◆ switch_core_session_unset_write_codec()

void switch_core_session_unset_write_codec ( _In_ switch_core_session_t session)