Prosody RTP processing: API: sm_vmptx_config_codec_speex
Prototype Definition
int sm_vmptx_config_codec_speex(struct sm_vmptx_codec_speex_parms *codecp)
Parameters
- *codecp
-
a structure of the following type:
typedef struct sm_vmptx_codec_speex_parms {
tSMVMPtxId vmptx; /* in */
tSM_INT payload_type; /* in */
enum kSMSpeexMode bandwidth; /* in */
enum kSMVMPTxVADMode VADMode; /* in */
tSM_INT frames_per_packet; /* in */
} SM_VMPTX_CODEC_SPEEX_PARMS;
Description
Configures a VMP[tx] to use Speex for encoding data,
as defined in
IETF RFC 5574.
However, neither variable bit-rate coding (VBR) nor discontinuous
transmission (DTX) are supported.
This requires the module
speex_vmp
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.
- bandwidth
- Ignored.
kSMSpeexNarrowbandMode
is always used
since it is the only value supported by current firmware.
One of these values:
- kSMSpeexNarrowbandMode
- Narrowband (8 kHz sampling rate) mode
- kSMSpeexWidebandMode
- Wideband (16 kHz sampling rate) mode
- kSMSpeexUltrawidebandMode
- Ultrawideband (32 kHz sampling rate) mode
- VADMode
- Currently ignored. Neither VAD nor CNG processing is implemented.
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 could be
used, to reduce the packet overhead at the expense of extra delay.
This field is currently ignored. Packets are always transmitted with
one 20ms frame per packet.
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.