Prosody RTP processing: API: sm_vmptx_config_codec_opus

Prototype Definition

int sm_vmptx_config_codec_opus(struct sm_vmptx_codec_opus_parms *codecp)

Parameters

*codecp
a structure of the following type:
typedef struct sm_vmptx_codec_opus_parms {
	tSMVMPtxId vmptx;					/* in */
	tSM_INT payload_type;					/* in */
	tSM_INT sample_rate;					/* in */
	tSM_INT bit_rate;					/* in */
	tSM_INT ptime;						/* in */
	tSM_INT packet_loss;					/* in */
	tSM_INT complexity;					/* in */
	tSM_INT use_fec;					/* in */
	tSM_INT use_dtx;					/* in */
	enum kSMOPUSRate {
		kSMOPUSRateConstrainedVariable,
		kSMOPUSRateUnconstrainedVariable,
		kSMOPUSRateConstant,
	} rate_control;						/* in */
	enum kSMOPUSSignalTypeHint {
		kSMOPUSSignalTypeHintNone,
		kSMOPUSSignalTypeHintVoice,
		kSMOPUSSignalTypeHintMusic,
	} signal_type_hint;					/* in */
	enum kSMOPUSAppType {
		kSMOPUSAppTypeVoIP,
		kSMOPUSAppTypeAudio,
		kSMOPUSAppTypeLowDelay,
	} application_type;					/* in */
	tSM_INT disable_prediction;				/* in */
} SM_VMPTX_CODEC_OPUS_PARMS;

Description

Configures a VMP[tx] to use Opus codec as defined in IETF RFC 6716.

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.
sample_rate
Sample rate of the audio being encoded. In the current release, this should be either 8000 (narrowband) or 16000 (wideband).
bit_rate
The target bit rate which the codec should aim to produce. A value of zero indicates automatic rate selection. A negative value indicates maximum possible rate should be used. Otherwise a value in range 500 to 512000 should be specified. For most applications automatic rate selection would be used unless peer indicates otherwise.
ptime
The duration in milliseconds of audio conveyed in each frame. This should be set to a value of 10, 20, 40, or 60. Normally should be set to 20.
packet_loss
An estimate of the current level of packet loss to which the encoded data will be subjected, as a percentage. Normally set to zero.
complexity
The complexity of the algorithms used to encode the data: 0..10 This controls the trade-off between channel count and audio quality. 0 will give the biggest channel count; 10 will give best quality.
use_fec
Set to any non-zero value to include data for "forward error correction" (FEC) in the transmitted stream. Only recommended if really needed, as it reduces quality unless there is significant packet loss.
use_dtx
Set to any non-zero value to suppress transmission of data during silence. Not recommended unless average bit rate is absolutely critical.
rate_control
Control variation of encoded bit rate. One of these values:
kSMOPUSRateConstrainedVariable
Constrained variable rate.
kSMOPUSRateUnconstrainedVariable
Unconstrained variable rate.
kSMOPUSRateConstant
Constant bit rate.
signal_type_hint
Provides hint about nature of signal being encoded. One of these values:
kSMOPUSSignalTypeHintNone
Nature of signal not known.
kSMOPUSSignalTypeHintVoice
Signal to be encoded is voice.
kSMOPUSSignalTypeHintMusic
Signal to be encoded is music.
application_type
Provides hint about application type. One of these values:
kSMOPUSAppTypeVoIP
Process signal for improved speech intelligibility.
kSMOPUSAppTypeAudio
Favour faithfulness to the original input..
kSMOPUSAppTypeLowDelay
Configure the minimum possible coding delay by disabling certain modes of operation.
disable_prediction
Set to zero for default behaviour, set to 1 to disable almost all use of prediction, making frames almost completely independent.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody RTP processing API.