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

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

Issue 2838133003: Implementation of new AecDump interface. (Closed)
Patch Set: Changed CaptureStreamInfo behaviour. 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
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // of the Audio Processing Module. The recordings are called 96 // of the Audio Processing Module. The recordings are called
97 // 'aec-dumps' and are stored in a protobuf format defined in 97 // 'aec-dumps' and are stored in a protobuf format defined in
98 // debug.proto. 98 // debug.proto.
99 class AecDump { 99 class AecDump {
100 public: 100 public:
101 // A capture stream frame is logged before and after processing in 101 // A capture stream frame is logged before and after processing in
102 // the same protobuf message. To facilitate that, a CaptureStreamInfo 102 // the same protobuf message. To facilitate that, a CaptureStreamInfo
103 // instance is first filled with Input, then Output. 103 // instance is first filled with Input, then Output.
104 // 104 //
105 // To log an input/output pair, first call 105 // To log an input/output pair, first call
106 // AecDump::GetCaptureStreamInfo. Add the input and output to 106 // AecDump::GetCaptureStreamInfo. Add the input and output to the
107 // it. Then call AecDump::WriteCaptureStreamMessage. 107 // returned CaptureStreamInfo pointer. Then call
108 // AecDump::WriteCaptureStreamMessage.
108 class CaptureStreamInfo { 109 class CaptureStreamInfo {
109 public: 110 public:
110 virtual ~CaptureStreamInfo() = default; 111 virtual ~CaptureStreamInfo() = default;
111 virtual void AddInput(const FloatAudioFrame& src) = 0; 112 virtual void AddInput(const FloatAudioFrame& src) = 0;
112 virtual void AddOutput(const FloatAudioFrame& src) = 0; 113 virtual void AddOutput(const FloatAudioFrame& src) = 0;
113 114
114 virtual void AddInput(const AudioFrame& frame) = 0; 115 virtual void AddInput(const AudioFrame& frame) = 0;
115 virtual void AddOutput(const AudioFrame& frame) = 0; 116 virtual void AddOutput(const AudioFrame& frame) = 0;
116 117
117 virtual void set_delay(int delay) = 0; 118 virtual void set_delay(int delay) = 0;
118 virtual void set_drift(int drift) = 0; 119 virtual void set_drift(int drift) = 0;
119 virtual void set_level(int level) = 0; 120 virtual void set_level(int level) = 0;
120 virtual void set_keypress(bool keypress) = 0; 121 virtual void set_keypress(bool keypress) = 0;
121 }; 122 };
122 123
123 virtual ~AecDump() = default; 124 virtual ~AecDump() = default;
124 125
125 virtual std::unique_ptr<CaptureStreamInfo> CreateCaptureStreamInfo() 126 virtual CaptureStreamInfo* GetCaptureStreamInfo() = 0;
126 const = 0;
127 127
128 // The Write* methods are always safe to call concurrently or 128 // The Write* methods are always safe to call concurrently or
129 // otherwise for all implementing subclasses. The intended mode of 129 // otherwise for all implementing subclasses. The intended mode of
130 // operation is to create a protobuf object from the input, and send 130 // operation is to create a protobuf object from the input, and send
131 // it away to be written to file asynchronously. 131 // it away to be written to file asynchronously.
132 virtual void WriteInitMessage( 132 virtual void WriteInitMessage(
133 const InternalAPMStreamsConfig& streams_config) = 0; 133 const InternalAPMStreamsConfig& streams_config) = 0;
134 134
135 virtual void WriteRenderStreamMessage(const AudioFrame& frame) = 0; 135 virtual void WriteRenderStreamMessage(const AudioFrame& frame) = 0;
136 136
137 virtual void WriteRenderStreamMessage(const FloatAudioFrame& src) = 0; 137 virtual void WriteRenderStreamMessage(const FloatAudioFrame& src) = 0;
138 138
139 virtual void WriteCaptureStreamMessage( 139 virtual void WriteCaptureStreamMessage() = 0;
140 std::unique_ptr<CaptureStreamInfo> stream_info) = 0;
141 140
142 // If not |forced|, only writes the current config if it is 141 // If not |forced|, only writes the current config if it is
143 // different from the last saved one; if |forced|, writes the config 142 // different from the last saved one; if |forced|, writes the config
144 // regardless of the last saved. 143 // regardless of the last saved.
145 virtual void WriteConfig(const InternalAPMConfig& config, bool forced) = 0; 144 virtual void WriteConfig(const InternalAPMConfig& config, bool forced) = 0;
146 }; 145 };
147 } // namespace webrtc 146 } // namespace webrtc
148 147
149 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AEC_DUMP_H_ 148 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AEC_DUMP_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698