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

Side by Side Diff: webrtc/modules/audio_device/fine_audio_buffer.h

Issue 2706923006: Now using rtc::Buffer in FineAudioBuffer (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_
12 #define WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ 12 #define WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/base/buffer.h"
16 #include "webrtc/typedefs.h" 17 #include "webrtc/typedefs.h"
17 18
18 namespace webrtc { 19 namespace webrtc {
19 20
20 class AudioDeviceBuffer; 21 class AudioDeviceBuffer;
21 22
22 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data 23 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data
23 // corresponding to 10ms of data. It then allows for this data to be pulled in 24 // corresponding to 10ms of data. It then allows for this data to be pulled in
24 // a finer or coarser granularity. I.e. interacting with this class instead of 25 // a finer or coarser granularity. I.e. interacting with this class instead of
25 // directly with the AudioDeviceBuffer one can ask for any number of audio data 26 // directly with the AudioDeviceBuffer one can ask for any number of audio data
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Number of audio samples per 10ms. 86 // Number of audio samples per 10ms.
86 const size_t samples_per_10_ms_; 87 const size_t samples_per_10_ms_;
87 // Number of audio bytes per 10ms. 88 // Number of audio bytes per 10ms.
88 const size_t bytes_per_10_ms_; 89 const size_t bytes_per_10_ms_;
89 // Storage for output samples that are not yet asked for. 90 // Storage for output samples that are not yet asked for.
90 std::unique_ptr<int8_t[]> playout_cache_buffer_; 91 std::unique_ptr<int8_t[]> playout_cache_buffer_;
91 // Location of first unread output sample. 92 // Location of first unread output sample.
92 size_t playout_cached_buffer_start_; 93 size_t playout_cached_buffer_start_;
93 // Number of bytes stored in output (contain samples to be played out) cache. 94 // Number of bytes stored in output (contain samples to be played out) cache.
94 size_t playout_cached_bytes_; 95 size_t playout_cached_bytes_;
95 // Storage for input samples that are about to be delivered to the WebRTC 96 // Required (max) size in bytes of the |record_buffer_|.
96 // ADB or remains from the last successful delivery of a 10ms audio buffer.
97 std::unique_ptr<int8_t[]> record_cache_buffer_;
98 // Required (max) size in bytes of the |record_cache_buffer_|.
99 const size_t required_record_buffer_size_bytes_; 97 const size_t required_record_buffer_size_bytes_;
100 // Number of bytes in input (contains recorded samples) cache. 98 // Number of bytes in input (contains recorded samples) cache.
101 size_t record_cached_bytes_; 99 size_t record_cached_bytes_;
102 // Read and write pointers used in the buffering scheme on the recording side. 100 // Read and write pointers used in the buffering scheme on the recording side.
103 size_t record_read_pos_; 101 size_t record_read_pos_;
104 size_t record_write_pos_; 102 // Storage for input samples that are about to be delivered to the WebRTC
103 // ADB or remains from the last successful delivery of a 10ms audio buffer.
104 rtc::BufferT<int8_t> record_buffer_;
105 }; 105 };
106 106
107 } // namespace webrtc 107 } // namespace webrtc
108 108
109 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ 109 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/fine_audio_buffer.cc » ('j') | webrtc/modules/audio_device/fine_audio_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698