Setting Opus target application.
This CL is to allow to set Opus target application at the creation of an encoder. According to Opus spec, there are three applications: OPUS_APPLICATION_VOIP OPUS_APPLICATION_AUDIO OPUS_APPLICATION_RESTRICTED_LOWDELAY BUG= R=henrik.lundin@webrtc.org, tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/37479004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8103 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -447,6 +447,7 @@ class AudioDecoderOpusTest : public AudioDecoderTest {
|
||||
AudioEncoderOpus::Config config;
|
||||
config.frame_size_ms = static_cast<int>(frame_size_) / 48;
|
||||
config.payload_type = payload_type_;
|
||||
config.application = AudioEncoderOpus::kVoip;
|
||||
audio_encoder_.reset(new AudioEncoderOpus(config));
|
||||
}
|
||||
};
|
||||
@ -461,6 +462,7 @@ class AudioDecoderOpusStereoTest : public AudioDecoderOpusTest {
|
||||
config.frame_size_ms = static_cast<int>(frame_size_) / 48;
|
||||
config.num_channels = 2;
|
||||
config.payload_type = payload_type_;
|
||||
config.application = AudioEncoderOpus::kAudio;
|
||||
audio_encoder_.reset(new AudioEncoderOpus(config));
|
||||
}
|
||||
};
|
||||
|
||||
@ -145,8 +145,10 @@ NetEqOpusFecQualityTest::NetEqOpusFecQualityTest()
|
||||
}
|
||||
|
||||
void NetEqOpusFecQualityTest::SetUp() {
|
||||
// If channels_ == 1, use Opus VOIP mode, otherwise, audio mode.
|
||||
int app = channels_ == 1 ? 0 : 1;
|
||||
// Create encoder memory.
|
||||
WebRtcOpus_EncoderCreate(&opus_encoder_, channels_);
|
||||
WebRtcOpus_EncoderCreate(&opus_encoder_, channels_, app);
|
||||
ASSERT_TRUE(opus_encoder_ != NULL);
|
||||
// Set bitrate.
|
||||
EXPECT_EQ(0, WebRtcOpus_SetBitRate(opus_encoder_, bit_rate_kbps_ * 1000));
|
||||
|
||||
Reference in New Issue
Block a user