summaryrefslogtreecommitdiffstats
path: root/media
Commit message (Collapse)AuthorAgeFilesLines
* Reenable frame size change unit tests.acolwell@chromium.org2011-11-101-6/+2
| | | | | | | | | BUG=102789 TEST=FFmpegVideoDecoderTest.DecodeFrame_LargerHeight, FFmpegVideoDecoderTest.DecodeFrame_LargerWidth Review URL: http://codereview.chromium.org/8526004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109533 0039d316-1c4b-4281-b951-d872f2087c98
* Correct some rounding errors introduced recently.cevans@chromium.org2011-11-101-4/+4
| | | | | | | BUG=101494 Review URL: http://codereview.chromium.org/8511043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109480 0039d316-1c4b-4281-b951-d872f2087c98
* Use a dynamic kNoAudioReadAgainTimeoutMs which is equivalent to half of ↵xians@chromium.org2011-11-101-9/+13
| | | | | | | | | | | | | packetsize in MS to be able to use 10ms buffer size for recording in linux. Also use the same minimum required latency as output does, to make sure it handles the linux kernel timeslice. Bug=None Test=Manual test in browser and chromebook Review URL: http://codereview.chromium.org/8203006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109423 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash in UMA-reporting aspect ratio when video height is zero.fischman@chromium.org2011-11-101-2/+6
| | | | | | | | | | | | | Also fixed a DCHECK that gets triggered in the same case (audio renderer is destroyed without ever having been created, so DCHECK_NE(stream_id_, 0) was failing). BUG=103552 TEST=failing video stops crashing renderer Review URL: http://codereview.chromium.org/8510017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109379 0039d316-1c4b-4281-b951-d872f2087c98
* Implement polling for data becoming ready when starting audio stream.enal@chromium.org2011-11-095-3/+44
| | | | | | | | | | | | | | | Before the change we had polling for 1st buffer but not for subsequent ones. Do it in simplest possible way -- poll and sleep in the loop. It is probably not the best approach, but simplest and most reliable. We had lot of problems adding polling for 1st buffer in the existing message loop, do not want to introduce new message loop where we had not such loop before. In any case loop usually is not executed, otherwise we would have more audible glitches when starting the stream. Windows and Mac only change, we have only single buffer on Linux. TEST=Start playing HTML5 audio on extremely busy Win/MAC TEST=system with single core. Before the change you will TEST=almost always here the glitch in the beginning. TEST=That should become much more rare now. Review URL: http://codereview.chromium.org/8496022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109162 0039d316-1c4b-4281-b951-d872f2087c98
* First cut at UMA-exposing histograms of media data in the wild.fischman@chromium.org2011-11-086-6/+101
| | | | | | | | | | BUG=102589 TEST=manual inspection of chrome://histograms/Media Review URL: http://codereview.chromium.org/8439062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108951 0039d316-1c4b-4281-b951-d872f2087c98
* Add basic parsing functionality to ChunkDemuxer for skipping WebM file headers.acolwell@chromium.org2011-11-045-34/+156
| | | | | | | | | | BUG=86536 TEST=ChunkDemuxerTest::TestWebMFile Review URL: http://codereview.chromium.org/8443004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108740 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify VideoDecodeEngine interface by making everything synchronous.scherkus@chromium.org2011-11-0414-1200/+443
| | | | | | | | | | | | | | | Although I plan to remove VideoDecodeEngine entirely it requires detangling some of the code first. Other noteworthy changes: - It's no longer valid to call VideoFrameReady(NULL), instead FFmpegVideoDecoder will raise an error the moment it finds one - Buffer recycling has been vanquished (for now), with video frames always allocated in the decoder - Produce/ConsumeVideoFrame() has been replaced by Read() - Video decode byte statistics are only updated if more than 0 bytes were decoded - FFmpegVideoDecodeEngine no longer attempts to preroll Review URL: http://codereview.chromium.org/8417019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108612 0039d316-1c4b-4281-b951-d872f2087c98
* Minor clean up on VideoRendererBase.scherkus@chromium.org2011-11-041-42/+54
| | | | | | | | | | Paving the way for additional refactoring! Removed get()s from scoped_refptr<> classes, updated DCHECKs, fixed comments, and restructured this one hairy-yet-important set of if statements. Review URL: http://codereview.chromium.org/8343078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108587 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash on unsupported pixel formats.dalecurtis@chromium.org2011-11-023-18/+34
| | | | | | | | | | | | | | Replaces the NOTREACHED() calls with DLOG(WARNING), avoids creating frames when invalid pixel formats are detected, and finally calls OnInitializeComplete(false) in FFmpegVideoDecodeEngine::Initialize. BUG=101803 TEST=Ran unittests. Ran test video. Review URL: http://codereview.chromium.org/8437021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108338 0039d316-1c4b-4281-b951-d872f2087c98
* Problem happens because we cannot stop physical stream in arbitrary moment, ↵enal@chromium.org2011-11-022-39/+45
| | | | | | | | | | | | | | | | callback thread may either ask for more data or feeding new data to audio driver. So we were setting flag and waiting for callback thread to signal that it saw the flag, stopped its activity and now it is safe to stop. Changed the code to use critical section instead. Callback thread tries to enter critical section before doing work. If it cannot it assumes that main thread issued stop and waits for all buffers to be returned and callback thread to be terminated. By using TryEnterCriticalSection() instead of EnterCriticalSection() we are avoiding deadlock (there are internal Windows locks being involved, so EnterCriticalSection() in the callback will deadlock). So we would stop immediately if callback is not active, compared for waiting for callback to be called before the change, at a cost of extra enter/leave critical section per callback. Tested on Win7 and XP. (That is result of my Windows-specific audio crash investigation -- I was wrong why it happened, but while investigation I had that speedup...) Review URL: http://codereview.chromium.org/8353017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108320 0039d316-1c4b-4281-b951-d872f2087c98
* Adding transition to kPlaying when end of stream is reached during an underflow.acolwell@chromium.org2011-11-012-31/+114
| | | | | | | | | | BUG=92254 TEST=AudioRendererBaseTest::Underflow_EndOfStream Review URL: http://codereview.chromium.org/8430015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108191 0039d316-1c4b-4281-b951-d872f2087c98
* Change DemuxerStream::ReadCallback to use ref-counted buffers.scherkus@chromium.org2011-11-019-26/+22
| | | | | | | | Previously callbackees had to remember to store the buffer in a scoped_refptr<>. Review URL: http://codereview.chromium.org/8351045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108178 0039d316-1c4b-4281-b951-d872f2087c98
* refactor video capture in renderer processwjia@chromium.org2011-11-011-1/+0
| | | | | | | | | | | | | This patch is a split of http://codereview.chromium.org/8304017/ . 1. Since all clients of VideoCaptureImpl accept pixel frames with different dimension than requested, there is no need to distinguish them. Remove "resolution_fixed" in media::VideoCapture::VideoCaptureCapability. 2. VideoCaptureImpl is now taking the largested dimension from client requests and send it to browser process. 3. remove some unnecessary code in VideoCaptureModuleImpl since webrtc ViE can handle different frame size. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/8400084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108126 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up VideoRendererBase tests.scherkus@chromium.org2011-10-311-87/+225
| | | | | | | | Previously the tests were relying on locks internal to the class to prevent race conditions. Instead wait for callbacks to be executed by using a combination of synchronization primitives. Review URL: http://codereview.chromium.org/8414041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108017 0039d316-1c4b-4281-b951-d872f2087c98
* Changing a NOTREACHED to a LOG(WARNING) for cases when a mic isn't connected.tommi@chromium.org2011-10-311-1/+4
| | | | | | | | TEST=Removes a DCHECK that we would hit on machines without a mic. BUG=none Review URL: http://codereview.chromium.org/8335005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107936 0039d316-1c4b-4281-b951-d872f2087c98
* Reland the CL 8162015.xians@chromium.org2011-10-295-61/+172
| | | | | | | | | | | | | CL 8162015 failed the trybot and was reverted. But I could not reproduce the issue in my local machine, so I just make a new CL and test it on trybot again. BUG= TEST= Review URL: http://codereview.chromium.org/8361031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107842 0039d316-1c4b-4281-b951-d872f2087c98
* Remove media::VideoDecodeContext as it has no implementation and is unused.scherkus@chromium.org2011-10-2813-195/+15
| | | | | | Review URL: http://codereview.chromium.org/8417016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107796 0039d316-1c4b-4281-b951-d872f2087c98
* Miscellaneous header file cleanup for src/media.scherkus@chromium.org2011-10-288-23/+11
| | | | | | Review URL: http://codereview.chromium.org/8418017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107772 0039d316-1c4b-4281-b951-d872f2087c98
* This patch will loop through the soundcard and return a list of available ↵xians@chromium.org2011-10-282-8/+130
| | | | | | | | | | | | | | | | | | | | | | devices when the AudioInputDeviceManager does the device enumeration. Previously, only default device will be returned. This is a step forward to support device selection on Mac. I have another similar CL but on Linux: http://codereview.chromium.org/8162015/ Examples for how the device enumeration with this patch: name id Built-in Line Input AppleHDAEngineInput:1B,0,1,1:4 Built-in Digital Input AppleHDAEngineInput:1B,0,1,2:5 SB Arena Headset AppleUSBAudioEngine:Creative Technology:SB Arena Headset:5d100000:2,1 Bug=None Test=media_unittests Review URL: http://codereview.chromium.org/8276034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107771 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite FFmpegVideoDecoder tests based on existing FFmpegVideoDecodeEngine ↵scherkus@chromium.org2011-10-281-299/+434
| | | | | | | | | | tests. The old tests were mostly useless as they tested using a mocked VideoDecodeEngine. Review URL: http://codereview.chromium.org/8340008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107681 0039d316-1c4b-4281-b951-d872f2087c98
* Adding input and output delay estimation for mac. xians@chromium.org2011-10-275-25/+287
| | | | | | Review URL: http://codereview.chromium.org/8234009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107642 0039d316-1c4b-4281-b951-d872f2087c98
* Remove DemuxerStream::GetAVStream() once and for all.scherkus@chromium.org2011-10-2717-167/+251
| | | | | | | | | We now use AudioDecoderConfig and VideoDecoderConfig to pass decoder initialization information. Review URL: http://codereview.chromium.org/8341033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107494 0039d316-1c4b-4281-b951-d872f2087c98
* Fix regression and make CrOS audio codecs work again.ihf@chromium.org2011-10-262-1/+22
| | | | | | | | | TESTS=played relevant 3GP and WAV files on mario BUG=chromium-os:21037,18938 Review URL: http://codereview.chromium.org/8393037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107462 0039d316-1c4b-4281-b951-d872f2087c98
* Switch from DLOG(INFO) to DVLOG(1) for ↵scherkus@chromium.org2011-10-261-13/+14
| | | | | | | | media/audio/mac/audio_low_latency_input_mac.cc Review URL: http://codereview.chromium.org/8393029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107404 0039d316-1c4b-4281-b951-d872f2087c98
* Removes an invalid hard-coded sample rate in the low-latencyhenrika@chromium.org2011-10-261-1/+0
| | | | | | | | | | | | unit test for Windows based on WAsAPI. This is a trivial patch. BUG=none TEST=none Review URL: http://codereview.chromium.org/8387026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107306 0039d316-1c4b-4281-b951-d872f2087c98
* fix v4l support on openbsdrobert.nagy@gmail.com2011-10-251-0/+4
| | | | | | | | | | | | | media/video/capture/linux/video_capture_device_linux.cc: OpenBSD has V4L support but the header's filename is different BUG= TEST= Review URL: http://codereview.chromium.org/8380018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107227 0039d316-1c4b-4281-b951-d872f2087c98
* exclude the linux files that are not needed on openbsdrobert.nagy@gmail.com2011-10-251-3/+3
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/8394002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107185 0039d316-1c4b-4281-b951-d872f2087c98
* Stop audio streams in all codepaths that need it.fischman@chromium.org2011-10-242-10/+19
| | | | | | | | | | | | | Before we were leaving dangling streams un-Stop()'d, causing delayed messages to eventually crash the browser when their source_callback_ was followed but already invalid. BUG=101228 TEST=trybots, manual testing. Review URL: http://codereview.chromium.org/8385001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107000 0039d316-1c4b-4281-b951-d872f2087c98
* Harden audio output controller making it safe to call Pause() before Play() ↵enal@chromium.org2011-10-243-40/+120
| | | | | | | | | | | | really started. Not sure if it really fixes the crash, but crash started happening only after Play() was split into several tasks and become much slower (http://codereview.chromium.org/8229013/ change 105311). Added unit test. BUG=100650 Review URL: http://codereview.chromium.org/8371013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106983 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes yet another build error on Windows shared bot.henrika@chromium.org2011-10-242-2/+2
| | | | | | TBR=tommi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106901 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes build error on Windows shared bot.henrika@chromium.org2011-10-241-1/+2
| | | | | | | TBR=tommi Review URL: http://codereview.chromium.org/8373031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106900 0039d316-1c4b-4281-b951-d872f2087c98
* Low-latency AudioInputStream implementation based on WASAPI for Windows.henrika@chromium.org2011-10-2410-8/+1220
| | | | | | | | | Requires Windows Vista or higher. BUG=none TEST=Attached unit test (requires undefined CHROME_HEADLESS) Review URL: http://codereview.chromium.org/8283032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106899 0039d316-1c4b-4281-b951-d872f2087c98
* Improve audio underflow handling.acolwell@chromium.org2011-10-2110-46/+268
| | | | | | | | | | | | | | - Added support for increasing decoded audio queue size. - Added a mechanism to notify the pipeline when the audio underflows. - Delay resuming audio playback until the audio queue has filled up. BUG=92254 TEST=AudioRendererBaseTest.Underflow Review URL: http://codereview.chromium.org/8356022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106784 0039d316-1c4b-4281-b951-d872f2087c98
* OpenBSD patches for media, split from CR #8275005robert.nagy@gmail.com2011-10-203-16/+10
| | | | | | | | | | | | | Sync the dummy OpenBSD audio manager and exclude -mssse3 from cflags on OpenBSD since it's not supported in the used gcc version. BUG= TEST= Review URL: http://codereview.chromium.org/8329024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106590 0039d316-1c4b-4281-b951-d872f2087c98
* Change Read() size and return value to a size_t for claritycdn@chromium.org2011-10-207-15/+12
| | | | | | | | | | | BUG=100641 TEST=N/A Review URL: http://codereview.chromium.org/8352019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106533 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 106513 - The first step to add device selection to linux.garykac@chromium.org2011-10-206-168/+62
| | | | | | | | | | | | | | This patch will loop through the soundcard and return a list of available devices when the AudioInputDeviceManager does the device enumeration. Previously, only default device will be returned. Reverted because this CL caused the Linux/Windows (shared) builds to fail. Review URL: http://codereview.chromium.org/8162015 TBR=xians@chromium.org Review URL: http://codereview.chromium.org/8362004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106517 0039d316-1c4b-4281-b951-d872f2087c98
* The first step to add device selection to linux.xians@chromium.org2011-10-206-62/+168
| | | | | | | | | This patch will loop through the soundcard and return a list of available devices when the AudioInputDeviceManager does the device enumeration. Previously, only default device will be returned. Review URL: http://codereview.chromium.org/8162015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106513 0039d316-1c4b-4281-b951-d872f2087c98
* Remove kDemuxerIsWebm as it hasn't been working for a while and isn't really ↵scherkus@chromium.org2011-10-191-8/+0
| | | | | | | | | | | needed. BUG=100624 Review URL: http://codereview.chromium.org/8354009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106370 0039d316-1c4b-4281-b951-d872f2087c98
* Add NetworkEventCB to media pipeline and remove IsNetworkActive()vrk@google.com2011-10-195-32/+21
| | | | | | | | | | | | | Network events and the network status associated with the event (active or in-) should be coupled together. WebMediaPlayerImpl should not ask the PipelineImpl for network activity. BUG=100652 TEST=none Review URL: http://codereview.chromium.org/8342013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106369 0039d316-1c4b-4281-b951-d872f2087c98
* Fix race condition in audio output controller and audio sync reader.enal@chromium.org2011-10-191-0/+8
| | | | | | | | | | | | | | | | 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
* Removing media/tools/mfdecoder/main.cc as it doesn't even have a gyp target.scherkus@chromium.org2011-10-191-558/+0
| | | | | | Review URL: http://codereview.chromium.org/8353011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106318 0039d316-1c4b-4281-b951-d872f2087c98
* Adding VideoCaptureDevice for Mac.mflodman@chromium.org2011-10-186-5/+480
| | | | | | | | | | | Adding dependency on QTKit and CoreVideo. BUG= TEST= Review URL: http://codereview.chromium.org/8177008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106036 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r104043, which causes audio not to play smoothly on Chrome OS.enal@chromium.org2011-10-182-44/+23
| | | | | | | | BUG=chromium-os:21491 Review URL: http://codereview.chromium.org/8329004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105996 0039d316-1c4b-4281-b951-d872f2087c98
* Fix playing of 8-bit sample files via webaudio.rtoy@google.com2011-10-181-1/+1
| | | | | | | | | | | | | | | The bias for 8-bit samples was incorrectly applied. To hear the bug, go to the url: http://www.corp.google.com/~rtoy/audio/latency.html Press space. This should play 2 sec of an 8-bit wave file. You will hear just a click instead of a man (on one channel) and a woman (on the other channel) speaking different sentences. Review URL: http://codereview.chromium.org/8276006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105993 0039d316-1c4b-4281-b951-d872f2087c98
* Properly ref-count the EndOfStream buffers.ddorwin@chromium.org2011-10-172-11/+5
| | | | | | | | | | | Also reverts most of the test change made in r105647. BUG=99596 TEST=Valgrind on media_unittests. Review URL: http://codereview.chromium.org/8319010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105890 0039d316-1c4b-4281-b951-d872f2087c98
* Fix out of bound access with ScaleYUVToRGB32.hclam@chromium.org2011-10-174-60/+228
| | | | | | | | | | | FilterYUVRows functions had OOB problems, fixed in this patch. BUG=99480 TEST=media_unittests --gtest_filter=YUV* Review URL: http://codereview.chromium.org/8230014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105798 0039d316-1c4b-4281-b951-d872f2087c98
* Disable SSSE3 version of RGB->YUV conversion.hclam@chromium.org2011-10-171-3/+3
| | | | | | | | | | | | | Temporarily disable SSSE3 version of color conversion. It caused a color shift problem on edges of text. We should switch back to SSSE3 version when the problem is resolved. BUG=100462 TEST=Run chromoting and see the quality improvement Review URL: http://codereview.chromium.org/8306005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105782 0039d316-1c4b-4281-b951-d872f2087c98
* Fix DCHECK() when running test on Linux.enal@chromium.org2011-10-151-1/+1
| | | | | | | | When asking for data should return reasonable packet size. Review URL: http://codereview.chromium.org/8305017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105690 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Valgrind warnings from r105646.ddorwin@chromium.org2011-10-151-2/+8
| | | | | | | | | | TBR=scherkus@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/8304020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105647 0039d316-1c4b-4281-b951-d872f2087c98