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

Side by Side Diff: webrtc/modules/audio_processing/test/debug_dump_replayer.h

Issue 1810463002: Adding DebugDumpReplayer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: a nit Created 4 years, 9 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 | « no previous file | webrtc/modules/audio_processing/test/debug_dump_replayer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 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_TEST_DEBUG_DUMP_REPLAYER_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_DEBUG_DUMP_REPLAYER_H_
13
14 #include <memory>
15 #include <string>
16
17 #include "webrtc/common_audio/channel_buffer.h"
18 #include "webrtc/modules/audio_processing/debug.pb.h"
19 #include "webrtc/modules/audio_processing/include/audio_processing.h"
20
21 namespace webrtc {
22 namespace test {
23
24 class DebugDumpReplayer {
25 public:
26 DebugDumpReplayer();
27 ~DebugDumpReplayer();
28
29 // Set dump file
30 bool SetDumpFile(const std::string& filename);
31
32 // Return next event.
33 rtc::Optional<audioproc::Event> GetNextEvent() const;
34
35 // Run the next event. Returns true if succeeded.
36 bool RunNextEvent();
37
38 const ChannelBuffer<float>* GetOutput() const;
39 StreamConfig GetOutputConfig() const;
40
41 private:
42 // Following functions are facilities for replaying debug dumps.
43 void OnInitEvent(const audioproc::Init& msg);
44 void OnStreamEvent(const audioproc::Stream& msg);
45 void OnReverseStreamEvent(const audioproc::ReverseStream& msg);
46 void OnConfigEvent(const audioproc::Config& msg);
47
48 void MaybeRecreateApm(const audioproc::Config& msg);
49 void ConfigureApm(const audioproc::Config& msg);
50
51 void LoadNextMessage();
52
53 // Buffer for APM input/output.
54 std::unique_ptr<ChannelBuffer<float>> input_;
55 std::unique_ptr<ChannelBuffer<float>> reverse_;
56 std::unique_ptr<ChannelBuffer<float>> output_;
57
58 std::unique_ptr<AudioProcessing> apm_;
59
60 FILE* debug_file_;
61
62 StreamConfig input_config_;
63 StreamConfig reverse_config_;
64 StreamConfig output_config_;
65
66 bool has_next_event_;
67 audioproc::Event next_event_;
68 };
69
70 } // namespace test
71 } // namespace webrtc
72
73 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_DEBUG_DUMP_REPLAYER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/test/debug_dump_replayer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698