summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_input_device.h
diff options
context:
space:
mode:
authorwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-11 22:41:17 +0000
committerwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-11 22:41:17 +0000
commit2f3f80738ee187b90210da07f34d4e2a8ff24c03 (patch)
tree7ff1fc0761db9fba0354ff6447987325ee20510c /media/audio/audio_input_device.h
parentcd1c4485a0f093b2cab163fd0e47ceec6d19f105 (diff)
downloadchromium_src-2f3f80738ee187b90210da07f34d4e2a8ff24c03.zip
chromium_src-2f3f80738ee187b90210da07f34d4e2a8ff24c03.tar.gz
chromium_src-2f3f80738ee187b90210da07f34d4e2a8ff24c03.tar.bz2
Use multiple shared memory buffers cyclically for audio capture.
Currently, only one buffer of shared memory (10ms) is used to transfer captured audio data from browser process to renderer process. This results in data overwriting on both desktop and mobile, since it gives renderer process only 10ms to pick up the data and renderer process will likely miss reading data in time from time to time due to various reasons, e.g., thread scheduling. This patch adds a scheme using multiple buffers of shared memory cyclically so that renderer process can have much more time to pick up the data. This can mitigate most data owerwriting cases which happen typically in burst mode. This approach does not introduce any new delay in browser process. The number of buffers is currently set to 10. It can be set to any positive number and be tuned if needed. BUG=178040 Review URL: https://codereview.chromium.org/12379071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_input_device.h')
-rw-r--r--media/audio/audio_input_device.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/audio/audio_input_device.h b/media/audio/audio_input_device.h
index edefdf1..e4d6230 100644
--- a/media/audio/audio_input_device.h
+++ b/media/audio/audio_input_device.h
@@ -105,7 +105,8 @@ class MEDIA_EXPORT AudioInputDevice
// AudioInputIPCDelegate implementation.
virtual void OnStreamCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_handle,
- int length) OVERRIDE;
+ int length,
+ int total_segments) OVERRIDE;
virtual void OnVolume(double volume) OVERRIDE;
virtual void OnStateChanged(
AudioInputIPCDelegate::State state) OVERRIDE;