diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 06:39:06 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 06:39:06 +0000 |
commit | f6eeded10a75632e1bc5ecaad9be46553c4ab908 (patch) | |
tree | 8a400e987cd72f1a4b799ce086f3d4169d87b0e9 /media/audio/simple_sources.h | |
parent | 29a984ff619eb0bdd27bc612bed55f6146cce4fe (diff) | |
download | chromium_src-f6eeded10a75632e1bc5ecaad9be46553c4ab908.zip chromium_src-f6eeded10a75632e1bc5ecaad9be46553c4ab908.tar.gz chromium_src-f6eeded10a75632e1bc5ecaad9be46553c4ab908.tar.bz2 |
Remove size_t from audio IPC code.
The change got to this size because I had to modify the surrounding code (I didn't want to just cast at the last minute).
Review URL: http://codereview.chromium.org/577006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/simple_sources.h')
-rw-r--r-- | media/audio/simple_sources.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h index d43fcdf..9d0619f 100644 --- a/media/audio/simple_sources.h +++ b/media/audio/simple_sources.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,8 +25,8 @@ class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback { virtual ~SineWaveAudioSource() {} // Implementation of AudioSourceCallback. - virtual size_t OnMoreData(AudioOutputStream* stream, - void* dest, size_t max_size, int pending_bytes); + virtual uint32 OnMoreData(AudioOutputStream* stream, + void* dest, uint32 max_size, uint32 pending_bytes); virtual void OnClose(AudioOutputStream* stream); virtual void OnError(AudioOutputStream* stream, int code); @@ -45,11 +45,11 @@ class PushAudioOutput { // Write audio data to the audio device. It will be played eventually. // Returns false on failure. - virtual bool Write(const void* data, size_t len) = 0; + virtual bool Write(const void* data, uint32 len) = 0; // Returns the number of bytes that have been buffered but not yet given // to the audio device. - virtual size_t UnProcessedBytes() = 0; + virtual uint32 UnProcessedBytes() = 0; }; // A fairly basic class to connect a push model provider PushAudioOutput to @@ -61,19 +61,19 @@ class PushSource : public AudioOutputStream::AudioSourceCallback, // Construct the audio source. Pass the same |packet_size| specified in the // AudioOutputStream::Open() here. // TODO(hclam): |packet_size| is not used anymore, remove it. - explicit PushSource(size_t packet_size); + explicit PushSource(uint32 packet_size); virtual ~PushSource(); // Write one buffer. The ideal size is |packet_size| but smaller sizes are // accepted. - virtual bool Write(const void* data, size_t len); + virtual bool Write(const void* data, uint32 len); // Return the total number of bytes not given to the audio device yet. - virtual size_t UnProcessedBytes(); + virtual uint32 UnProcessedBytes(); // Implementation of AudioSourceCallback. - virtual size_t OnMoreData(AudioOutputStream* stream, - void* dest, size_t max_size, int pending_bytes); + virtual uint32 OnMoreData(AudioOutputStream* stream, + void* dest, uint32 max_size, uint32 pending_bytes); virtual void OnClose(AudioOutputStream* stream); virtual void OnError(AudioOutputStream* stream, int code); @@ -81,17 +81,17 @@ class PushSource : public AudioOutputStream::AudioSourceCallback, // Defines the unit of playback. We own the memory pointed by |buffer|. struct Packet { char* buffer; - size_t size; + uint32 size; }; // Free acquired resources. void CleanUp(); - const size_t packet_size_; + const uint32 packet_size_; typedef std::list<Packet> PacketList; PacketList packets_; - size_t buffered_bytes_; - size_t front_buffer_consumed_; + uint32 buffered_bytes_; + uint32 front_buffer_consumed_; // Serialize access to packets_ and buffered_bytes_ using this lock. Lock lock_; }; |