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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_CAPTURE_STREAM_INFO_IMPL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_CAPTURE_STREAM_INFO_IMPL_H_ |
| 13 |
| 14 #include <memory> |
| 15 #include <utility> |
| 16 #include <vector> |
| 17 |
| 18 #include "webrtc/base/checks.h" |
| 19 #include "webrtc/base/ignore_wundef.h" |
| 20 #include "webrtc/base/logging.h" |
| 21 #include "webrtc/modules/audio_processing/aec_dump/write_to_file_task.h" |
| 22 #include "webrtc/modules/audio_processing/include/aec_dump.h" |
| 23 #include "webrtc/modules/include/module_common_types.h" |
| 24 |
| 25 // Files generated at build-time by the protobuf compiler. |
| 26 RTC_PUSH_IGNORING_WUNDEF() |
| 27 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
| 28 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" |
| 29 #else |
| 30 #include "webrtc/modules/audio_processing/debug.pb.h" |
| 31 #endif |
| 32 RTC_POP_IGNORING_WUNDEF() |
| 33 |
| 34 namespace webrtc { |
| 35 |
| 36 // Optionally inherit from TaskQueue task. |
| 37 class CaptureStreamInfoImpl final : public AecDump::CaptureStreamInfo { |
| 38 public: |
| 39 explicit CaptureStreamInfoImpl(std::unique_ptr<WriteToFileTask> task); |
| 40 ~CaptureStreamInfoImpl() override; |
| 41 void AddInput(const FloatAudioFrame& src) override; |
| 42 void AddOutput(const FloatAudioFrame& src) override; |
| 43 |
| 44 void AddInput(const AudioFrame& frame) override; |
| 45 void AddOutput(const AudioFrame& frame) override; |
| 46 |
| 47 void set_delay(int delay) override; |
| 48 void set_drift(int drift) override; |
| 49 void set_level(int level) override; |
| 50 void set_keypress(bool keypress) override; |
| 51 |
| 52 std::unique_ptr<WriteToFileTask> GetTask() { |
| 53 RTC_DCHECK(task_); |
| 54 return std::move(task_); |
| 55 } |
| 56 |
| 57 void SetTask(std::unique_ptr<WriteToFileTask> task) { |
| 58 RTC_DCHECK(!task_); |
| 59 task_ = std::move(task); |
| 60 } |
| 61 |
| 62 private: |
| 63 std::unique_ptr<WriteToFileTask> task_; |
| 64 }; |
| 65 |
| 66 } // namespace webrtc |
| 67 |
| 68 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMP_CAPTURE_STREAM_INFO_IMPL_H_ |
OLD | NEW |