Chromium Code Reviews| Index: webrtc/modules/audio_processing/aec3/render_transfer_buffer.h |
| diff --git a/webrtc/modules/audio_processing/aec3/render_transfer_buffer.h b/webrtc/modules/audio_processing/aec3/render_transfer_buffer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..821ef665247c14b81b3c04a3e800f34a1b241131 |
| --- /dev/null |
| +++ b/webrtc/modules/audio_processing/aec3/render_transfer_buffer.h |
| @@ -0,0 +1,46 @@ |
| +/* |
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_TRANSFER_BUFFER_H_ |
| +#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_TRANSFER_BUFFER_H_ |
| + |
| +#include <memory> |
| +#include <vector> |
| + |
| +#include "webrtc/base/constructormagic.h" |
| +#include "webrtc/base/swap_queue.h" |
| +#include "webrtc/modules/audio_processing/render_queue_item_verifier.h" |
| + |
| +namespace webrtc { |
| + |
| +// Interface which limits access to the RenderTransferBuffer to write access. |
| +class RenderTransferBufferWriter { |
| + public: |
| + virtual ~RenderTransferBufferWriter() = 0; |
|
aleloi
2016/12/16 15:04:32
For some reason, the style guide says that dtors s
peah-webrtc
2016/12/20 10:10:26
Good find! I have removed this class in the new pa
aleloi
2016/12/20 15:55:35
If someone knows why, please enlighten me! Here's
peah-webrtc
2016/12/21 23:13:49
That makes sense, but I don't know if that is the
|
| + virtual bool Insert(std::vector<float>* frame) = 0; |
| +}; |
| + |
| +class RenderTransferBuffer : public RenderTransferBufferWriter { |
| + public: |
| + RenderTransferBuffer(size_t num_bands, size_t frame_length); |
| + ~RenderTransferBuffer() override; |
| + bool Insert(std::vector<float>* frame) override; |
|
hlundin-webrtc
2016/12/16 10:04:48
Comment on the fact that frame will be swapped.
peah-webrtc
2016/12/20 10:10:26
have removed this class in the new patch.
Done.
|
| + bool Remove(std::vector<float>* frame); |
|
hlundin-webrtc
2016/12/16 10:04:48
And here.
peah-webrtc
2016/12/20 10:10:26
I have removed this class in the new patch.
Done.
|
| + |
| + private: |
| + static const size_t kQueueSize = 30; |
|
hlundin-webrtc
2016/12/16 10:04:48
constexpr
ivoc
2016/12/19 11:30:22
Move to .cc file?
peah-webrtc
2016/12/20 10:10:26
I have removed this class in the new patch.
Done.
peah-webrtc
2016/12/20 10:10:26
I have removed this class in the new patch.
Done.
|
| + SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> queue_; |
| + std::vector<float> frame_; |
|
aleloi
2016/12/16 15:04:31
Will frame_ be used later? It's not used at the mo
peah-webrtc
2016/12/20 10:10:26
Fully true, that should be removed. I have removed
|
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderTransferBuffer); |
| +}; |
| + |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_TRANSFER_BUFFER_H_ |