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

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

Issue 2865113002: AecDump implementation. (Closed)
Patch Set: Removed extra build deps from dependent CL. Created 3 years, 7 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/platform_file.h"
20 #include "webrtc/base/race_checker.h"
21 #include "webrtc/base/task_queue.h"
22 #include "webrtc/base/thread_annotations.h"
23 #include "webrtc/modules/audio_processing/aec_dump/capture_stream_info.h"
24 #include "webrtc/modules/audio_processing/aec_dump/write_to_file_task.h"
25 #include "webrtc/modules/audio_processing/include/aec_dump.h"
26 #include "webrtc/modules/include/module_common_types.h"
27 #include "webrtc/system_wrappers/include/file_wrapper.h"
28
29 // Files generated at build-time by the protobuf compiler.
30 RTC_PUSH_IGNORING_WUNDEF()
31 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
32 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
33 #else
34 #include "webrtc/modules/audio_processing/debug.pb.h"
35 #endif
36 RTC_POP_IGNORING_WUNDEF()
37
38 namespace rtc {
39 class TaskQueue;
40 } // namespace rtc
41
42 namespace webrtc {
43
44 // Task-queue based implementation of AecDump. It is thread safe by
45 // relying on locks in TaskQueue.
46 class AecDumpImpl : public AecDump {
47 public:
48 // Does member variables initialization shared across all c-tors.
49 AecDumpImpl(std::unique_ptr<FileWrapper> debug_file,
50 int64_t max_log_size_bytes,
51 rtc::TaskQueue* worker_queue);
52
53 ~AecDumpImpl() override;
54
55 void WriteInitMessage(const InternalAPMStreamsConfig& api_format) override;
56
57 void AddCaptureStreamInput(const FloatAudioFrame& src) override;
58 void AddCaptureStreamOutput(const FloatAudioFrame& src) override;
59 void AddCaptureStreamInput(const AudioFrame& frame) override;
60 void AddCaptureStreamOutput(const AudioFrame& frame) override;
61 void AddAudioProcessingState(const AudioProcessingState& state) override;
62 void WriteCaptureStreamMessage() override;
63
64 void WriteRenderStreamMessage(const AudioFrame& frame) override;
65 void WriteRenderStreamMessage(const FloatAudioFrame& src) override;
66
67 void WriteConfig(const InternalAPMConfig& config) override;
68
69 private:
70 std::unique_ptr<WriteToFileTask> CreateWriteToFileTask();
71
72 std::unique_ptr<FileWrapper> debug_file_;
73 int64_t num_bytes_left_for_log_ = 0;
74 rtc::RaceChecker race_checker_;
75 rtc::TaskQueue* worker_queue_;
76 CaptureStreamInfo capture_stream_info_;
77 };
78 } // namespace webrtc
79
80 #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