diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:45:45 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:45:45 +0000 |
commit | 67b08a3679f9ed57abc6132e97333a408af9c318 (patch) | |
tree | 5e48722c156842eb1e3c171d986ea25ee6ef7cca /media/audio/simple_sources.h | |
parent | dd3126b2cd8ee5796cf1c0ced7cebffe9a1f889a (diff) | |
download | chromium_src-67b08a3679f9ed57abc6132e97333a408af9c318.zip chromium_src-67b08a3679f9ed57abc6132e97333a408af9c318.tar.gz chromium_src-67b08a3679f9ed57abc6132e97333a408af9c318.tar.bz2 |
Allow PushSource to have smaller write size than read size (packet size)
The change actually supports arbitrary write size but
write size greater than read size (packet size) is prohibited
by an explicit check.
Review URL: http://codereview.chromium.org/118170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/simple_sources.h')
-rw-r--r-- | media/audio/simple_sources.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h index 1da4d4f..4a3db8d 100644 --- a/media/audio/simple_sources.h +++ b/media/audio/simple_sources.h @@ -60,11 +60,12 @@ class PushSource : public AudioOutputStream::AudioSourceCallback, public: // 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); virtual ~PushSource(); // Write one buffer. The ideal size is |packet_size| but smaller sizes are - // accepted. Bigger sizes are an error. Returns false on error. + // accepted. virtual bool Write(const void* data, size_t len); // Return the total number of bytes not given to the audio device yet. @@ -90,6 +91,7 @@ class PushSource : public AudioOutputStream::AudioSourceCallback, typedef std::list<Packet> PacketList; PacketList packets_; size_t buffered_bytes_; + size_t front_buffer_consumed_; // Serialize access to packets_ and buffered_bytes_ using this lock. Lock lock_; }; |