Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Side by Side Diff: webrtc/modules/audio_coding/main/test/opus_test.cc

Issue 1319683002: AudioDecoder: Replace Init() with Reset() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@buffer
Patch Set: review fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 in_file_mono_.Open(file_name_mono, frequency_hz, "rb"); 77 in_file_mono_.Open(file_name_mono, frequency_hz, "rb");
78 in_file_mono_.ReadStereo(false); 78 in_file_mono_.ReadStereo(false);
79 79
80 // Create Opus encoders for mono and stereo. 80 // Create Opus encoders for mono and stereo.
81 ASSERT_GT(WebRtcOpus_EncoderCreate(&opus_mono_encoder_, 1, 0), -1); 81 ASSERT_GT(WebRtcOpus_EncoderCreate(&opus_mono_encoder_, 1, 0), -1);
82 ASSERT_GT(WebRtcOpus_EncoderCreate(&opus_stereo_encoder_, 2, 1), -1); 82 ASSERT_GT(WebRtcOpus_EncoderCreate(&opus_stereo_encoder_, 2, 1), -1);
83 83
84 // Create Opus decoders for mono and stereo for stand-alone testing of Opus. 84 // Create Opus decoders for mono and stereo for stand-alone testing of Opus.
85 ASSERT_GT(WebRtcOpus_DecoderCreate(&opus_mono_decoder_, 1), -1); 85 ASSERT_GT(WebRtcOpus_DecoderCreate(&opus_mono_decoder_, 1), -1);
86 ASSERT_GT(WebRtcOpus_DecoderCreate(&opus_stereo_decoder_, 2), -1); 86 ASSERT_GT(WebRtcOpus_DecoderCreate(&opus_stereo_decoder_, 2), -1);
87 ASSERT_GT(WebRtcOpus_DecoderInit(opus_mono_decoder_), -1); 87 WebRtcOpus_DecoderInit(opus_mono_decoder_);
88 ASSERT_GT(WebRtcOpus_DecoderInit(opus_stereo_decoder_), -1); 88 WebRtcOpus_DecoderInit(opus_stereo_decoder_);
89 89
90 ASSERT_TRUE(acm_receiver_.get() != NULL); 90 ASSERT_TRUE(acm_receiver_.get() != NULL);
91 EXPECT_EQ(0, acm_receiver_->InitializeReceiver()); 91 EXPECT_EQ(0, acm_receiver_->InitializeReceiver());
92 92
93 // Register Opus stereo as receiving codec. 93 // Register Opus stereo as receiving codec.
94 CodecInst opus_codec_param; 94 CodecInst opus_codec_param;
95 int codec_id = acm_receiver_->Codec("opus", 48000, 2); 95 int codec_id = acm_receiver_->Codec("opus", 48000, 2);
96 EXPECT_EQ(0, acm_receiver_->Codec(codec_id, &opus_codec_param)); 96 EXPECT_EQ(0, acm_receiver_->Codec(codec_id, &opus_codec_param));
97 payload_type_ = opus_codec_param.pltype; 97 payload_type_ = opus_codec_param.pltype;
98 EXPECT_EQ(0, acm_receiver_->RegisterReceiveCodec(opus_codec_param)); 98 EXPECT_EQ(0, acm_receiver_->RegisterReceiveCodec(opus_codec_param));
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 out_file_.Open(file_name, 48000, "wb"); 372 out_file_.Open(file_name, 48000, "wb");
373 file_stream.str(""); 373 file_stream.str("");
374 file_name = file_stream.str(); 374 file_name = file_stream.str();
375 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_" 375 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_"
376 << test_number << ".pcm"; 376 << test_number << ".pcm";
377 file_name = file_stream.str(); 377 file_name = file_stream.str();
378 out_file_standalone_.Open(file_name, 48000, "wb"); 378 out_file_standalone_.Open(file_name, 48000, "wb");
379 } 379 }
380 380
381 } // namespace webrtc 381 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698