Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #include <utility> | |
| 12 | |
| 13 #include "webrtc/modules/audio_processing/aec_dump/aec_dump_factory.h" | |
| 14 | |
| 15 #include "webrtc/base/task_queue.h" | |
| 16 #include "webrtc/modules/include/module_common_types.h" | |
| 17 #include "webrtc/test/gtest.h" | |
| 18 | |
| 19 TEST(AecDumper, APICallsDoNotCrash) { | |
| 20 // Note order of initialization: factory first (has event pool), | |
|
peah-webrtc
2017/05/17 05:36:33
I don't really follow the comments about the event
aleloi
2017/05/17 10:49:56
That was some kind of merge issue. The version of
| |
| 21 // then task queue (looks at event pool), then aec_dumper (posts | |
| 22 // stuff to task queue). | |
| 23 rtc::TaskQueue file_writer_queue("file_writer_queue"); | |
| 24 auto aec_dump = | |
| 25 webrtc::AecDumpFactory::Create("file1", -1, &file_writer_queue); | |
| 26 EXPECT_TRUE(aec_dump); | |
| 27 | |
| 28 // TODO(aleloi): wait a while and check that file1 is | |
|
peah-webrtc
2017/05/17 05:36:33
Something to address before landing this?
aleloi
2017/05/17 10:49:56
Same as above, this file somehow reverted to an ea
| |
| 29 // opened. Perhaps add a Flush/join method? Or call d-tor? | |
| 30 aec_dump = webrtc::AecDumpFactory::Create("file2", -1, &file_writer_queue); | |
| 31 | |
| 32 aec_dump = webrtc::AecDumpFactory::Create("file3", 10, &file_writer_queue); | |
| 33 | |
| 34 // TODO(aleloi): open from handle. | |
|
peah-webrtc
2017/05/17 05:36:33
Something to address before landing this?
aleloi
2017/05/17 10:49:56
Acknowledged.
| |
| 35 | |
| 36 const webrtc::AudioFrame frame; | |
| 37 aec_dump->WriteRenderStreamMessage(frame); | |
| 38 | |
| 39 aec_dump->AddCaptureStreamInput(frame); | |
| 40 aec_dump->AddCaptureStreamOutput(frame); | |
| 41 | |
| 42 aec_dump->WriteCaptureStreamMessage(); | |
| 43 | |
| 44 webrtc::InternalAPMConfig apm_config; | |
| 45 aec_dump->WriteConfig(apm_config, false); | |
| 46 | |
| 47 aec_dump->WriteConfig(apm_config, true); | |
| 48 | |
| 49 webrtc::InternalAPMStreamsConfig streams_config; | |
| 50 aec_dump->WriteInitMessage(streams_config); | |
| 51 } | |
| OLD | NEW |