OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
| 12 #include <memory> |
| 13 #include <vector> |
12 | 14 |
13 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 16 #include "base/macros.h" |
15 #include "base/memory/scoped_vector.h" | |
16 #include "base/process/process.h" | 17 #include "base/process/process.h" |
17 #include "base/sync_socket.h" | 18 #include "base/sync_socket.h" |
18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
19 #include "build/build_config.h" | 20 #include "build/build_config.h" |
20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
21 #include "media/audio/audio_input_controller.h" | 22 #include "media/audio/audio_input_controller.h" |
22 #include "media/base/audio_bus.h" | 23 #include "media/base/audio_bus.h" |
23 #include "media/base/audio_parameters.h" | 24 #include "media/base/audio_parameters.h" |
24 | 25 |
25 #if defined(OS_POSIX) | 26 #if defined(OS_POSIX) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 size_t write_error_count_; | 143 size_t write_error_count_; |
143 | 144 |
144 // Counts the fifo writes and errors we get during renderer process teardown | 145 // Counts the fifo writes and errors we get during renderer process teardown |
145 // so that we can account for that (subtract) when we calculate the overall | 146 // so that we can account for that (subtract) when we calculate the overall |
146 // counts. | 147 // counts. |
147 size_t trailing_write_to_fifo_count_; | 148 size_t trailing_write_to_fifo_count_; |
148 size_t trailing_write_error_count_; | 149 size_t trailing_write_error_count_; |
149 | 150 |
150 // Vector of audio buses allocated during construction and deleted in the | 151 // Vector of audio buses allocated during construction and deleted in the |
151 // destructor. | 152 // destructor. |
152 ScopedVector<media::AudioBus> audio_buses_; | 153 std::vector<std::unique_ptr<media::AudioBus>> audio_buses_; |
153 | 154 |
154 // Fifo for audio that is used in case there isn't room in the shared memory. | 155 // Fifo for audio that is used in case there isn't room in the shared memory. |
155 // This can for example happen under load when the consumer side is starved. | 156 // This can for example happen under load when the consumer side is starved. |
156 // It should ideally be rare, but we need to guarantee that the data arrives | 157 // It should ideally be rare, but we need to guarantee that the data arrives |
157 // since audio processing such as echo cancelling requires that to perform | 158 // since audio processing such as echo cancelling requires that to perform |
158 // properly. | 159 // properly. |
159 ScopedVector<media::AudioBus> overflow_buses_; | 160 std::vector<std::unique_ptr<media::AudioBus>> overflow_buses_; |
160 struct OverflowParams { | 161 struct OverflowParams { |
161 double volume; | 162 double volume; |
162 uint32_t hardware_delay_bytes; | 163 uint32_t hardware_delay_bytes; |
163 bool key_pressed; | 164 bool key_pressed; |
164 }; | 165 }; |
165 std::deque<OverflowParams> overflow_params_; | 166 std::deque<OverflowParams> overflow_params_; |
166 | 167 |
167 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter); | 168 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter); |
168 }; | 169 }; |
169 | 170 |
170 } // namespace content | 171 } // namespace content |
171 | 172 |
172 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ | 173 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ |
OLD | NEW |