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

Side by Side Diff: webrtc/modules/audio_processing/aec_dump/aec_dump_impl.h

Issue 2747123007: Test submission of complete AEC-dump refactoring. (Closed)
Patch Set: Changed interface and build structure after reviewer comments. Created 3 years, 8 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
(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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_AEC_DUMP_IMPL_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_AEC_DUMP_IMPL_H_
13
14 #include <memory>
15 #include <string>
16 #include <vector>
17
18 #include "webrtc/base/ignore_wundef.h"
19 #include "webrtc/base/task_queue.h"
20 #include "webrtc/base/thread_checker.h"
21 #include "webrtc/modules/audio_processing/aec_dump/capture_stream_info_impl.h"
22 #include "webrtc/modules/audio_processing/include/aec_dump.h"
23 #include "webrtc/modules/include/module_common_types.h"
24 #include "webrtc/system_wrappers/include/file_wrapper.h"
25
26 // Files generated at build-time by the protobuf compiler.
27 RTC_PUSH_IGNORING_WUNDEF()
28 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
29 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
30 #else
31 #include "webrtc/modules/audio_processing/debug.pb.h"
32 #endif
33 RTC_POP_IGNORING_WUNDEF()
34
35 namespace rtc {
36 class TaskQueue;
37 } // namespace rtc
38
39 namespace webrtc {
40
41 // Task-queue based implementation of AecDump. It is thread safe by
42 // relying on locks in TaskQueue.
43 class AecDumpImpl : public AecDump {
44 public:
45 AecDumpImpl(std::string file_name,
46 int64_t max_log_size_bytes,
47 rtc::TaskQueue* worker_queue);
48 AecDumpImpl(FILE* handle,
49 int64_t max_log_size_bytes,
50 rtc::TaskQueue* worker_queue);
51 ~AecDumpImpl() override;
52
53 std::unique_ptr<CaptureStreamInfo> GetCaptureStreamInfo() override;
54
55 void WriteInitMessage(const ProcessingConfig& api_format) override;
56 void WriteRenderStreamMessage(const AudioFrame& frame) override;
57 void WriteRenderStreamMessage(
58 std::vector<rtc::ArrayView<const float>> src) override;
59 void WriteCaptureStreamMessage(
60 std::unique_ptr<CaptureStreamInfo> capture_stream_info) override;
61 void WriteConfig(const InternalAPMConfig& config, bool forced) override;
62
63 private:
64 void PostTask(std::unique_ptr<audioproc::Event> event);
65
66 // Implementation detail of WriteConfig: If not |forced|, only
67 // writes the current config if it is different from the last saved
68 // one; if |forced|, writes the config regardless of the last saved.
69 std::string last_serialized_capture_config_ GUARDED_BY(config_string_lock_) =
70 "";
71 std::unique_ptr<FileWrapper> debug_file_;
72 int64_t num_bytes_left_for_log_ = 0;
73
74 rtc::TaskQueue* worker_queue_;
75 rtc::CriticalSection config_string_lock_;
76 };
77 } // namespace webrtc
78
79 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_AEC_DUMP_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec_dump/aec_dump_factory.h ('k') | webrtc/modules/audio_processing/aec_dump/aec_dump_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698