summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authorscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 21:35:05 +0000
committerscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 21:35:05 +0000
commit817bb536f42548dd2d6e57f5d65bbc6ad59397d9 (patch)
tree050a9f903fb2e9e90c763b3b9a080d85b3f4978e /media/audio
parent033f342bd5ae69efaa4c0bbbf446427c8ba9907e (diff)
downloadchromium_src-817bb536f42548dd2d6e57f5d65bbc6ad59397d9.zip
chromium_src-817bb536f42548dd2d6e57f5d65bbc6ad59397d9.tar.gz
chromium_src-817bb536f42548dd2d6e57f5d65bbc6ad59397d9.tar.bz2
Revert 126474 - Remove unused AudioBuffersState member.
Review URL: http://codereview.chromium.org/9689015 TBR=enal@chromium.org Review URL: https://chromiumcodereview.appspot.com/9692067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/audio_buffers_state.cc12
-rw-r--r--media/audio/audio_buffers_state.h18
2 files changed, 21 insertions, 9 deletions
diff --git a/media/audio/audio_buffers_state.cc b/media/audio/audio_buffers_state.cc
index 7e829fe..f31cf1d 100644
--- a/media/audio/audio_buffers_state.cc
+++ b/media/audio/audio_buffers_state.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 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.
@@ -6,11 +6,17 @@
AudioBuffersState::AudioBuffersState()
: pending_bytes(0),
- hardware_delay_bytes(0) {
+ hardware_delay_bytes(0),
+ timestamp(base::Time::Now()) {
}
AudioBuffersState::AudioBuffersState(int pending_bytes,
int hardware_delay_bytes)
: pending_bytes(pending_bytes),
- hardware_delay_bytes(hardware_delay_bytes) {
+ hardware_delay_bytes(hardware_delay_bytes),
+ timestamp(base::Time::Now()) {
+}
+
+int AudioBuffersState::total_bytes() {
+ return pending_bytes + hardware_delay_bytes;
}
diff --git a/media/audio/audio_buffers_state.h b/media/audio/audio_buffers_state.h
index a7299e1..796c081 100644
--- a/media/audio/audio_buffers_state.h
+++ b/media/audio/audio_buffers_state.h
@@ -1,21 +1,21 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
#ifndef MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
#define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
+#include "base/time.h"
#include "media/base/media_export.h"
-// AudioBuffersState struct stores current state of audio buffers.
-// It is used for audio synchronization.
+// AudioBuffersState struct stores current state of audio buffers along with
+// the timestamp of the moment this state corresponds to. It is used for audio
+// synchronization.
struct MEDIA_EXPORT AudioBuffersState {
AudioBuffersState();
AudioBuffersState(int pending_bytes, int hardware_delay_bytes);
- int total_bytes() {
- return pending_bytes + hardware_delay_bytes;
- }
+ int total_bytes();
// Number of bytes we currently have in our software buffer.
int pending_bytes;
@@ -23,6 +23,12 @@ struct MEDIA_EXPORT AudioBuffersState {
// Number of bytes that have been written to the device, but haven't
// been played yet.
int hardware_delay_bytes;
+
+ // Timestamp of the moment when the buffers state was captured. It is used
+ // to account for the time it takes to deliver AudioBuffersState from
+ // the browser process to the renderer.
+ base::Time timestamp;
};
+
#endif // MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_