1 /* 2 * Copyright (c) 2018 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 MODULES_AUDIO_PROCESSING_AGC2_VECTOR_FLOAT_FRAME_H_ 12 #define MODULES_AUDIO_PROCESSING_AGC2_VECTOR_FLOAT_FRAME_H_ 13 14 #include <vector> 15 16 #include "modules/audio_processing/include/audio_frame_view.h" 17 18 namespace webrtc { 19 20 // A construct consisting of a multi-channel audio frame, and a FloatFrame view 21 // of it. 22 class VectorFloatFrame { 23 public: 24 VectorFloatFrame(int num_channels, 25 int samples_per_channel, 26 float start_value); float_frame_view()27 const AudioFrameView<float>& float_frame_view() { return float_frame_view_; } float_frame_view()28 AudioFrameView<const float> float_frame_view() const { 29 return float_frame_view_; 30 } 31 32 ~VectorFloatFrame(); 33 34 private: 35 std::vector<std::vector<float>> channels_; 36 std::vector<float*> channel_ptrs_; 37 AudioFrameView<float> float_frame_view_; 38 }; 39 40 } // namespace webrtc 41 42 #endif // MODULES_AUDIO_PROCESSING_AGC2_VECTOR_FLOAT_FRAME_H_ 43