Posting Opus's set-force-channels functionality to WebRTC.
BUG=webrtc:6303 Review-Url: https://codereview.webrtc.org/2352713005 Cr-Commit-Position: refs/heads/master@{#14394}
This commit is contained in:
@ -208,6 +208,20 @@ int16_t WebRtcOpus_SetComplexity(OpusEncInst* inst, int32_t complexity) {
|
||||
}
|
||||
}
|
||||
|
||||
int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, int32_t num_channels) {
|
||||
if (!inst)
|
||||
return -1;
|
||||
if (num_channels == 0) {
|
||||
return opus_encoder_ctl(inst->encoder,
|
||||
OPUS_SET_FORCE_CHANNELS(OPUS_AUTO));
|
||||
} else if (num_channels == 1 || num_channels == 2) {
|
||||
return opus_encoder_ctl(inst->encoder,
|
||||
OPUS_SET_FORCE_CHANNELS(num_channels));
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, size_t channels) {
|
||||
int error;
|
||||
OpusDecInst* state;
|
||||
|
||||
Reference in New Issue
Block a user