Prosody RTP processing: API: sm_vmptx_config_codec_evrc
Prototype Definition
int sm_vmptx_config_codec_evrc(struct sm_vmptx_codec_evrc_parms *codecp)
Parameters
- *codecp
-
a structure of the following type:
typedef struct sm_vmptx_codec_evrc_parms {
tSMVMPtxId vmptx; /* in */
tSM_INT payload_type; /* in */
tSM_INT high_pass_filter; /* in */
tSM_INT noise_suppression_filter; /* in */
enum kSMEVRCRTPMode rtp_mode; /* in */
enum kSMEVRCRate {
kSMEVRCRateEighth,
kSMEVRCRateHalf,
kSMEVRCRateFull,
} max_rate; /* in */
enum kSMEVRCRate min_rate; /* in */
enum kSMVMPTxVADMode VADMode; /* in */
tSM_INT frames_per_packet; /* in */
} SM_VMPTX_CODEC_EVRC_PARMS;
Description
Configures a VMP[tx] to use the Enhanced Variable Rate Codec
(EVRC) for encoding data.
This requires the module
evrc
to have been downloaded.
Fields
- vmptx
- The VMP[tx] to which to add this codec
- payload_type
- The payload type identifer to use with this codec (see
IETF RFC 3550
section 13). Supplying a value of
-1
will remove any payload type configuration from the
codec preventing its use.
- high_pass_filter
- Selects whether or not a high-pass filter is used on the data
to be encoded. The filter is used if this value is non-zero.
- noise_suppression_filter
- Selects whether or not a noise suppression filter is used on the data
to be encoded. The filter is used if this value is non-zero.
- rtp_mode
- Selects the RTP format for this codec. There are two commonly-used
specifications for how to pack the the encoded data into an RTP
packet.
One of these values:
- kSMEVRCRTPModeHeaderless
- Encodes the bitstream as raw encoded bytes, with no headers. This
requires that there is only one frame per packet.
- kSMEVRCRTPModeRFC2658
- Encodes the bitstream as specified in
IETF RFC 2658. The
header is one byte. This specification only allows for one frame per
packet.
- kSMEVRCRTPModeRFC3558
- Encodes the bitstream as specified in
IETF RFC 3558. The
header is two bytes, plus one byte for every two frames in the packet.
- max_rate
- The maximum encoding rate to use. All frames are guaranteed to be this
size or smaller.
One of these values:
- kSMEVRCRateEighth
- Eighth rate: 16 bits per frame. This rate is only used for comfort
noise frames.
- kSMEVRCRateHalf
- Half rate: 80 bits per frame.
- kSMEVRCRateFull
- Full rate: 171 bits per frame.
- min_rate
- The minimum encoding rate to use. All frames are guaranteed to be at
least this size, or be elided if VAD is enabled.
One of these values:
- kSMEVRCRateEighth
- Eighth rate: 16 bits per frame. This rate is only used for comfort
noise frames.
- kSMEVRCRateHalf
- Half rate: 80 bits per frame.
- kSMEVRCRateFull
- Full rate: 171 bits per frame.
- VADMode
- The mode of operation for the voice activity detector
One of these values:
- kSMVMPTxVADModeDisabled
- Disable VAD - all data delivered to the VMP[tx] is encoded and sent
- kSMVMPTxVADModeEnabled
- Enable VAD - if the signal is inactive, no data is sent (DTX)
- kSMVMPTxVADModeComfortNoise
- Enable VAD with comfort noise generation - if the signal is inactive,
comfort noise packets are sent. If the main codec does not define
its own comfort noise, it must have been configured by
sm_vmptx_config_codec_comfort_noise().
- frames_per_packet
- The number of frames to send per packet. This value is normally one,
which encodes 20 milliseconds per packet, but larger values can be
used, reducing the packet overhead at the expense of extra delay. This
field must be set to one unless
rtp_mode
is
kSMEVRCRTPModeRFC3558
.
Returns
0
if call completed successfully, otherwise a standard error such as:
- ERR_SM_DEVERR - device error
This function is part of the Prosody RTP processing API.