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

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

Issue 1722083002: Replace scoped_ptr with unique_ptr in webrtc/modules/audio_device/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 "webrtc/base/scoped_ptr.h" 14 #include <memory>
15
15 #include "webrtc/typedefs.h" 16 #include "webrtc/typedefs.h"
16 17
17 namespace webrtc { 18 namespace webrtc {
18 19
19 class AudioDeviceBuffer; 20 class AudioDeviceBuffer;
20 21
21 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data 22 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data
22 // corresponding to 10ms of data. It then allows for this data to be pulled in 23 // corresponding to 10ms of data. It then allows for this data to be pulled in
23 // a finer or coarser granularity. I.e. interacting with this class instead of 24 // a finer or coarser granularity. I.e. interacting with this class instead of
24 // directly with the AudioDeviceBuffer one can ask for any number of audio data 25 // directly with the AudioDeviceBuffer one can ask for any number of audio data
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Number of bytes delivered by GetPlayoutData() call and provided to 80 // Number of bytes delivered by GetPlayoutData() call and provided to
80 // DeliverRecordedData(). 81 // DeliverRecordedData().
81 const size_t desired_frame_size_bytes_; 82 const size_t desired_frame_size_bytes_;
82 // Sample rate in Hertz. 83 // Sample rate in Hertz.
83 const int sample_rate_; 84 const int sample_rate_;
84 // Number of audio samples per 10ms. 85 // Number of audio samples per 10ms.
85 const size_t samples_per_10_ms_; 86 const size_t samples_per_10_ms_;
86 // Number of audio bytes per 10ms. 87 // Number of audio bytes per 10ms.
87 const size_t bytes_per_10_ms_; 88 const size_t bytes_per_10_ms_;
88 // Storage for output samples that are not yet asked for. 89 // Storage for output samples that are not yet asked for.
89 rtc::scoped_ptr<int8_t[]> playout_cache_buffer_; 90 std::unique_ptr<int8_t[]> playout_cache_buffer_;
90 // Location of first unread output sample. 91 // Location of first unread output sample.
91 size_t playout_cached_buffer_start_; 92 size_t playout_cached_buffer_start_;
92 // Number of bytes stored in output (contain samples to be played out) cache. 93 // Number of bytes stored in output (contain samples to be played out) cache.
93 size_t playout_cached_bytes_; 94 size_t playout_cached_bytes_;
94 // Storage for input samples that are about to be delivered to the WebRTC 95 // Storage for input samples that are about to be delivered to the WebRTC
95 // ADB or remains from the last successful delivery of a 10ms audio buffer. 96 // ADB or remains from the last successful delivery of a 10ms audio buffer.
96 rtc::scoped_ptr<int8_t[]> record_cache_buffer_; 97 std::unique_ptr<int8_t[]> record_cache_buffer_;
97 // Required (max) size in bytes of the |record_cache_buffer_|. 98 // Required (max) size in bytes of the |record_cache_buffer_|.
98 const size_t required_record_buffer_size_bytes_; 99 const size_t required_record_buffer_size_bytes_;
99 // Number of bytes in input (contains recorded samples) cache. 100 // Number of bytes in input (contains recorded samples) cache.
100 size_t record_cached_bytes_; 101 size_t record_cached_bytes_;
101 // Read and write pointers used in the buffering scheme on the recording side. 102 // Read and write pointers used in the buffering scheme on the recording side.
102 size_t record_read_pos_; 103 size_t record_read_pos_;
103 size_t record_write_pos_; 104 size_t record_write_pos_;
104 }; 105 };
105 106
106 } // namespace webrtc 107 } // namespace webrtc
107 108
108 #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 | « webrtc/modules/audio_device/dummy/file_audio_device.h ('k') | webrtc/modules/audio_device/fine_audio_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698