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

Unified Diff: webrtc/common_audio/wav_file.h

Issue 1238083005: [NOT FOR REVIEW] Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@size_t
Patch Set: Checkpoint Created 5 years, 5 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
« no previous file with comments | « webrtc/common_audio/resampler/resampler.cc ('k') | webrtc/common_audio/wav_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/wav_file.h
diff --git a/webrtc/common_audio/wav_file.h b/webrtc/common_audio/wav_file.h
index 1fbf9541fabcff29af06dfda72c5d439c4d82941..bcd618c810583f7181de1fd2b7edf0de653c8329 100644
--- a/webrtc/common_audio/wav_file.h
+++ b/webrtc/common_audio/wav_file.h
@@ -24,7 +24,7 @@ namespace webrtc {
class WavWriter {
public:
// Open a new WAV file for writing.
- WavWriter(const std::string& filename, int sample_rate, int num_channels);
+ WavWriter(const std::string& filename, int sample_rate, size_t num_channels);
// Close the WAV file, after writing its header.
~WavWriter();
@@ -36,14 +36,14 @@ class WavWriter {
void WriteSamples(const int16_t* samples, size_t num_samples);
int sample_rate() const { return sample_rate_; }
- int num_channels() const { return num_channels_; }
- uint32_t num_samples() const { return num_samples_; }
+ size_t num_channels() const { return num_channels_; }
+ size_t num_samples() const { return num_samples_; }
private:
void Close();
const int sample_rate_;
- const int num_channels_;
- uint32_t num_samples_; // Total number of samples written to file.
+ const size_t num_channels_;
+ size_t num_samples_; // Total number of samples written to file.
FILE* file_handle_; // Output file, owned by this class
};
@@ -62,15 +62,15 @@ class WavReader {
size_t ReadSamples(size_t num_samples, int16_t* samples);
int sample_rate() const { return sample_rate_; }
- int num_channels() const { return num_channels_; }
- uint32_t num_samples() const { return num_samples_; }
+ size_t num_channels() const { return num_channels_; }
+ size_t num_samples() const { return num_samples_; }
private:
void Close();
int sample_rate_;
- int num_channels_;
- uint32_t num_samples_; // Total number of samples in the file.
- uint32_t num_samples_remaining_;
+ size_t num_channels_;
+ size_t num_samples_; // Total number of samples in the file.
+ size_t num_samples_remaining_;
FILE* file_handle_; // Input file, owned by this class.
};
@@ -83,13 +83,13 @@ extern "C" {
typedef struct rtc_WavWriter rtc_WavWriter;
rtc_WavWriter* rtc_WavOpen(const char* filename,
int sample_rate,
- int num_channels);
+ size_t num_channels);
void rtc_WavClose(rtc_WavWriter* wf);
void rtc_WavWriteSamples(rtc_WavWriter* wf,
const float* samples,
size_t num_samples);
int rtc_WavSampleRate(const rtc_WavWriter* wf);
-int rtc_WavNumChannels(const rtc_WavWriter* wf);
+size_t rtc_WavNumChannels(const rtc_WavWriter* wf);
uint32_t rtc_WavNumSamples(const rtc_WavWriter* wf);
#ifdef __cplusplus
« no previous file with comments | « webrtc/common_audio/resampler/resampler.cc ('k') | webrtc/common_audio/wav_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698