Make the destructor of AudioCodingModule public.

This allows the type to be used with a scoped_ptr. Remove all calls to
the deprecated Destroy() from tests.

R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2200006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4731 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org
2013-09-12 01:27:43 +00:00
parent 5eb997a2fd
commit 89df092807
24 changed files with 107 additions and 217 deletions

View File

@ -61,8 +61,8 @@ class DelayTest {
public:
DelayTest()
: acm_a_(NULL),
acm_b_(NULL),
: acm_a_(AudioCodingModule::Create(0)),
acm_b_(AudioCodingModule::Create(1)),
channel_a2b_(NULL),
test_cntr_(0),
encoding_sample_rate_hz_(8000) {}
@ -70,14 +70,6 @@ class DelayTest {
~DelayTest() {}
void TearDown() {
if (acm_a_ != NULL) {
AudioCodingModule::Destroy(acm_a_);
acm_a_ = NULL;
}
if (acm_b_ != NULL) {
AudioCodingModule::Destroy(acm_b_);
acm_b_ = NULL;
}
if (channel_a2b_ != NULL) {
delete channel_a2b_;
channel_a2b_ = NULL;
@ -91,8 +83,6 @@ class DelayTest {
if (FLAGS_input_file.size() > 0)
file_name = FLAGS_input_file;
in_file_a_.Open(file_name, 32000, "rb");
acm_a_ = AudioCodingModule::Create(0);
acm_b_ = AudioCodingModule::Create(1);
acm_a_->InitializeReceiver();
acm_b_->InitializeReceiver();
if (FLAGS_init_delay > 0) {
@ -122,7 +112,7 @@ class DelayTest {
// Create and connect the channel
channel_a2b_ = new Channel;
acm_a_->RegisterTransportCallback(channel_a2b_);
channel_a2b_->RegisterReceiverACM(acm_b_);
channel_a2b_->RegisterReceiverACM(acm_b_.get());
}
void Perform(const Config* config, size_t num_tests, int duration_sec,
@ -229,8 +219,8 @@ class DelayTest {
out_file_b_.Close();
}
AudioCodingModule* acm_a_;
AudioCodingModule* acm_b_;
scoped_ptr<AudioCodingModule> acm_a_;
scoped_ptr<AudioCodingModule> acm_b_;
Channel* channel_a2b_;
@ -256,9 +246,3 @@ void RunTest() {
}
} // namespace
} // namespace webrtc
int main(int argc, char* argv[]) {
using namespace webrtc;
google::ParseCommandLineFlags(&argc, &argv, true);
RunTest();
}