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

Side by Side Diff: webrtc/common_audio/audio_converter.h

Issue 1726043002: Revert of Replace scoped_ptr with unique_ptr in webrtc/common_audio/ (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
« no previous file with comments | « no previous file | webrtc/common_audio/audio_converter.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 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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_COMMON_AUDIO_AUDIO_CONVERTER_H_ 11 #ifndef WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_
12 #define WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_ 12 #define WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_
13 13
14 #include <memory>
15
16 #include "webrtc/base/constructormagic.h" 14 #include "webrtc/base/constructormagic.h"
15 #include "webrtc/base/scoped_ptr.h"
17 16
18 namespace webrtc { 17 namespace webrtc {
19 18
20 // Format conversion (remixing and resampling) for audio. Only simple remixing 19 // Format conversion (remixing and resampling) for audio. Only simple remixing
21 // conversions are supported: downmix to mono (i.e. |dst_channels| == 1) or 20 // conversions are supported: downmix to mono (i.e. |dst_channels| == 1) or
22 // upmix from mono (i.e. |src_channels == 1|). 21 // upmix from mono (i.e. |src_channels == 1|).
23 // 22 //
24 // The source and destination chunks have the same duration in time; specifying 23 // The source and destination chunks have the same duration in time; specifying
25 // the number of frames is equivalent to specifying the sample rates. 24 // the number of frames is equivalent to specifying the sample rates.
26 class AudioConverter { 25 class AudioConverter {
27 public: 26 public:
28 // Returns a new AudioConverter, which will use the supplied format for its 27 // Returns a new AudioConverter, which will use the supplied format for its
29 // lifetime. Caller is responsible for the memory. 28 // lifetime. Caller is responsible for the memory.
30 static std::unique_ptr<AudioConverter> Create(size_t src_channels, 29 static rtc::scoped_ptr<AudioConverter> Create(size_t src_channels,
31 size_t src_frames, 30 size_t src_frames,
32 size_t dst_channels, 31 size_t dst_channels,
33 size_t dst_frames); 32 size_t dst_frames);
34 virtual ~AudioConverter() {}; 33 virtual ~AudioConverter() {};
35 34
36 // Convert |src|, containing |src_size| samples, to |dst|, having a sample 35 // Convert |src|, containing |src_size| samples, to |dst|, having a sample
37 // capacity of |dst_capacity|. Both point to a series of buffers containing 36 // capacity of |dst_capacity|. Both point to a series of buffers containing
38 // the samples for each channel. The sizes must correspond to the format 37 // the samples for each channel. The sizes must correspond to the format
39 // passed to Create(). 38 // passed to Create().
40 virtual void Convert(const float* const* src, size_t src_size, 39 virtual void Convert(const float* const* src, size_t src_size,
(...skipping 17 matching lines...) Expand all
58 const size_t src_frames_; 57 const size_t src_frames_;
59 const size_t dst_channels_; 58 const size_t dst_channels_;
60 const size_t dst_frames_; 59 const size_t dst_frames_;
61 60
62 RTC_DISALLOW_COPY_AND_ASSIGN(AudioConverter); 61 RTC_DISALLOW_COPY_AND_ASSIGN(AudioConverter);
63 }; 62 };
64 63
65 } // namespace webrtc 64 } // namespace webrtc
66 65
67 #endif // WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_ 66 #endif // WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_audio/audio_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698