summaryrefslogtreecommitdiffstats
path: root/media/audio
Commit message (Collapse)AuthorAgeFilesLines
* The recording in linux sometimes triggers endless delay warnings, which ↵xians@chromium.org2011-09-092-2/+15
| | | | | | | | | | | | | | | | | happens when the scheduled time for the next read callback falls behind. If we don't reset the timer, the warnings can be continuous, and our read callback scheduling mechanism becomes useless. The problem can occur in the following cases: #1, Browser is doing some intensive work, and somehow becomes less responsive, and soundcard can drop some data if its interruptions are not handled in time. For example, when we have video running on the browser. #2, Using a USB device, unplug the device during a call, then plugin again. Data is lost during the removing of the device. What the patch is doing is to reset the scheduled time for the next packet when it detects no pending data in the soundcard. So the delay wont be continously trigger due to a previous data drop. Review URL: http://codereview.chromium.org/7747022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100412 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 99236 - Very short-term change: while working on proper long-term ↵crogers@google.com2011-09-022-24/+2
| | | | | | | | | | | | | | | | | | | 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
* Update base/timer.h code to pass through Location from call sites. (reland) ↵jbates@chromium.org2011-09-022-2/+2
| | | | | | | | original CL w/LGTMs: http://codereview.chromium.org/7812036/ Review URL: http://codereview.chromium.org/7824041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99409 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location,mattm@chromium.org2011-09-022-2/+2
| | | | | | | | | | | | so the original code that created the delayed callback is lost." This reverts commit 4cf5cf73d319b69c32ad30af8954235755856455. (r99284) TBR=jbates@chromium.org Review URL: http://codereview.chromium.org/7825026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99290 0039d316-1c4b-4281-b951-d872f2087c98
* Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, so ↵jbates@chromium.org2011-09-022-2/+2
| | | | | | | | | | the original code that created the delayed callback is lost. This change adds a tracked_objects::Location parameter to the APIs in base/timer.h so we can trace the PostTask callbacks. The other files are touched to add the FROM_HERE Location parameter. Review URL: http://codereview.chromium.org/7812036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99284 0039d316-1c4b-4281-b951-d872f2087c98
* Very short-term change: while working on proper long-term solution,enal@chromium.org2011-09-012-2/+24
| | | | | | | | | | | | 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
* Fix link error with components build and media.dll. I have no idea why the ↵jam@chromium.org2011-08-301-6/+6
| | | | | | | | bots aren't seeing this, it might be an interaction with supalink. Review URL: http://codereview.chromium.org/7785013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98879 0039d316-1c4b-4281-b951-d872f2087c98
* Create media.dll / libmedia.so.darin@chromium.org2011-08-2916-51/+57
| | | | | | | | | This is a re-attempt at landing http://codereview.chromium.org/7572040, now with a DEPS roll to pick up the changes made to ffmpeg by http://codereview.chromium.org/7778004/ so that media_unittests run properly on Linux. TBR=fischman Review URL: http://codereview.chromium.org/7775004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98600 0039d316-1c4b-4281-b951-d872f2087c98
* Fix problem when 'ended' event was fired before stream really ended.enal@chromium.org2011-08-232-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Adds Surround Sound support using PulseAudio.slock@chromium.org2011-08-221-5/+78
| | | | | | | | | | | | | | Depends on codereview.chromium.org/7473021: Preliminary PulseAudio Sound Playback on Linux. PulseAudio has built in swizzling, downmixing, and upmixing. The client (Chrome) just has to give PulseAudio the channel layout of the audio it wants to play in the form of a pa_channel_map. BUG=55489, 55490 TEST= Review URL: http://codereview.chromium.org/7650002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97717 0039d316-1c4b-4281-b951-d872f2087c98
* PulseAudio Sound Playback on Linuxslock@chromium.org2011-08-195-13/+502
| | | | | | | | | | | | This is the preliminary implementation of a PulseAudio sound backend for Chrome on Linux. At first, PulseAudio's mainloop, mainloop_api, and context constructs will be used instead of the message loop system used in alsa_output. This will be stereo only at first. Also, at first, PulseAudio will be dynamically linked in media.gyp as opposed to the final solution which will dynamically link PulseAudio in runtime if it is available. BUG=32757 TEST= Review URL: http://codereview.chromium.org/7473021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97408 0039d316-1c4b-4281-b951-d872f2087c98
* Add tracing for select WebAudio functionscrogers@google.com2011-08-184-0/+12
| | | | | | | | | BUG=none TEST=none R=scherkus (original code review http://codereview.chromium.org/7646026/) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97338 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r95841 due to failing media_unittests on linux_shared bot.darin@chromium.org2011-08-0816-50/+44
| | | | | | | TBR=fischman@chromium.org Review URL: http://codereview.chromium.org/7601002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95846 0039d316-1c4b-4281-b951-d872f2087c98
* Enable media.dll / libmedia.so.darin@chromium.org2011-08-0816-44/+50
| | | | | | Review URL: http://codereview.chromium.org/7572040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95841 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 95496 - Create media.dllapatrick@chromium.org2011-08-0512-40/+38
| | | | | | | | | Review URL: http://codereview.chromium.org/7523051 TBR=darin@chromium.org Review URL: http://codereview.chromium.org/7491048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95561 0039d316-1c4b-4281-b951-d872f2087c98
* Create media.dlldarin@chromium.org2011-08-0412-38/+40
| | | | | | Review URL: http://codereview.chromium.org/7523051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95496 0039d316-1c4b-4281-b951-d872f2087c98
* Move SwizzleCoreAudioLayout5_1() closer to where it's called.scherkus@chromium.org2011-07-292-19/+17
| | | | | | Review URL: http://codereview.chromium.org/7533020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94744 0039d316-1c4b-4281-b951-d872f2087c98
* some cleanup for base/stl_utildilmah@chromium.org2011-07-192-2/+2
| | | | | | | | | | | | | 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
* Fix media code to use initializer-list style for inheritance.scherkus@chromium.org2011-07-182-6/+7
| | | | | | Review URL: http://codereview.chromium.org/7400013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92826 0039d316-1c4b-4281-b951-d872f2087c98
* [Reverted due to check_deps failure]zea@chromium.org2011-07-157-80/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix problem when 'ended' event was fired before stream really ended.enal@chromium.org2011-07-157-16/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Change base::LaunchProcess API slightlyevan@chromium.org2011-07-152-4/+3
| | | | | | | | | | | Rather than passing the out param process handle via the options, take it as a function argument. This simplifies many callers. BUG=88990 Review URL: http://codereview.chromium.org/7377012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92701 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up users of a deprecated base::LaunchApp API.evan@chromium.org2011-07-142-2/+4
| | | | | | | | BUG=88990 Review URL: http://codereview.chromium.org/7351003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92598 0039d316-1c4b-4281-b951-d872f2087c98
* Change audio renderer to communicate with host using low latency codepath.enal@chromium.org2011-07-072-1/+5
| | | | | | | | | | | | | | | | | | | | | | I.e. now host signals that it is ready to accept new data using sockets, not IPC messages. That should reduce audio latency. Right now we are using high latency code path by default, low latency would be used only when flag --enable-low-latency-audio is specified. Changed unit tests to test low latency code path, as it should become default soon. http://codereview.chromium.org/7253003 BUG=http://code.google.com/p/chromium/issues/detail?id=87640 TEST=Everything should just work. I changed audio_renderer_impl_unittest.cc to explicitly force low latency code path. Review URL: http://codereview.chromium.org/7253003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91727 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang.jhawkins@chromium.org2011-06-221-2/+2
| | | | | | | | | | | BUG=none TEST=none R=vandebo@chromium.org Review URL: http://codereview.chromium.org/7241004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90123 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Pass parameters by reference.jhawkins@chromium.org2011-06-2230-54/+68
| | | | | | | | | | | | | CID=13686,13687,13688,13709,13710,13711,13712,13713,13714,13718,13715,13716, 13717,13796,13797,13798,13811,13812,13813,14708,16329 BUG=none TEST=none R=vandebo@chromium.org Review URL: http://codereview.chromium.org/7218031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90112 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Initialize member variables.jhawkins@chromium.org2011-06-223-0/+4
| | | | | | | | | | | | CID=13721,14709,16392,17192,17585 BUG=none TEST=none R=kmadhusu@chromium.org Review URL: http://codereview.chromium.org/7206066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90086 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug when unplugging an audio input device whilst using speech input on ↵allanwoj@chromium.org2011-06-154-5/+90
| | | | | | | | | | | | | Windows. Added a three second timeout for not receiving an OnData callback in AudioInputController and a one second timeout for not receiving any callback in PCMWaveInAudioInputStream. Also added a unit test fixture for it. BUG=79936 TEST=Unplug microphone while using speech input, browser should no longer hang. Review URL: http://codereview.chromium.org/7129057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89197 0039d316-1c4b-4281-b951-d872f2087c98
* Improve and unify Mac OS X run-time version checks.mark@chromium.org2011-06-141-4/+2
| | | | | | | | | | | | Don't use base::SysInfo::OperatingSystemVersionNumbers, because it calls Gestalt, which has a few bad properties. Introduce new functions that perform specific version checks. BUG=85972 TEST=base_unittests MacUtilTest.IsOSEllipsis Review URL: http://codereview.chromium.org/7144007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89028 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify AlsaPcmOutputStream and AudioManagerLinux. Code was thread-safe, ↵enal@chromium.org2011-06-085-273/+159
| | | | | | | | | | | | | | but now client and audio threads are the same, so we don't need locks/ref counts/etc. http://codereview.chromium.org/7117001 BUG=62588 Review URL: http://codereview.chromium.org/7117001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88369 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for CoreAudio stereo problem for unknown speakersannacc@chromium.org2011-06-081-2/+22
| | | | | | | | | | BUG=85100 TEST=HTML5 videos with stereo channel layout on Mac with unconfigured speakers can be heard. Review URL: http://codereview.chromium.org/7134001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88339 0039d316-1c4b-4281-b951-d872f2087c98
* Better memory management for audio channel swizzle code.annacc@chromium.org2011-06-021-10/+16
| | | | | | | | | | | | | | This patch fixes some of the errors created by: http://codereview.chromium.org/7047020/ To see memory issue suppressions, see http://codereview.chromium.org/7077020/ and http://codereview.chromium.org/7085020/ BUG=84142 TEST=tools/valgrind/chrome_tests.sh -t media --gtest_filter=MacAudioTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=87535 Review URL: http://codereview.chromium.org/7094007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87616 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 87535 - Better memory management for audio channel swizzle code.michaeln@google.com2011-06-011-16/+10
| | | | | | | | | | | | | | | | This patch fixes some of the errors created by: http://codereview.chromium.org/7047020/ To see memory issue suppressions, see http://codereview.chromium.org/7077020/ and http://codereview.chromium.org/7085020/ BUG=84142 TEST=tools/valgrind/chrome_tests.sh -t media --gtest_filter=MacAudioTest.* Review URL: http://codereview.chromium.org/7094007 TBR=annacc@chromium.org Review URL: http://codereview.chromium.org/7074037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87540 0039d316-1c4b-4281-b951-d872f2087c98
* Better memory management for audio channel swizzle code.annacc@chromium.org2011-06-011-10/+16
| | | | | | | | | | | | | This patch fixes some of the errors created by: http://codereview.chromium.org/7047020/ To see memory issue suppressions, see http://codereview.chromium.org/7077020/ and http://codereview.chromium.org/7085020/ BUG=84142 TEST=tools/valgrind/chrome_tests.sh -t media --gtest_filter=MacAudioTest.* Review URL: http://codereview.chromium.org/7094007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87535 0039d316-1c4b-4281-b951-d872f2087c98
* Adding GetAudioInputDeviceNames() to AudioManager, which allows for device ↵scherkus@chromium.org2011-06-0112-5/+196
| | | | | | | | | | | | | | enumeration. The current version only supports the default device and isn't fully implemented for Mac/Windows yet. Patch by xians@chromium.org: http://codereview.chromium.org/7060011/ BUG=none TEST=media_unittests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87493 0039d316-1c4b-4281-b951-d872f2087c98
* Surround sound swizzling for Mac based on device channel layout preferences.annacc@chromium.org2011-05-262-20/+213
| | | | | | | | | | | | | This patch gets the surround sound channel layout from the user's device using CoreAudio. It then swizzles the channel layout from the source to match the user's prefered channel layout (if needed). BUG=none. TEST=none. Review URL: http://codereview.chromium.org/7047020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86851 0039d316-1c4b-4281-b951-d872f2087c98
* Description:annacc@chromium.org2011-05-1611-141/+241
| | | | | | | | | | | | | | | | | This patch gets the channel layout for surround sound channel order from ffmpeg and stores it so that chromium will be able to re-order the channels for various sound cards and OSes later. - AudioParameters gets a new field (channel_layout). - channel_layout.h stores an enum that we will use in chromium for channel values. - ffmpeg_common.h gets a new method for mapping the channel layout received from ffmpeg to an internal chromium enum value. BUG=None (though storing the channel order should help us solve some other bugs soon) TEST=media_unittests Review URL: http://codereview.chromium.org/6930039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85541 0039d316-1c4b-4281-b951-d872f2087c98
* iwyu: Include stringprintf.h where appropriate, part 3.jhawkins@chromium.org2011-05-121-2/+2
| | | | | | | | | | | BUG=82098 TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/7016011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85088 0039d316-1c4b-4281-b951-d872f2087c98
* Updating logging in src/media/. Using DCHECK_EQ/NE/LE() where possible.kushi.p@gmail.com2011-04-292-4/+4
| | | | | | | | | BUG=58409 TEST=None Review URL: http://codereview.chromium.org/6893032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83557 0039d316-1c4b-4281-b951-d872f2087c98
* Replace AudioDecoder::media_format() with AudioDecoderConfig.scherkus@chromium.org2011-04-263-3/+69
| | | | | | | | | | | Also includes some cleanup for AudioParameter users including a new helper method GetBytesPerSecond(). BUG=28206 TEST=media_unittests, test_shell_tests, etc... Review URL: http://codereview.chromium.org/6903007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83098 0039d316-1c4b-4281-b951-d872f2087c98
* Blind fix for a Linux only crash in AudioManager::Destroythestig@chromium.org2011-04-221-4/+6
| | | | | | | | BUG=80059 TEST=none Review URL: http://codereview.chromium.org/6878081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82612 0039d316-1c4b-4281-b951-d872f2087c98
* Open ALSA device using hw_params callsdavej@chromium.org2011-04-192-4/+72
| | | | | | | | | | | Replaced using ALSA snd_pcm_set_params() with separate snd_pcm_hw_X() calls in order to use snd_pcm_hw_params_set_rate_near() which allows for setting rates on some devices that don't normally allow some rates like 22050Hz. BUG=chromium-os:13231, chromium-os:13721 TEST=Manual, 22khz audio should play (test file in bug) Review URL: http://codereview.chromium.org/6869037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82042 0039d316-1c4b-4281-b951-d872f2087c98
* Allow audio output on Linux to work with web audio APIcrogers@google.com2011-04-161-2/+3
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6871030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81843 0039d316-1c4b-4281-b951-d872f2087c98
* Fix erratic HTML5 audio playbackdavej@chromium.org2011-04-142-21/+54
| | | | | | | | | | | | | | | This was affecting all platforms. The major issue was that he SetPlaybackRate(1) which is used to start playback was being done in the middle of the series of Seek operations. So doing Seek() followed by SetPlaybackRate(1) was done, the Seek could immediately stop the playback. To fix, Seek() was made atomic with regards to SetPlaybackRate() by delaying the execution of SetPlaybackRate until after the Seek sequence has completely finished. To make things run even smoother, a short delay was added before recyclilng a used audio stream in the Dispatcher. This gives the stream time to 'power down' before being reused. Tested on Linux, Chrome-OS (Cr48) and Mac with great results, making HTML5 audio much more usable for games. BUG=73045,59369,59370,65618 TEST=Manual, Quickly playing/stopping HTML5 audio should play cleanly. Review URL: http://codereview.chromium.org/6822019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81670 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Linux audio playbackdavej@chromium.org2011-04-142-2/+26
| | | | | | | | | | | | | Playing audio files shorter than about 11000 samples on Linux was either not working at all, or re-playing (starting and stopping on the same audio object) was working only intermittently. It was possible to stop audio playback before the first buffer was played, resulting in no sound at all. Also, if replaying, the buffer may have been dirty from the previous playback on the same device. So on Linux at least, these issues appear fixed. BUG=73045,47761,59367,59369,59370,65618 TEST=Manual, quickly playing short audio files on Linux should work Review URL: http://codereview.chromium.org/6776024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81669 0039d316-1c4b-4281-b951-d872f2087c98
* Implements AudioInputDevice API for low-latency audio input in the browser ↵scherkus@chromium.org2011-04-124-13/+85
| | | | | | | | | | | | | | process. Also refactors some shared audio code into audio_common.{cc,h}. Patch by henrika@chromim.org: http://codereview.chromium.org/6250196/ BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81315 0039d316-1c4b-4281-b951-d872f2087c98
* Mac platform was not treating 8bit PCM audio as unsigned data.sjl@google.com2011-04-011-4/+15
| | | | | | | | | | | If bits per channel is 8, open the stream as unsigned and use 128 as the silence value. BUG=70730 TEST=media_unittests and manual testing of a bunch of audio files (8 bit and others). Review URL: http://codereview.chromium.org/6689003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80181 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-2812-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Add WebKit API to retrieve the audio hardware sample-ratecrogers@google.com2011-03-232-0/+18
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6721015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79088 0039d316-1c4b-4281-b951-d872f2087c98
* Use default "output" rather than "input" device when querying hardware ↵crogers@google.com2011-03-221-3/+3
| | | | | | | | | | | sample-rate BUG=none TEST=none (tested locally on Mac OS X to verify that hardware sample-rate is correctly retrieved) Review URL: http://codereview.chromium.org/6721001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79055 0039d316-1c4b-4281-b951-d872f2087c98