summaryrefslogtreecommitdiffstats
path: root/media
Commit message (Collapse)AuthorAgeFilesLines
* Cleaned up AudioRendererAlgorithmBase: moved data members to private section ↵kylep@chromium.org2009-06-224-46/+71
| | | | | | | | and added accessors. Review URL: http://codereview.chromium.org/140080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18974 0039d316-1c4b-4281-b951-d872f2087c98
* Removing FilterHost::PostTask() in preparation of injected message loops.scherkus@chromium.org2009-06-225-49/+2
| | | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/145001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18972 0039d316-1c4b-4281-b951-d872f2087c98
* Renamed media::VideoThread to the more appropriate media::VideoRendererBase.scherkus@chromium.org2009-06-227-781/+299
| | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/141059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18970 0039d316-1c4b-4281-b951-d872f2087c98
* FFmpegDemuxerStream::Read() now functions properly while stopped.scherkus@chromium.org2009-06-223-29/+154
| | | | | | | | | BUG=13907 TEST=some layout tests might start passing Review URL: http://codereview.chromium.org/131092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18917 0039d316-1c4b-4281-b951-d872f2087c98
* Changing overstrict CHECKs to just setting the object into an invalid state.ajwong@chromium.org2009-06-201-5/+17
| | | | | | | | BUG: 13287 Review URL: http://codereview.chromium.org/140033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18882 0039d316-1c4b-4281-b951-d872f2087c98
* Draft of base and default algorithm class for AudioRendererBase refactor.kylep@chromium.org2009-06-195-0/+295
| | | | | | Review URL: http://codereview.chromium.org/118395 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18876 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor FFmpegDemuxerTest to use gmock and eliminate flakiness.scherkus@chromium.org2009-06-195-438/+569
| | | | | | | | | | | | | | | This eliminates all final traces of the old global-functions-and-variables style of mocking, which was a massive headache to maintain and verify correctness. No new tests have been added, however gmock creates much stronger assertions for the tests themselves. I also made FFmpegDemuxerTest a friend of FFmpegDemuxer to let tests verify that all tasks on the internal demuxing thread have completed. BUG=13933 TEST=FFmpegDemuxerTest should more awesome and less flaky Review URL: http://codereview.chromium.org/126306 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18833 0039d316-1c4b-4281-b951-d872f2087c98
* Setting svn:eol-style LF for media source files.scherkus@chromium.org2009-06-174-78/+79
| | | | | | | | | | | Removed some trailing whitespace as well and fixed some style nits. No code change. TEST=none BUG=none TBR=hclam Review URL: http://codereview.chromium.org/125225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18577 0039d316-1c4b-4281-b951-d872f2087c98
* Serialize calls to avcodec_open() and avcodec_close().scherkus@chromium.org2009-06-175-28/+47
| | | | | | | | BUG=http://crbug.com/13907 TEST=some media layout tests should start passing consistently Review URL: http://codereview.chromium.org/126243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18570 0039d316-1c4b-4281-b951-d872f2087c98
* Refactored, templatized, commented and moved TestReader to the fancy new ↵scherkus@chromium.org2009-06-163-60/+100
| | | | | | | | | | MockReader. Previously only used by FFmpegDemuxerTest, it's not templated so we can use it with FFmpegVideoDecoderTest and FFmpegAudioDecoderTest and any other sort of demuxer or decoder for that matter. Review URL: http://codereview.chromium.org/126027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18547 0039d316-1c4b-4281-b951-d872f2087c98
* Since the introduction of PushSource, there are two buffering layers in thehclam@chromium.org2009-06-164-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Adding in ffmpeg_common.h into header for definition of CodecID.ajwong@chromium.org2009-06-161-6/+3
| | | | | | Review URL: http://codereview.chromium.org/125163 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18459 0039d316-1c4b-4281-b951-d872f2087c98
* Make the generated stubs weak. Enable the unittests that had conflicting ↵ajwong@chromium.org2009-06-1611-72/+63
| | | | | | | | | | symbols. Also move some of the old mocks into their own namespace. They were causing linker confusion due to inlining or something which generated bad test executables that segfaulted. Review URL: http://codereview.chromium.org/126170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18457 0039d316-1c4b-4281-b951-d872f2087c98
* Moving MockFFmpeg to its own file and some media.gyp cleanup.scherkus@chromium.org2009-06-154-75/+116
| | | | | | | | Step one of having a completely mocked FFmpeg library. Review URL: http://codereview.chromium.org/126160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18455 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing bug that 8bit PCM stream is gabbledhclam@chromium.org2009-06-151-8/+10
| | | | | | | | | | | | | | | | | | The CodecContext passed into FFmpegAudioDecoder by the FFmpegDemuxer says the output samples are 16bits. So we tell the audio renderer to create a 16bits audio output stream. But after the decoder is allocated by avcodec_find_codec, the sample bits information in |codec_context_| is changed to 8bit! So we are feeding 16bits output stream with 8bits data. The decoder should knows more about the actual output format. So query the sample bits information after the decoder is allocated. Review URL: http://codereview.chromium.org/125027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18406 0039d316-1c4b-4281-b951-d872f2087c98
* Fix A/V sync regression caused by not queueing video timestamps properly.scherkus@chromium.org2009-06-121-6/+9
| | | | | | Review URL: http://codereview.chromium.org/118519 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18262 0039d316-1c4b-4281-b951-d872f2087c98
* Trust the asynchronous read protocol and stop posting tasks to the pipeline.scherkus@chromium.org2009-06-128-66/+58
| | | | | | Review URL: http://codereview.chromium.org/118458 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18257 0039d316-1c4b-4281-b951-d872f2087c98
* Unit tests for FFmpegVideoDecoder using gmock.scherkus@chromium.org2009-06-124-6/+274
| | | | | | Review URL: http://codereview.chromium.org/123030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18233 0039d316-1c4b-4281-b951-d872f2087c98
* Disabling FFmpegDemuxerTest.MP3Hack due to flakiness.scherkus@chromium.org2009-06-111-1/+3
| | | | | | | | | TBR=hclam BUG=http://crbug.com/13933 Review URL: http://codereview.chromium.org/126016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18230 0039d316-1c4b-4281-b951-d872f2087c98
* Split FFmpegDemuxerStream into a separate interface AVStreamProvider.scherkus@chromium.org2009-06-1111-46/+80
| | | | | | | | Pure refactor, functionality remains the same. Review URL: http://codereview.chromium.org/122018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18213 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert r18122: "Reapply ffmpeg changes." (it broke the Linux make ↵tc@google.com2009-06-112-275/+17
| | | | | | | | | | | | build)." This reverts commit r18168 and reapplies r18122. I.e., this reapplies the ffmpeg changes. Review URL: http://codereview.chromium.org/125003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18200 0039d316-1c4b-4281-b951-d872f2087c98
* Enable <video> in test_shellhclam@chromium.org2009-06-111-0/+22
| | | | | | | | | | | | | | | | | | | | | This is a work in progress draft. Summary of changes: 1. Moved code shared by chrome and test_shell to webkie/glue: WebMediaPlayerImpl SimpleDataSource VideoRendererImpl 2. Since WebMediaPlayerImpl is shared, chrome specific renderers are enabled by passing the FilterFactoryCollection into WebMediaPlayerImpl, this is done in RenderView. And WebMediaPlayerImpl provides some default renderer filters, which are used by the test shell and also chrome. Review URL: http://codereview.chromium.org/119229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18182 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r18122: "Reapply ffmpeg changes." (it broke the Linux make build).agl@chromium.org2009-06-112-17/+275
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18168 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply ffmpeg changes. The original review is at ↵ajwong@chromium.org2009-06-112-275/+17
| | | | | | | | http://codereview.chromium.org/118046. Review URL: http://codereview.chromium.org/118444 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18122 0039d316-1c4b-4281-b951-d872f2087c98
* Removing ffmpeg again.ajwong@chromium.org2009-06-092-17/+275
| | | | | | | | Reverting r17992 and r17987. Review URL: http://codereview.chromium.org/119399 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17995 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply ffmpeg changes. The original review is at ↵ajwong@chromium.org2009-06-092-275/+17
| | | | | | | | http://codereview.chromium.org/118046. Review URL: http://codereview.chromium.org/118444 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17987 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r17820 and r17819 due to mac breakage.ajwong@chromium.org2009-06-062-17/+275
| | | | | | Review URL: http://codereview.chromium.org/119276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17821 0039d316-1c4b-4281-b951-d872f2087c98
* Change ffmpeg.gyp over to use generate_stubs.py.ajwong@chromium.org2009-06-062-275/+17
| | | | | | | | Also reimplement media_posix.cc to call into the generated stub functions instead of having its own hacked together version. Review URL: http://codereview.chromium.org/118046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17819 0039d316-1c4b-4281-b951-d872f2087c98
* Changed to use PushSource for the intermediate bufferhclam@chromium.org2009-06-052-0/+41
| | | | | | | | | | | | | | | between the IPC layer and the audio hardware interface. We have completely moved away from being blocking in AudioRendererHost. Since we'll be using PushSource for a longer period of buffering. It's necessary to have Play/Pause functionality in the AudioOutputStream, this is simulated by start/stop the AudioOutputStream multiple times. Review URL: http://codereview.chromium.org/114069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17707 0039d316-1c4b-4281-b951-d872f2087c98
* Serialized av_find_stream_info() with a Singleton Lock.scherkus@chromium.org2009-06-051-5/+30
| | | | | | Review URL: http://codereview.chromium.org/118294 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17704 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build bustage due to media_testshclam@chromium.org2009-06-042-44/+45
| | | | | | | | | | | | It's not the right time to move SineWaveAudioSource to a common unit test yet since linux doesn't have mock audio stream implemented. TBR=cpu, willchan Review URL: http://codereview.chromium.org/118286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17691 0039d316-1c4b-4281-b951-d872f2087c98
* Allow PushSource to have smaller write size than read size (packet size)hclam@chromium.org2009-06-045-56/+133
| | | | | | | | | | The change actually supports arbitrary write size but write size greater than read size (packet size) is prohibited by an explicit check. Review URL: http://codereview.chromium.org/118170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17686 0039d316-1c4b-4281-b951-d872f2087c98
* Handle end of stream for mediahclam@chromium.org2009-06-0415-58/+130
| | | | | | | | | | When FFmpegDemuxer failed to decode a raw packet, the signal of end of stream should bubble up to the renderers. It is done in this CL by creating fake buffers. This change also fixes a bug with video of only 1 frame. Review URL: http://codereview.chromium.org/113611 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17656 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce header dependencies in base/phajdan.jr@chromium.org2009-06-032-0/+2
| | | | | | | | Also adds more explicit #includes for needed things. Review URL: http://codereview.chromium.org/118162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17479 0039d316-1c4b-4281-b951-d872f2087c98
* Refactored queue of audio_renderer_base to use scoped_refptrscherkus@chromium.org2009-06-032-9/+3
| | | | | | | -Changed typedef declaration for queue to deque of scoped_refptr to Buffers-Eliminated now unnecessary calls to AddRef() and Release()Original patch by kylep@google.comhttp://codereview.chromium.org/118122 Review URL: http://codereview.chromium.org/118147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17458 0039d316-1c4b-4281-b951-d872f2087c98
* mediabench change to decode one extra frame, flushing ffmpeg-mt for the last ↵fbarchard@chromium.org2009-06-021-29/+67
| | | | | | | | | | frame. Allows single frame to be benchmarked with --video-threads=4 Review URL: http://codereview.chromium.org/113888 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17385 0039d316-1c4b-4281-b951-d872f2087c98
* Better seeking for <video> and <audio>hclam@chromium.org2009-05-2910-71/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There two problems surrouding the seek feature for <video> and <audio>: 1. After each seek, the time goes back and forth until stable, so user has to "fight" the time bar for seeking. 2. When playing an audio file, sounds plays a litte bit and then the play position rewinded and plays again. The cause of above problems: 1. There are demuxed packets and decoded buffers inside decoders and renderers. When seek is requested only demuxer flush its buffers, decoders and renderers still plays a little bit of the old buffer, thus updating the time incorrectly. 2. When playing a media file, WebKit does: 1. load() 2. pause() 3. seek(0.0f) 4. play() Since load() does prerolling internally, there were some decoded buffers in the renderers, and when seek(0.0f) is fired the play position reset to time 0 and decode starts from there again, the internal buffer queue in the renderer would then look like: | 0.0s | | 0.1s | | 0.2s | | 0.0s | | 0.1s | ... Thus playback at the beginning goes back and forth. To solve the seek problems, here's what is done in this CL: 1. All decoders and renderers should receive the seek signal. 2. When seek signal is received, discard all buffers and schedule read again. With this CL, we can now scrub an <audio> tag with the timebar. The downside of this fix is that we don't have prerolling (notice that due to how WebKit starts playing back we didn't preroll anyway...), this should be fixed in another CL. Review URL: http://codereview.chromium.org/113891 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17242 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup media::SeekableBuffer and unit testshclam@chromium.org2009-05-283-176/+153
| | | | | | | | | | TEST=SeekableBufferTest.* Updating media::SeekableBuffer and unit tests to meet code style standards. Review URL: http://codereview.chromium.org/114042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17084 0039d316-1c4b-4281-b951-d872f2087c98
* Change default audio device from "plug:default" to "default".ajwong@chromium.org2009-05-273-4/+5
| | | | | | Review URL: http://codereview.chromium.org/113923 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17040 0039d316-1c4b-4281-b951-d872f2087c98
* Non blocking audio sourcecpu@google.com2009-05-234-6/+241
| | | | | | | | | | | | | | - New interface PushAudioOutput for push model source - New adapter class PushSource which converts from pull model to push model - A test audio file (made by me using freeware program WavePad) - A new test TEST=unit test included. Review URL: http://codereview.chromium.org/115223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16825 0039d316-1c4b-4281-b951-d872f2087c98
* Media player adds seek menu and dialog.fbarchard@chromium.org2009-05-229-596/+866
| | | | | | Review URL: http://codereview.chromium.org/115692 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16778 0039d316-1c4b-4281-b951-d872f2087c98
* New YUV data for next unittest iteration.fbarchard@chromium.org2009-05-222-0/+2
| | | | | | Review URL: http://codereview.chromium.org/113756 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16774 0039d316-1c4b-4281-b951-d872f2087c98
* New FFmpeg public API headers to match our source tarball in deps.scherkus@chromium.org2009-05-225-103/+137
| | | | | | Review URL: http://codereview.chromium.org/113748 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16771 0039d316-1c4b-4281-b951-d872f2087c98
* Explicitly enable /INCREMENTAL linking for gyp-generated Debug builds.sgk@google.com2009-05-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | Explicitly disable it (/INCREMENTAL:NO) for Release, and for the following targets that require it: chrome.dll interactive_ui_tests.exe perf_tests.exe unit_tests.exe Explicitly specificy /SUBSYSTEM:CONSOLE as default for linking, and match current practice by overriding with /SUBSYSTEM:WINDOWS for: chrome.exe chrome.dll media_player.exe sandbox_poc.exe TEST=none BUG=none Review URL: http://codereview.chromium.org/115664 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16698 0039d316-1c4b-4281-b951-d872f2087c98
* Third attempt at http://codereview.chromium.org/115276ajwong@chromium.org2009-05-216-4/+798
| | | | | | Review URL: http://codereview.chromium.org/115645 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16639 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r16622estade@chromium.org2009-05-216-798/+4
| | | | | | | | TBR=ajwong Review URL: http://codereview.chromium.org/115641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16626 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply http://codereview.chromium.org/115276ajwong@chromium.org2009-05-216-4/+798
| | | | | | Review URL: http://codereview.chromium.org/115638 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16622 0039d316-1c4b-4281-b951-d872f2087c98
* Revert http://codereview.chromium.org/115276ajwong@chromium.org2009-05-216-798/+4
| | | | | | Review URL: http://codereview.chromium.org/115624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16584 0039d316-1c4b-4281-b951-d872f2087c98
* This iteration creates one message loop per audio output stream that is ↵ajwong@chromium.org2009-05-216-4/+798
| | | | | | | | responsible for buffering data from the data source, and writing the buffers to the output device. This design blocks while waiting for data to be retrieved from the data source, which can lead to unnecessary buffer underruns in the audio device. This will be solved later after the non-blocking AudioSource interface is written. Review URL: http://codereview.chromium.org/115276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16583 0039d316-1c4b-4281-b951-d872f2087c98
* Don't update the clock if we don't have a reliable timestamp available.scherkus@chromium.org2009-05-211-5/+14
| | | | | | | | Turns out vorbis packets only have an accurate timestamp every second or so while the rest of the packets have a timestamp of zero. Problem was we were overwriting |last_fill_buffer_time_| with zeros and then updating the clock, effectively causing a ton of drift. Review URL: http://codereview.chromium.org/115593 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16561 0039d316-1c4b-4281-b951-d872f2087c98