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

Side by Side Diff: media/base/multi_channel_resampler.h

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 8 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
« no previous file with comments | « media/base/mock_media_log.h ('k') | media/base/multi_channel_resampler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_ 5 #ifndef MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_
6 #define MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_ 6 #define MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/callback.h" 13 #include "base/callback.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/scoped_vector.h" 15 #include "base/memory/scoped_vector.h"
16 #include "media/base/sinc_resampler.h" 16 #include "media/base/sinc_resampler.h"
17 17
18 namespace media { 18 namespace media {
19 class AudioBus; 19 class AudioBus;
20 20
21 // MultiChannelResampler is a multi channel wrapper for SincResampler; allowing 21 // MultiChannelResampler is a multi channel wrapper for SincResampler; allowing
22 // high quality sample rate conversion of multiple channels at once. 22 // high quality sample rate conversion of multiple channels at once.
23 class MEDIA_EXPORT MultiChannelResampler { 23 class MEDIA_EXPORT MultiChannelResampler {
24 public: 24 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // each channel (in channel order) as SincResampler needs more data. 65 // each channel (in channel order) as SincResampler needs more data.
66 void ProvideInput(int channel, int frames, float* destination); 66 void ProvideInput(int channel, int frames, float* destination);
67 67
68 // Source of data for resampling. 68 // Source of data for resampling.
69 ReadCB read_cb_; 69 ReadCB read_cb_;
70 70
71 // Each channel has its own high quality resampler. 71 // Each channel has its own high quality resampler.
72 ScopedVector<SincResampler> resamplers_; 72 ScopedVector<SincResampler> resamplers_;
73 73
74 // Buffers for audio data going into SincResampler from ReadCB. 74 // Buffers for audio data going into SincResampler from ReadCB.
75 scoped_ptr<AudioBus> resampler_audio_bus_; 75 std::unique_ptr<AudioBus> resampler_audio_bus_;
76 76
77 // To avoid a memcpy() on the first channel we create a wrapped AudioBus where 77 // To avoid a memcpy() on the first channel we create a wrapped AudioBus where
78 // the first channel points to the |destination| provided to ProvideInput(). 78 // the first channel points to the |destination| provided to ProvideInput().
79 scoped_ptr<AudioBus> wrapped_resampler_audio_bus_; 79 std::unique_ptr<AudioBus> wrapped_resampler_audio_bus_;
80 80
81 // The number of output frames that have successfully been processed during 81 // The number of output frames that have successfully been processed during
82 // the current Resample() call. 82 // the current Resample() call.
83 int output_frames_ready_; 83 int output_frames_ready_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(MultiChannelResampler); 85 DISALLOW_COPY_AND_ASSIGN(MultiChannelResampler);
86 }; 86 };
87 87
88 } // namespace media 88 } // namespace media
89 89
90 #endif // MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_ 90 #endif // MEDIA_BASE_MULTI_CHANNEL_RESAMPLER_H_
OLDNEW
« no previous file with comments | « media/base/mock_media_log.h ('k') | media/base/multi_channel_resampler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698