diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 21:30:38 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 21:30:38 +0000 |
commit | f387b35af395c0a636a721b5cef33a46444a0b27 (patch) | |
tree | 347318649249634fc94b1965a856034ca7a305b2 /chrome/common/render_messages_internal.h | |
parent | d74aa110e3084556ba0e99b0f5d9efa94960b3d1 (diff) | |
download | chromium_src-f387b35af395c0a636a721b5cef33a46444a0b27.zip chromium_src-f387b35af395c0a636a721b5cef33a46444a0b27.tar.gz chromium_src-f387b35af395c0a636a721b5cef33a46444a0b27.tar.bz2 |
Since the introduction of PushSource, there are two buffering layers in the
browser process, the hardware buffer used in AudioOutputStream and
transportation buffer in PushSource. Together with the latency in the IPC
audio layer we have a serious AV sync problem.
To compensate the delay and latency introduced by these three factors
two parameters are added in RequestAudioPacket message that include
the buffer fill level and timestamp of the request. These two parameters
are used to determine the playback delay to be used by the audio
renderer to update the pipeline with the time delta.
So we have three parameters we need to care about:
1. Hardware buffer in AudioOutputStream
2. Buffered data in PushSource
3. IPC latency
We have accurate values for 2 and 3 but not 1. We currently don't have the
API in AudioOutputStream to query the remaining buffer in the hardware
buffer. But usually there is a large amount of data in it, e.g. on Windows
400ms worth of data. Since we now detached the hardware buffer request of
OnMoreData() from the actual packet request of IPC (by the introduction of
PushSource), it is really critical to know the buffer level in the hardware.
I made a guess of this buffer level by using the amount of last buffer copy.
Review URL: http://codereview.chromium.org/122020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages_internal.h')
-rw-r--r-- | chrome/common/render_messages_internal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index f7ba56c..7de2db7 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -508,8 +508,10 @@ IPC_BEGIN_MESSAGES(View) bool /* Whether it is visible */) // Sent by AudioRendererHost to renderer to request an audio packet. - IPC_MESSAGE_ROUTED1(ViewMsg_RequestAudioPacket, - int /* stream id */) + IPC_MESSAGE_ROUTED3(ViewMsg_RequestAudioPacket, + int /* stream id */, + size_t /* bytes in buffer */, + int64 /* message timestamp */) // Tell the renderer process that the audio stream has been created, renderer // process would be given a ShareMemoryHandle that it should write to from |