summaryrefslogtreecommitdiffstats
path: root/media/base
Commit message (Collapse)AuthorAgeFilesLines
* Refactor FFmpegDemuxerTest to use gmock and eliminate flakiness.scherkus@chromium.org2009-06-192-1/+148
| | | | | | | | | | | | | | | 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
* Refactored, templatized, commented and moved TestReader to the fancy new ↵scherkus@chromium.org2009-06-161-0/+91
| | | | | | | | | | 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
* 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-163-7/+17
| | | | | | | | | | 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-152-0/+94
| | | | | | | | 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
* Split FFmpegDemuxerStream into a separate interface AVStreamProvider.scherkus@chromium.org2009-06-111-1/+1
| | | | | | | | 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-111-274/+16
| | | | | | | | | | | | 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-111-16/+274
| | | | 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-111-274/+16
| | | | | | | | 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-091-16/+274
| | | | | | | | 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-091-274/+16
| | | | | | | | 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-061-16/+274
| | | | | | 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-061-274/+16
| | | | | | | | 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
* Handle end of stream for mediahclam@chromium.org2009-06-047-23/+39
| | | | | | | | | | 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-031-0/+1
| | | | | | | | 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
* Better seeking for <video> and <audio>hclam@chromium.org2009-05-292-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* New FFmpeg public API headers to match our source tarball in deps.scherkus@chromium.org2009-05-221-91/+109
| | | | | | Review URL: http://codereview.chromium.org/113748 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16771 0039d316-1c4b-4281-b951-d872f2087c98
* Temporary fix for MP3 decoding by duplicating packets before handing them to ↵scherkus@chromium.org2009-05-201-0/+9
| | | | | | | | | | the decoder. Turns out packets filled out by av_read_frame() were being modifying on subsequent calls to av_read_frame(). Might be a case of setting the data pointer to internal memory as opposed to allocated memory. Review URL: http://codereview.chromium.org/115561 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16525 0039d316-1c4b-4281-b951-d872f2087c98
* Use av_rescale_q() for converting FFmpeg timestamps to base::TimeDelta ↵scherkus@chromium.org2009-05-201-1/+10
| | | | | | | | | | | | (second attempt). Previously we were using integer math to convert to microseconds, but depending on the frame rate and packet size we could introduce enough error that could accumulate and introduce audio/video synchronization drift. av_rescale_q() is a simple function but is designed to minimize error as much as possible. Second attempt since I forgot to manually resolve av_rescale_q() for unittests. Review URL: http://codereview.chromium.org/113619 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16514 0039d316-1c4b-4281-b951-d872f2087c98
* Revert change 16453 because it broke the build.nsylvain@chromium.org2009-05-201-10/+1
| | | | | | Review URL: http://codereview.chromium.org/113615 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16459 0039d316-1c4b-4281-b951-d872f2087c98
* Use av_rescale_q() for converting FFmpeg timestamps to base::TimeDelta.scherkus@chromium.org2009-05-201-1/+10
| | | | | | | | Previously we were using integer math to convert to microseconds, but depending on the frame rate and packet size we could introduce enough error that could accumulate and introduce audio/video synchronization drift. av_rescale_q() is a simple function but is designed to minimize error as much as possible. Review URL: http://codereview.chromium.org/113598 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16453 0039d316-1c4b-4281-b951-d872f2087c98
* SeekableBuffer to implement a window of buffer which has short seeking ability.hclam@chromium.org2009-05-193-0/+607
| | | | | | | | | | | Defined the base interface SeekableBuffer and a thread safe implemntation of ThreadSafeSeekableBuffer. This class is to be used for media resource loading that does the meat of buffer queueing and handles short seeking for short distance out-of-order read patterns. Review URL: http://codereview.chromium.org/113213 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16348 0039d316-1c4b-4281-b951-d872f2087c98
* YUV with clipping.fbarchard@chromium.org2009-05-1811-743/+639
| | | | | | | | | | | | All functions do 2 pixels at a time. 90 and 270 rotations implemented. YV16 refactored. YV12 code accepts a YuvType that allows the same code to support YV16 as well. Special case for half size removed. Special case for doubling added. 3.62 ms versus 8.62 for general purpose code. Review URL: http://codereview.chromium.org/113407 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16334 0039d316-1c4b-4281-b951-d872f2087c98
* YUV scaling and conversion refactored into low levels per platform that do a ↵fbarchard@chromium.org2009-05-139-738/+1050
| | | | | | | | | | | row and high levels that step thru the image. Low level is implemented in MMX assembly. Mac and Linux use reference code for this version. Review URL: http://codereview.chromium.org/113247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16011 0039d316-1c4b-4281-b951-d872f2087c98
* Fix failing Valgrind builds for media_unittests.scherkus@chromium.org2009-05-121-42/+44
| | | | | | | | Did some minor clean up as well. Review URL: http://codereview.chromium.org/113298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15903 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented Pipeline seek callbacks and a big refactor of PipelineImplTest.scherkus@chromium.org2009-05-126-231/+395
| | | | | | | | Now that I'm wiser writing tests, I'm trying to get rid of InitializationHelper and rely on simplier test fixtures classes. I also introduced MockFilterFactory which is capable of creating all the mock filters and is able to return instantiated instances of filters to permit testing for expectations (refer to PipelineImplTest.Seek for an example). Review URL: http://codereview.chromium.org/115094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15829 0039d316-1c4b-4281-b951-d872f2087c98
* Remove executable bit from a bunch of files that shouldn't have it.evan@chromium.org2009-05-113-0/+0
| | | | | | | | | | (No code change.) git ls-tree -r HEAD | grep '^100755' | cut -f2 | egrep '\.(png|txt|mm|cc|h|checksum|asm|js|html|c|css|xml|grd|json)$' | xargs chmod a-x git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15809 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/115197fbarchard@chromium.org2009-05-113-40/+134
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15800 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r15615, build errors on linux and mac.sgk@google.com2009-05-083-127/+38
| | | | | | Review URL: http://codereview.chromium.org/113135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15616 0039d316-1c4b-4281-b951-d872f2087c98
* YUV scaler do horizontal mirror.fbarchard@chromium.org2009-05-083-38/+127
| | | | | | Review URL: http://codereview.chromium.org/106002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15615 0039d316-1c4b-4281-b951-d872f2087c98
* Retry of enabling video on linux. See related review: ↵ajwong@chromium.org2009-05-081-3/+33
| | | | | | | | | | | | | http://codereview.chromium.org/100195 The effective changes were: 1) Adding av_register_protocol into the def file for ffmpeg in windows. 2) Commenting out the drawing glue code for non-skia platforms. 3) Fixing some mac compilation error caused by code drift. Review URL: http://codereview.chromium.org/99306 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15611 0039d316-1c4b-4281-b951-d872f2087c98
* Lands http://codereview.chromium.org/99349 for Ryan.sky@chromium.org2009-05-041-1/+5
| | | | | | | | | | | | | | Comments from Ryan: Some small changes to get chromium building on ARM. I tested these using the standard Linux tool chain and crosstools-ng. BUG=none TEST=none Review URL: http://codereview.chromium.org/99365 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15241 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Enable video in posix builds and remove unneeded ifdefs to guard ↵ajwong@chromium.org2009-05-011-38/+8
| | | | | | | | | | | | windows." This reverts commit 9c23aa9006918e7091742e1826181db081a16a65. TBR=evan Review URL: http://codereview.chromium.org/101020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15121 0039d316-1c4b-4281-b951-d872f2087c98
* Enable video in posix builds and remove unneeded ifdefs to guard windows.ajwong@chromium.org2009-05-011-8/+38
| | | | | | | | The code still crashes when trying to play a video, but this will allow debugging. Review URL: http://codereview.chromium.org/100195 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15117 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up FFmpeg media formats and switch to using ↵scherkus@chromium.org2009-04-291-1/+9
| | | | | | | | | | av_get_bits_per_sample_format(). Before we were relying on codecs setting bits_per_raw_sample, which turns out isn't a valid assumption at all (i.e., vorbis). However, codecs always set the sample format so we can use the FFmpeg utility function av_get_bits_per_sample_format() to convert the SampleFormat enum to an integer number of bits. Review URL: http://codereview.chromium.org/99160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14808 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a crash with <video>hclam@chromium.org2009-04-271-1/+1
| | | | | | | | | | | | Having typo in the file, causing a different dll loaded for <video>. When initializing ffmpeg since avformat-52.dll is not loaded, it tries to do LoadLibrary within sandbox and kaboom! TBR=scherkus Review URL: http://codereview.chromium.org/99024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14614 0039d316-1c4b-4281-b951-d872f2087c98
* Prototype audio time shift.fbarchard@chromium.org2009-04-231-1/+1
| | | | | | Review URL: http://codereview.chromium.org/92007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14366 0039d316-1c4b-4281-b951-d872f2087c98
* Move FFmpegDemuxer initialization onto the demuxer thread.scherkus@chromium.org2009-04-221-1/+35
| | | | | | | | We now have all FFmpeg function calls executing on the demuxer thread, meaning DataSource will now always receive IO operations on the demuxer thread. Review URL: http://codereview.chromium.org/87060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14205 0039d316-1c4b-4281-b951-d872f2087c98
* Hacked up delay load code for ffmpeg in posix systems. This isajwong@chromium.org2009-04-212-2/+216
| | | | | | | | | a temporary solution. We need to find a more sustainable way to do this. Review URL: http://codereview.chromium.org/87018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14150 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes FFmpegDemuxerTest.ReadAndSeek test flakiness by using a WaitableEvent.scherkus@chromium.org2009-04-211-10/+4
| | | | | | | | | | Turns out it was the test code that was flaky and not a threading bug in our actual code. Under heavy load it was possible for a thread holding onto a reference to get time sliced long enough that the unit test continued executing until it asserted that the object was deleted when in fact it was not. BUG=10653 Review URL: http://codereview.chromium.org/88010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14113 0039d316-1c4b-4281-b951-d872f2087c98
* DCHECK now allows SetPlaybackRate(0.0f) if the pipeline is stopped.ralphl@chromium.org2009-04-211-1/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14111 0039d316-1c4b-4281-b951-d872f2087c98
* YUV to RGB with arbitrary scaling.fbarchard@chromium.org2009-04-214-29/+450
| | | | | | | | | | | Semi-optimized C code achieving 33 ms for 1080 double sized or 9 ms with openmp enabled. Special case half size which is much faster. Future versions will support mirror and perhaps rotate. (mirror is free) Future versions will be MMX assembly for speed. Review URL: http://codereview.chromium.org/67278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14092 0039d316-1c4b-4281-b951-d872f2087c98
* Move the ffmpeg loading function into media library.ajwong@chromium.org2009-04-183-0/+114
| | | | | | | | This will allow us to hide the platform specific library loading code from the main chrome code. Review URL: http://codereview.chromium.org/69027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13991 0039d316-1c4b-4281-b951-d872f2087c98
* YV16 unittest which is mostly the same as YV12. Requires YV16 data filesfbarchard@chromium.org2009-04-061-6/+59
| | | | | | Review URL: http://codereview.chromium.org/62060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13208 0039d316-1c4b-4281-b951-d872f2087c98
* Add YV16 convertfbarchard@chromium.org2009-04-062-13/+65
| | | | | | Review URL: http://codereview.chromium.org/62015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13155 0039d316-1c4b-4281-b951-d872f2087c98
* FFmpeg video decoder glue codehclam@chromium.org2009-04-021-2/+3
| | | | | | | | | | Implementation of FFmpeg to perform video decoding. Also added hooks to insert this FFmpeg video decoder filter. Review URL: http://codereview.chromium.org/60069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13056 0039d316-1c4b-4281-b951-d872f2087c98
* FFmpegDemuxer now uses a thread to handle demuxing.scherkus@chromium.org2009-03-311-0/+1
| | | | | | | | | | Since FFmpegDemuxer no longer uses the pipeline thread to demuxer, I had to add a WaitableEvent to TestReader to make sure the read completed (or not!). Downside is that the test for when a read is never completed now waits 500ms before timing out. Oh well :( Review URL: http://codereview.chromium.org/55047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12831 0039d316-1c4b-4281-b951-d872f2087c98
* Enable streaming in ffmpeg based on data sourcemedia::DataSource interface ↵hclam@chromium.org2009-03-302-0/+7
| | | | | | | | has IsSeekable() method to decideon runtime whether the data source is seekable or not. Thisinformation is provided to FFmpeg to decide whether to dostreaming or not. In the case of streaming, FFmpeg does notsupport seeking. Review URL: http://codereview.chromium.org/57015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12802 0039d316-1c4b-4281-b951-d872f2087c98