| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
TBR=abodenha@chromium.org for chrome/browser/printing/OWNERS
BUG=98716
Review URL: http://codereview.chromium.org/8912009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114758 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
When running the fake ui, behind the media stream flag, there is a missing check for available devices.
Review URL: http://codereview.chromium.org/8883042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114205 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unit tests now instantiate their own AudioManager and can choose to
use the default one or provide their own mock implementation without
having to worry about conflicting with the singleton.
The teardown sequence of the AudioManager and its thread has been cleaned
up significantly and I don't think it has been completely tested before as
the audio thread was terminated before all objects that belonged to the
thread had a chance to do cleanup. The AudioManager unit tests do not use
the actual audio thread, so this part seems to have been left out.
In Chrome, the AudioManager instance is now owned by BrowserProcessImpl
and always constructed on the UI thread. This instance is then shared
in the same way that several other 'manager' type objects are shared to
'content' code, via content::ResourceContext. Audio specific classes
do though receive a direct pointer to the AudioManager and are required
to do proper reference counting if they need to hold onto the instance.
I chose to use the ResourceContext rather than direct use of g_browser_process
to avoid requiring another singleton when writing relatively simple tests
that touch the AudioManager.
I added a couple of safeguards to guard against future regressions:
- Not more than one instance of the AudioManager should be created.
- The AudioManager should not be addrefed by its own thread. This
can basically become a circular reference and prevent deterministic
shutdown.
Reviewers: Of course you're free to review everything,
but here's the breakdown in terms of the bare minimum from
the standpoint of "Owners approval". I'm asking Henrik to be the
main reviewer of the entire patch (sorry!).
Henrik: Everything minus the below, but it would be great if you could
take a look at the whole thing, specifically media/audio.
Pawel: I'd like you to take a generic look at this approach.
The key areas as far as the singleton itself goes are in
media/audio/audio_manager[_base].* and
chrome/browser/browser_process*.*
Satish: content/browser/speech/*
media/audio/audio_manager_base.* (new reference counting code)
Andrew: content/browser/renderer_host/media/*
content/renderer/media/webrtc_audio_device_unittest.cc (Owner)
Avi: content/browser/renderer_host/render_process_host_impl.cc
content/browser/resource_context.*
William: chrome/browser/profiles/profile_io_data.cc
chrome/browser/browser_process*.*
Robert: This is basically a heads up. I hope that I didn't break the OpenBSD
implementation, but unfortunately I have no way of knowing for sure.
Shijing: Please take a look at AudioManagerLinux. I replaced the set of
active streams with a simple counter.
BUG=105249
TEST=content_unittests, media_unittests, browser_tests.
Review URL: http://codereview.chromium.org/8818012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114084 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
base/task.h is going away and being replaced by base/bind.h and base/callback.h.
This CL was automatically generated by sed.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8872030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113894 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
Return buffers that are in flight during shutdown and make sure to issue
defered stop.
BUG=106369
Review URL: http://codereview.chromium.org/8819010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113467 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/8695004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112977 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/8773023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112579 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=104314
TEST=no change
Review URL: http://codereview.chromium.org/8678021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111755 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
With this patch, all the work will be done in the IO thread instead, this is needed by WASAPI.
Review URL: http://codereview.chromium.org/8677012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111641 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
host gets controller
fix a typo (thanks ihf@)
BUG=104581
TEST=trybots
Review URL: http://codereview.chromium.org/8549010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111373 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from renderer down to the browser.
With this patch, users should be able to create a audio stream with a non-default device, and feature is only available for low-latency audio.
TEST=media_unittests, webrtc test app
BUG=None
Review URL: http://codereview.chromium.org/8491044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111153 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/8589018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110780 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=104314
TEST=no change
Review URL: http://codereview.chromium.org/8587009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110544 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
| |
TBR=henrika
Review URL: http://codereview.chromium.org/8463010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109613 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
Clean up the code a bit.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8525018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109572 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
After the device is opened, any following Open() call will get the opened device.
The device will be closed only when all users have called Close().
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8467032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109467 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
event.
Since all events (including error events) are identified by label, it's important that MediaStreamManager's requester (i.e., MediaStreamDispatcherHost) should have the label before it receives any event.
This can be done by calling device_settings_->RequestCaptureDeviceUsage asynchronously.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8495026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109466 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8499042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109363 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=103004
TEST=trybots
Review URL: http://codereview.chromium.org/8477006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108772 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multiple renderer processes
This is a split of http://codereview.chromium.org/8304017/
1. VideoCaptureController is owned by VideoCaptureManager.
2. VideoCaptureHost obtains an instance of controller from manager.
3. The largest resolution is used for the device capturing. Clients should expect frame buffers with larger resolution that they requsted. All cropping/resampling is done by clients.
4. Frame buffers are shared between renderer processes and browser process. The buffer received by clients are shared buffers. Clients are recommended to copy pixel data into their local storage. A client can slow down capture frame rate if it returns buffers slowly.
5. This patch only supported the default device. More change in media stream is needed to support user selected device. That will be a different patch.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8417046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108533 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
TBR=owners
BUG=98716
Review URL: http://codereview.chromium.org/8437002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108270 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=98716
Review URL: http://codereview.chromium.org/8400060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107964 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only content/ now has the ability to create BrowserThread objects,
with the exception that tests can create the
content::TestBrowserThread subclass, and (temporarily) code in chrome/
can create the DeprecatedBrowserThread subclass.
A follow-up change will make content/ take care of its own thread
creation, remove DeprecatedBrowserThread, and move all state and
non-trivial constructors from BrowserThread down to BrowserThreadImpl.
Also moved BrowserProcessSubThread into content/ namespace. As part
of follow-up cleanup, chrome/ will stop using this class.
BUG=98716
TEST=existing
Review URL: http://codereview.chromium.org/8392042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107718 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reader can be called after controller stopped, causing hang and/or crash.
Fix consits of 2 parts:
(1) In low latency mode output controller should check its state, exactly like
in the high latency mode, and do not call reader if it is not playing anymore.
(2) Reader should not touch socket after it is closed, and socket-related
operations should be under the lock to avoid race with Close().
BUG=chromium-os:21130
BUG=chromium-os:17357
Review URL: http://codereview.chromium.org/8347004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106326 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
latency mode.
Problem manifested itself on Mac because Mac code is especially sensitive to timing, and because Mac code ignores length of data in buffer -- it assumes buffer is always full, and gives to OS the entire buffer (zeroed out in that case).
Fix consists of 2 parts:
* When starting audio stream, send request for the data -- previously code depended on data length in the buffer being 0, so it assumed no data would be played, and data would be returned starting from 2nd request.
* Implement polling "is data ready?" when starting new stream. Start physical stream only after first chunk data is available (or after ~9ms had passed, to correctly handle "old" clients not writing metadata into buffer). Polling is not continuous, it is done by task delayed by 3ms.
Fix is definitely not necessary on Windows, where we have mechanism that handles "bad" timing when requesting new data, but I decided it is better to implement it on all platforms.
Added test.
BUG=98674
TEST=Go to http://www.jimmysparkle.me/dump/chrome-bug/ and listen to the audio stream.
Review URL: http://codereview.chromium.org/8229013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105311 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
for content/browser/renderer_host/media/
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8184006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104598 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=
TEST=
Review URL: http://codereview.chromium.org/8065011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103433 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
build.
R=jam@chromium.org, darin@chromium.org
BUG=90442
TEST=
Review URL: http://codereview.chromium.org/8054037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103394 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly this was a rote conversion, replacing:
- Pass-by-pointer CallbackN<>'s become pass-by-const-ref Callback<>'s.
- scoped_ptr<CallbackN<>> members become Callback<> members.
- several dedicated FooCallback typedefs became base::Closure.
Because it was only used in a small handful of places and only in one place
profitably, I deleted AutoCallbackRunner.
Because it tickles a Bind bug I disabled mfdecoder in .gyp (about to get deleted in a scherkus CL).
BUG=none
TEST=media_tests, trybots
Review URL: http://codereview.chromium.org/8071007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103376 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
R=jam@chromium.org
BUG=90442
TEST=none
Review URL: http://codereview.chromium.org/8037041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102852 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
This is almost the same patch [1] as was reverted last week due to flakiness in one of the Win tests, but for one change: MediaStreamManager is not called from MediaStreamDispatcherHost::OnChannelClosing, to avoid shut-down crash. This will be changed as soon as the shut-down issue is solved.
[1] http://codereview.chromium.org/7649016/
Review URL: http://codereview.chromium.org/7948004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102255 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
MediaStreamManager.
Review URL: http://codereview.chromium.org/7462012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101975 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux problem is much milder, and on Mac we cannot yield high-priority audio thread...
Very short-term change: while working on proper long-term solution,
workaround for race condition that causes clicks and bad audio stream.
Yield if reader was called too quickly after previous call, as there
are good chances renderer thread did not fill the buffer yet.
BUG=http://code.google.com/p/chromium/issues/detail?id=61022
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99236
Review URL: http://codereview.chromium.org/7755001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101231 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
creating thread first when needed.
Most likely cause of new Flakiness in PrerenderBrowserTest.PrerenderUnload...
BUG=92125
TEST=
Review URL: http://codereview.chromium.org/7649016
TBR=mflodman@chromium.org
Review URL: http://codereview.chromium.org/7885034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101107 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
when needed.
BUG=92125
TEST=
Review URL: http://codereview.chromium.org/7649016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101063 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
VideoCaptureController.
Tested by removing the suppression and verifying that this command-line fails
before and passes after the .cc file change:
./tools/valgrind/chrome_tests.sh --build_dir=ninja/Debug --test content --tool tsan_rv --gtest_filter=VideoCaptureHostTest.StartCaptureErrorStop
BUG=86507
TEST=see above
Review URL: http://codereview.chromium.org/7859018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100446 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
solution,
workaround for race condition that causes clicks and bad audio stream.
Yield if reader was called too quickly after previous call, as there
are good chances renderer thread did not fill the buffer yet.
This breaks the Web Audio API completely on Mac OS X, and hoses audio for ALL applications, requiring reboot.
BUG=http://code.google.com/p/chromium/issues/detail?id=61022
Review URL: http://codereview.chromium.org/7755001
TBR=scherkus@chromium.org
Review URL: http://codereview.chromium.org/7831050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99446 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
workaround for race condition that causes clicks and bad audio stream.
Yield if reader was called too quickly after previous call, as there
are good chances renderer thread did not fill the buffer yet.
BUG=http://code.google.com/p/chromium/issues/detail?id=61022
Review URL: http://codereview.chromium.org/7755001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99236 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
(tested locally on Mac OS X)
Review URL: http://codereview.chromium.org/7762012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98523 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That caused impression that rewind does not work. With that
change small JS program
var a = new Audio("file:///home/enal/temp/click2/click2.wav");
var num_played = 0;
a.addEventListener('canplaythrough', function() {
a.play();
});
a.addEventListener('ended', function() {
num_played ++;
if (num_played < 10) {
a.currentTime = 0;
a.play();
}
});
works correctly, you hear 10 clicks one after another, and it takes
~1.5 seconds to play all 10 sounds (one click is 146ms). Current
Chrome plays only beginnings of the first 9 clicks and then entire
10th click -- 'ended' event fires too early, so rewind stops audio
playback for all clicks but last one.
With that fix you can easily create pool of audio objects -- on 'ended'
event just add audio object to the pool.
Fix consists of 2 parts:
1) When using low-latency code path renderer not only fills the buffer with
data, but also writes length of data at the end of buffer. That allows host
process to pass correct byte counts to renderer. Counter is written at the
endo of buffer, and by default it is set to buffer length, so no changes to
existing clients are necessary.
3) Renderer now keeps track of the earliest time playback can end based on the
number of rendered bytes, and will not call 'ended' callback till that time.
PS. After several comments I changed chrome code to make it much harder for
code to get buffer overrun. I was pointed that native client can write bogus
size of data into buffer, so function in chrome that reads size of data now
has extra argument -- max size of buffer, and returns min(max size of buffer,
size of data reported by client). This way min() is always called.
PPS. That is much scaled down version of the CL, it does not affect lot of
audio code paths...
BUG=http://code.google.com/p/chromium/issues/detail?id=78992
http://codereview.chromium.org/7328030
Review URL: http://codereview.chromium.org/7328030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97905 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=91397
TEST=
Review URL: http://codereview.chromium.org/7637008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97168 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The automation proxy launcher is only producing ASCII log messages, so
regular strings are fine. In the process, fix an unwanted & in one of
the log messages which causes a format string error.
The video capture test is generating a filename and should be using
FILE_PATH_LITERAL to get the right kind of string for the platform.
Review URL: http://codereview.chromium.org/7519028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96022 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Relanding 95542. Reverted due to issue caused by 95496.
BUG=none
TEST=manually
Review URL: http://codereview.chromium.org/7480032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95685 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
browser process.
BUG=none
TEST=manually
Review URL: http://codereview.chromium.org/7480032
TBR=scottfr@chromium.org
Review URL: http://codereview.chromium.org/7566054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95545 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=manually
Review URL: http://codereview.chromium.org/7480032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95542 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AudioIndputDeviceManager is responsible for tracking which devices has been opened, normally by WebKit. AudioInputDeviceManager is called from MediaStreamManager when a user has approved a webpage to use the audio input device.
AudioInputRendererHost will call AudioInputDeviceManager asking for which device to start, given the session id created when opening the device.
This patch is one of the patches to add support for WhatWG peer connection API.
This patch replaces 7081002 previously uploaded by xians.
BUG=none
TEST=unit_tests
Review URL: http://codereview.chromium.org/7307021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93224 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removed unused/irrelevant functions
removed irrelevant comments
Moved stl_util-inl.h => stl_util.h
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/7342047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93110 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/7400013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92826 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revert 92749 - Fix problem when 'ended' event was fired before stream really ended.
That caused impression that rewind does not work. With that
change small JS program
var a = new Audio("file:///home/enal/temp/click2/click2.wav");
var num_played = 0;
a.addEventListener('canplaythrough', function() {
a.play();
});
a.addEventListener('ended', function() {
num_played ++;
if (num_played < 10) {
a.currentTime = 0;
a.play();
}
});
works correctly, you hear 10 clicks one after another, and it takes
~1.5 seconds to play all 10 sounds (one click is 146ms). Current
Chrome plays only beginnings of the first 9 clicks and then entire
10th click -- 'ended' event fires too early, so rewind stops audio
playback for all clicks but last one.
With that fix you can easily create pool of audio objects -- on 'ended'
event just add audio object to the pool.
Fix consists of 3 parts:
1) For low-latency code path pass entire "audio state" object to the renderer
process. That allows renderer take into account number of pending bytes
in the buffer.
2) When using low-latency code path renderer not only fills the buffer with
data, but also writes length of data into first word of the buffer. That
allows host process to pass correct byte counts to renderer.
3) Renderer now keeps track of the earliest time playback can end based on the
number of rendered bytes, and will not call 'ended' callback till that time.
BUG=http://code.google.com/p/chromium/issues/detail?id=78992
http://codereview.chromium.org/7328030
Review URL: http://codereview.chromium.org/7328030
TBR=enal@chromium.org
Review URL: http://codereview.chromium.org/7395014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92753 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That caused impression that rewind does not work. With that
change small JS program
var a = new Audio("file:///home/enal/temp/click2/click2.wav");
var num_played = 0;
a.addEventListener('canplaythrough', function() {
a.play();
});
a.addEventListener('ended', function() {
num_played ++;
if (num_played < 10) {
a.currentTime = 0;
a.play();
}
});
works correctly, you hear 10 clicks one after another, and it takes
~1.5 seconds to play all 10 sounds (one click is 146ms). Current
Chrome plays only beginnings of the first 9 clicks and then entire
10th click -- 'ended' event fires too early, so rewind stops audio
playback for all clicks but last one.
With that fix you can easily create pool of audio objects -- on 'ended'
event just add audio object to the pool.
Fix consists of 3 parts:
1) For low-latency code path pass entire "audio state" object to the renderer
process. That allows renderer take into account number of pending bytes
in the buffer.
2) When using low-latency code path renderer not only fills the buffer with
data, but also writes length of data into first word of the buffer. That
allows host process to pass correct byte counts to renderer.
3) Renderer now keeps track of the earliest time playback can end based on the
number of rendered bytes, and will not call 'ended' callback till that time.
BUG=http://code.google.com/p/chromium/issues/detail?id=78992
http://codereview.chromium.org/7328030
Review URL: http://codereview.chromium.org/7328030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92749 0039d316-1c4b-4281-b951-d872f2087c98
|