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

Unified Diff: webrtc/common_audio/resampler/push_sinc_resampler.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/common_audio/resampler/push_sinc_resampler.h
diff --git a/webrtc/common_audio/resampler/push_sinc_resampler.h b/webrtc/common_audio/resampler/push_sinc_resampler.h
index c48ec71056fdc90d7b8ebb3b15534f7c2087d9c5..4307451113bbae88c04b6111e150b07cdc74cd6f 100644
--- a/webrtc/common_audio/resampler/push_sinc_resampler.h
+++ b/webrtc/common_audio/resampler/push_sinc_resampler.h
@@ -27,7 +27,7 @@ class PushSincResampler : public SincResamplerCallback {
// Provide the size of the source and destination blocks in samples. These
// must correspond to the same time duration (typically 10 ms) as the sample
// ratio is inferred from them.
- PushSincResampler(int source_frames, int destination_frames);
+ PushSincResampler(size_t source_frames, size_t destination_frames);
~PushSincResampler() override;
// Perform the resampling. |source_frames| must always equal the
@@ -35,12 +35,12 @@ class PushSincResampler : public SincResamplerCallback {
// at least as large as |destination_frames|. Returns the number of samples
// provided in destination (for convenience, since this will always be equal
// to |destination_frames|).
- int Resample(const int16_t* source, int source_frames,
- int16_t* destination, int destination_capacity);
- int Resample(const float* source,
- int source_frames,
- float* destination,
- int destination_capacity);
+ size_t Resample(const int16_t* source, size_t source_frames,
+ int16_t* destination, size_t destination_capacity);
+ size_t Resample(const float* source,
+ size_t source_frames,
+ float* destination,
+ size_t destination_capacity);
// Delay due to the filter kernel. Essentially, the time after which an input
// sample will appear in the resampled output.
@@ -50,7 +50,7 @@ class PushSincResampler : public SincResamplerCallback {
protected:
// Implements SincResamplerCallback.
- void Run(int frames, float* destination) override;
+ void Run(size_t frames, float* destination) override;
private:
friend class PushSincResamplerTest;
@@ -60,13 +60,13 @@ class PushSincResampler : public SincResamplerCallback {
rtc::scoped_ptr<float[]> float_buffer_;
const float* source_ptr_;
const int16_t* source_ptr_int_;
- const int destination_frames_;
+ const size_t destination_frames_;
// True on the first call to Resample(), to prime the SincResampler buffer.
bool first_pass_;
// Used to assert we are only requested for as much data as is available.
- int source_available_;
+ size_t source_available_;
DISALLOW_COPY_AND_ASSIGN(PushSincResampler);
};
« no previous file with comments | « webrtc/common_audio/resampler/push_resampler.cc ('k') | webrtc/common_audio/resampler/push_sinc_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698