summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_manager_base.h
Commit message (Collapse)AuthorAgeFilesLines
* Re-land software audio mixer.enal@chromium.org2012-04-191-0/+1
| | | | | | | | | | | Code goes through old or new paths depending on the AudioParameters or command-line flag. Added unit tests. Changed suppression for http://code.google.com/p/chromium/issues/detail?id=123112 because call stack changed (class was split into 2). Review URL: http://codereview.chromium.org/9691001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133010 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 132891 - Software audio mixer.thestig@chromium.org2012-04-191-1/+0
| | | | | | | | | | | | Code goes through old or new paths depending on the AudioParameters or command-line flag. Added unit tests. Review URL: http://codereview.chromium.org/9691001 TBR=enal@chromium.org Review URL: https://chromiumcodereview.appspot.com/10127002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132929 0039d316-1c4b-4281-b951-d872f2087c98
* Software audio mixer.enal@chromium.org2012-04-181-0/+1
| | | | | | | | | Code goes through old or new paths depending on the AudioParameters or command-line flag. Added unit tests. Review URL: http://codereview.chromium.org/9691001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132891 0039d316-1c4b-4281-b951-d872f2087c98
* Move media/audio files into media namespace (relanding)vrk@google.com2012-04-031-2/+6
| | | | | | | | | | BUG=115187 TEST=compiles and runs without breaking audio tag; media_unittests, content_unittests TBR=scherkus,jam Review URL: https://chromiumcodereview.appspot.com/9968054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130288 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 130180 - Move media/audio files into media namespacevrk@google.com2012-04-021-6/+2
| | | | | | | | | | | | BUG=115187 TEST=compiles and runs without breaking audio tag; media_unittests, content_unittests Review URL: https://chromiumcodereview.appspot.com/9805001 TBR=vrk@google.com Review URL: https://chromiumcodereview.appspot.com/9965076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130182 0039d316-1c4b-4281-b951-d872f2087c98
* Move media/audio files into media namespacevrk@google.com2012-04-021-2/+6
| | | | | | | | | BUG=115187 TEST=compiles and runs without breaking audio tag; media_unittests, content_unittests Review URL: https://chromiumcodereview.appspot.com/9805001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130180 0039d316-1c4b-4281-b951-d872f2087c98
* Stopping the audio thread before destroying the AudioManager<Platform>.xians@chromium.org2012-03-141-5/+12
| | | | | | | | | | | | | The destruction of the AudioManager family happens in order of: AudioManager<Platform>, AudioManagerBase, AudioManager. So before getting into the destruction of AudioManagerBase, we have make sure the audio thread has been stopped before AudioManager<Platform> is gone, otherwise it will end up into unexpected behavior, for example, crash because of pure virtual function. BUG=117470 TEST=media_unittests, Address Sanitizer Review URL: http://codereview.chromium.org/9692038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126635 0039d316-1c4b-4281-b951-d872f2087c98
* Moved the implementations of ReleaseOutputStream() and ReleaseInputStream() ↵xians@chromium.org2012-03-071-2/+40
| | | | | | | | | | | | | | | to AudioManagerBase and let all the AudioManagerPlatforms inherit the same implementations. Also moved the MakeAudioOutputStream() and MakeAudioInputStream() to AudioManagerBase, separate the AUDIO_PCM_LINEAR mode and AUDIO_PCM_LOW_LATENCY mode into two different functions inside the AudioManagerPlatforms. So that the structure is clearer and also easier to deprecate the AUDIO_PCM_LINEAR for the future. Made the destructor of the AudioManagerPlatforms protected so it can be called by only the AudioManagerBase. BUG=116064 TEST=media_unittests Review URL: http://codereview.chromium.org/9570014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125389 0039d316-1c4b-4281-b951-d872f2087c98
* Make AudioManager non-refcounted.tommi@chromium.org2012-02-151-10/+2
| | | | | | | | | BUG=107087 TEST=media and content unit tests Review URL: https://chromiumcodereview.appspot.com/9382040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122102 0039d316-1c4b-4281-b951-d872f2087c98
* Add thread safety to AudioManagerBase to protect access to the audio thread ↵tommi@chromium.org2012-01-191-6/+12
| | | | | | | | | | | | | | | | member variable. This is is a tentative fix for an issue where the AudioManager can crash while tearing down the audio thread. I suspect that this happens because more than one cleanup attempts were made since the class wasn't thread safe. I'm also changing direct access to the thread's MessageLoop* to use MessageLoopProxy based on the same theory. BUG=110051 TEST=Run media tests. Review URL: https://chromiumcodereview.appspot.com/9255017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118272 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the AudioManager singleton.tommi@chromium.org2011-12-121-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enable the device selection for linux and mac by passing a device unique id ↵xians@chromium.org2011-11-221-0/+2
| | | | | | | | | | | | | | | 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
* Add a method to the audio manager to find out if recording is currently ↵leandrogracia@chromium.org2011-10-131-8/+24
| | | | | | | | | | | | | | | active in Chrome. Adding also missing OVERRIDEs in the affected files. BUG=97388 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105333 Review URL: http://codereview.chromium.org/8208013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105337 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 105333: OVERRIDE failures on asan - Add a method to the audio manager ↵erg@google.com2011-10-131-24/+8
| | | | | | | | | | | | | | | | to find out if recording is currently active in Chrome. Adding also missing OVERRIDEs in the affected files. BUG=97388 TEST=none Review URL: http://codereview.chromium.org/8208013 TBR=leandrogracia@chromium.org Review URL: http://codereview.chromium.org/8276008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105335 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method to the audio manager to find out if recording is currently ↵leandrogracia@chromium.org2011-10-131-8/+24
| | | | | | | | | | | | | active in Chrome. Adding also missing OVERRIDEs in the affected files. BUG=97388 TEST=none Review URL: http://codereview.chromium.org/8208013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105333 0039d316-1c4b-4281-b951-d872f2087c98
* Create media.dll / libmedia.so.darin@chromium.org2011-08-291-2/+2
| | | | | | | | | 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
* Revert r95841 due to failing media_unittests on linux_shared bot.darin@chromium.org2011-08-081-2/+2
| | | | | | | 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-081-2/+2
| | | | | | Review URL: http://codereview.chromium.org/7572040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95841 0039d316-1c4b-4281-b951-d872f2087c98
* Adding GetAudioInputDeviceNames() to AudioManager, which allows for device ↵scherkus@chromium.org2011-06-011-0/+5
| | | | | | | | | | | | | | 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
* Adds method to invoke platform provided audio input UI.satish@chromium.org2011-03-011-0/+3
| | | | | | | | | | | This will be used in a future CL by the speech input feature. BUG=69886 TEST=none Review URL: http://codereview.chromium.org/6602012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76363 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/thread.h to base/threading, fix up callers to use the new location.brettw@chromium.org2011-01-011-1/+1
| | | | | | | | TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6028009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70345 0039d316-1c4b-4281-b951-d872f2087c98
* Fix AudioManager shutdownacolwell@chromium.org2010-12-231-0/+1
| | | | | | | | | | | | | | | | | | This patch makes sure the audio thread is stopped before the AudioManager is destroyed. Under heavy load it is possible to have tasks still on the audio thread's message loop when the audio manager is destroyed. These were getting called when the Thread object is destroyed which happens after all of the AudioManager destructors are called. The new Cleanup() method stops the thread before any destruction occurs. BUG=67804 TEST=none Review URL: http://codereview.chromium.org/6026011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70034 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented AudioOutputProxy.sergeyu@chromium.org2010-11-241-1/+14
| | | | | | | | | | | | AudioOutputProxy implements AudioOutputStream interface, but opens audio device only when audio is playing. BUG=39825 TEST=Unittests. Review URL: http://codereview.chromium.org/5158003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67327 0039d316-1c4b-4281-b951-d872f2087c98
* On windows, send audio hardware info with speech input requests if user ↵satish@chromium.org2010-11-191-0/+2
| | | | | | | | | | | | | consented. This may help identify quality issues. BUG=61677 TEST=none Review URL: http://codereview.chromium.org/4724001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66749 0039d316-1c4b-4281-b951-d872f2087c98
* Add AudioParameters struct. Use it everywhere.sergeyu@chromium.org2010-08-311-1/+0
| | | | | | | | | BUG=None TEST=unittests Review URL: http://codereview.chromium.org/3226012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58097 0039d316-1c4b-4281-b951-d872f2087c98
* Share one thread between all AudioOutputControllers instead of creating one ↵sergeyu@chromium.org2010-08-251-0/+35
| | | | | | | | | | | per stream. TEST=unittests BUG=39825 Review URL: http://codereview.chromium.org/3185022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57392 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 57254 - Share one thread between all AudioOutputControllers instead ↵scherkus@chromium.org2010-08-241-35/+0
| | | | | | | | | | | | | | of creating one per stream. TEST=unittests BUG=39825 Review URL: http://codereview.chromium.org/3185022 TBR=sergeyu@chromium.org Review URL: http://codereview.chromium.org/3192017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57256 0039d316-1c4b-4281-b951-d872f2087c98
* Share one thread between all AudioOutputControllers instead of creating one ↵sergeyu@chromium.org2010-08-241-0/+35
per stream. TEST=unittests BUG=39825 Review URL: http://codereview.chromium.org/3185022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57254 0039d316-1c4b-4281-b951-d872f2087c98