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

Side by Side Diff: webrtc/common_audio/resampler/include/push_resampler.h

Issue 1231713002: Update audio code to use size_t more correctly, webrtc/common_audio/resampler/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 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/resampler/include/resampler.h » ('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) 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
(...skipping 15 matching lines...) Expand all
26 PushResampler(); 26 PushResampler();
27 virtual ~PushResampler(); 27 virtual ~PushResampler();
28 28
29 // Must be called whenever the parameters change. Free to be called at any 29 // Must be called whenever the parameters change. Free to be called at any
30 // time as it is a no-op if parameters have not changed since the last call. 30 // time as it is a no-op if parameters have not changed since the last call.
31 int InitializeIfNeeded(int src_sample_rate_hz, int dst_sample_rate_hz, 31 int InitializeIfNeeded(int src_sample_rate_hz, int dst_sample_rate_hz,
32 int num_channels); 32 int num_channels);
33 33
34 // Returns the total number of samples provided in destination (e.g. 32 kHz, 34 // Returns the total number of samples provided in destination (e.g. 32 kHz,
35 // 2 channel audio gives 640 samples). 35 // 2 channel audio gives 640 samples).
36 int Resample(const T* src, int src_length, T* dst, int dst_capacity); 36 int Resample(const T* src, size_t src_length, T* dst, size_t dst_capacity);
37 37
38 private: 38 private:
39 rtc::scoped_ptr<PushSincResampler> sinc_resampler_; 39 rtc::scoped_ptr<PushSincResampler> sinc_resampler_;
40 rtc::scoped_ptr<PushSincResampler> sinc_resampler_right_; 40 rtc::scoped_ptr<PushSincResampler> sinc_resampler_right_;
41 int src_sample_rate_hz_; 41 int src_sample_rate_hz_;
42 int dst_sample_rate_hz_; 42 int dst_sample_rate_hz_;
43 int num_channels_; 43 int num_channels_;
44 rtc::scoped_ptr<T[]> src_left_; 44 rtc::scoped_ptr<T[]> src_left_;
45 rtc::scoped_ptr<T[]> src_right_; 45 rtc::scoped_ptr<T[]> src_right_;
46 rtc::scoped_ptr<T[]> dst_left_; 46 rtc::scoped_ptr<T[]> dst_left_;
47 rtc::scoped_ptr<T[]> dst_right_; 47 rtc::scoped_ptr<T[]> dst_right_;
48 }; 48 };
49 49
50 } // namespace webrtc 50 } // namespace webrtc
51 51
52 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_INCLUDE_PUSH_RESAMPLER_H_ 52 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_INCLUDE_PUSH_RESAMPLER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_audio/resampler/include/resampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698