summaryrefslogtreecommitdiffstats
path: root/media/base
Commit message (Collapse)AuthorAgeFilesLines
* Splitting media filter's Initialize() into Create() + callback and Seek() + ↵scherkus@chromium.org2009-07-159-96/+187
| | | | | | | | | | | callback. BUG=16014,16031 TEST=media_unittests, layout tests Review URL: http://codereview.chromium.org/155469 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20744 0039d316-1c4b-4281-b951-d872f2087c98
* Removed the bool parameter from PipelineCallback and cleaned up ↵scherkus@chromium.org2009-07-153-35/+28
| | | | | | | | | | | | | WebMediaPlayerImpl::Proxy. This forces clients to check Pipeline::GetError() instead of using a simple true/false check for success. Also the bool parameter wasn't being used for Seek() and Stop() callbacks, further hinting at its removal. BUG=16009 TEST=media_unittests pass, layout tests pass Review URL: http://codereview.chromium.org/149584 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20738 0039d316-1c4b-4281-b951-d872f2087c98
* Add in macro to abstract the differences in library naming conventions ↵ajwong@chromium.org2009-07-151-6/+11
| | | | | | | | | | | between mac and linux. TEST=none BUG=16736 Review URL: http://codereview.chromium.org/149632 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20720 0039d316-1c4b-4281-b951-d872f2087c98
* Set Volume to full at start.fbarchard@chromium.org2009-07-142-5/+5
| | | | | | Review URL: http://codereview.chromium.org/149624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20678 0039d316-1c4b-4281-b951-d872f2087c98
* Small changes to comments and add host() + message_loop() implementation ↵ajwong@chromium.org2009-07-132-1/+12
| | | | | | | | | | into MediaFilter. Remove host() and message_loop() overrides in DecoderBase. Review URL: http://codereview.chromium.org/150193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20533 0039d316-1c4b-4281-b951-d872f2087c98
* Add methods to ARAB and BufferQueue to allow owners to query it for the ↵kylep@chromium.org2009-07-133-0/+54
| | | | | | | | | | timestamp of our next byte. BUG=16011 TEST=src/media/base/buffer_queue_unittest.cc Review URL: http://codereview.chromium.org/149494 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20520 0039d316-1c4b-4281-b951-d872f2087c98
* More media::PipelineImpl cleanup, this time focusing on not taking down the ↵scherkus@chromium.org2009-07-113-64/+145
| | | | | | | | | | | | | | | | render process. Specifically, if the pipeline hasn't started we should fail gracefully and not DCHECK. Volume and playback rate are now allowed to be set if the pipeline isn't running, and filters will now receive a call to SetVolume() and SetPlaybackRate() with the initial values when the pipeline has fully initialized. Added tests and expectations for all of this and ran valgrind to verify that we were indeed leaking memory (now fixed). BUG=16009, 13902 TEST=media_unittests, layout tests Review URL: http://codereview.chromium.org/149500 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20455 0039d316-1c4b-4281-b951-d872f2087c98
* Unreverting "Implemented injected message loops for PipelineImpl"scherkus@chromium.org2009-07-116-399/+435
| | | | | | | | | | Guess it was a flaky layout test. TBR=hclam Review URL: http://codereview.chromium.org/155400 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20444 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Implemented injected message loops for PipelineImpl."scherkus@chromium.org2009-07-106-435/+399
| | | | | | | | | | | | I cannot repro the layout test failures, seeing if this helps. TBR=hclam BUG=none TEST=none Review URL: http://codereview.chromium.org/155396 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20439 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented injected message loops for PipelineImpl.scherkus@chromium.org2009-07-106-399/+435
| | | | | | | | | | | For now both the player and WebMediaPlayerImpl create a thread and inject its message loop into the pipeline. The end result is more-or-less the same as what we have today, but we could end up moving the pipeline onto the render thread. BUG=16008 TEST=layout tests, media_unittests should pass Review URL: http://codereview.chromium.org/155338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20417 0039d316-1c4b-4281-b951-d872f2087c98
* Converted remaining tests to use gmock and deleted all old mocking code.scherkus@chromium.org2009-07-106-756/+298
| | | | | | | | | | | The most important part was refactoring PipelineImpl tests in preparation for message loop injection. The old mocks just did not work *at all* with my message loop injection patch. BUG=16008 TEST=media_unittests should pass and not flake out Review URL: http://codereview.chromium.org/149423 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20412 0039d316-1c4b-4281-b951-d872f2087c98
* Made MediaFilter::host_ and MediaFilter::message_loop_ private.scherkus@chromium.org2009-07-093-18/+25
| | | | | | | | | | | More cleanup relating to pipeline cleanup. BUG=16008 TEST=no real code chage, nothing should change Review URL: http://codereview.chromium.org/155230 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20338 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Made MediaFilter::host_ and MediaFilter::message_loop_ private."scherkus@chromium.org2009-07-093-25/+18
| | | | | | | | | | TEST=none BUG=none TBR=evmar Review URL: http://codereview.chromium.org/155333 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20336 0039d316-1c4b-4281-b951-d872f2087c98
* Made MediaFilter::host_ and MediaFilter::message_loop_ private.scherkus@chromium.org2009-07-093-18/+25
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20335 0039d316-1c4b-4281-b951-d872f2087c98
* Manually declare media_format() because gmock does not like mocking ↵scherkus@chromium.org2009-07-091-4/+12
| | | | | | | | | | | non-copyable const references. TEST=media_unittests should pass BUG=16008 Review URL: http://codereview.chromium.org/155316 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20328 0039d316-1c4b-4281-b951-d872f2087c98
* Updated FFmpegDemuxerTest and FFmpegVideoDecoderTest to use the gmock-based ↵scherkus@chromium.org2009-07-093-290/+1
| | | | | | | | | | | | | MockFilterHost. Also deleted the old MockPipeline and MockFilterHost code as it has been completely deprecated. BUG=16008 TEST=FFmpegDemuxerTest and FFmpegVideoDecoderTest Review URL: http://codereview.chromium.org/149366 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20242 0039d316-1c4b-4281-b951-d872f2087c98
* Added new gmock-based MockFilterHost and deprecated the old one.scherkus@chromium.org2009-07-091-5/+32
| | | | | | | | | | | Updated FileDataSource tests to use the new MockFilterHost as a proof of concept, also because my pipeline refactoring completely broke the test. BUG=16008 TEST=FileDataSourceTest.* should pass Review URL: http://codereview.chromium.org/149350 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20219 0039d316-1c4b-4281-b951-d872f2087c98
* Big media::Pipeline cleanup.scherkus@chromium.org2009-07-097-474/+243
| | | | | | | | | | | Before I can even start refactoring, I need to remove a lot of accumulated cruft and fix some style stuff. PipelineStatus has been merged into Pipeline and I got rid of GetInterpolatedTime() as well as the ability to schedule callbacks when time has updated. We haven't found a need for these features and they introduced a good amount of code complexity. TEST=media_unittests should still pass BUG=16008 Review URL: http://codereview.chromium.org/149215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20218 0039d316-1c4b-4281-b951-d872f2087c98
* BufferQueue class to hide audio data micromanagement from scaling ↵kylep@chromium.org2009-07-083-0/+287
| | | | | | | | | | algorithms. May be useful in other contexts. BUG=16011 TEST=src/media/base/buffer_queue_unittest.cc Review URL: http://codereview.chromium.org/155193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20211 0039d316-1c4b-4281-b951-d872f2087c98
* Wrote gmock-based mock filters and a mock filter factory.scherkus@chromium.org2009-07-082-1/+176
| | | | | | | | | | | Next up is actually refactoring tests to use these and not the old_mocks version. The biggest user is the PipelineImpl tests, which I'm currently refactoring anyway hence sending this out for review. BUG=16008 TEST=FFmpegVideoDecoderTest should still pass Review URL: http://codereview.chromium.org/149356 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20201 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup resources allocated by FFmpeg to avoid memory and threads leakshclam@chromium.org2009-07-072-0/+10
| | | | | | | | Calls avcodec_free and avcodec_thread_free appropriately. Review URL: http://codereview.chromium.org/151192 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20039 0039d316-1c4b-4281-b951-d872f2087c98
* Scale function cleaned up white spaces and removed comments that are no ↵fbarchard@chromium.org2009-07-061-86/+29
| | | | | | | | | | longer applicable to this module. Removed openmp support, which is no longer necessary for high performance. Review URL: http://codereview.chromium.org/150143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19971 0039d316-1c4b-4281-b951-d872f2087c98
* Asynchronous initialization of media::PipelineThreadhclam@chromium.org2009-07-013-231/+322
| | | | | | | | | The initialization of media::PipelineThread needs to done asynchronously or a lot of dead lock will happen. Review URL: http://codereview.chromium.org/149123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19787 0039d316-1c4b-4281-b951-d872f2087c98
* Switching decoders to use the injected message loop.scherkus@chromium.org2009-06-292-1/+13
| | | | | | | | | TEST=test should continue to pass, movies stay in sync BUG=none Review URL: http://codereview.chromium.org/146068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19555 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor media pipeline and filters to use injected message loops.scherkus@chromium.org2009-06-254-25/+135
| | | | | | | | | | | Message loops are provided via MediaFilter::SetMessageLoop(). For now FFmpegDemuxer is the only filter taking advantage of injected message loops, and its unit tests have been updated as well. TEST=FFmpegDemuxer tests should continue to run BUG=none Review URL: http://codereview.chromium.org/145014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19209 0039d316-1c4b-4281-b951-d872f2087c98
* Checking in media/base/mock_filters.h, a new set of mock filters based on gmock.scherkus@chromium.org2009-06-231-0/+48
| | | | | | | | | TEST=FFmpegDemuxer tests should continue to run BUG=none Review URL: http://codereview.chromium.org/147046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19078 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor FFmpegVideoDecoder::OnDecode and unittest and add state tracking.ajwong@chromium.org2009-06-223-23/+29
| | | | | | | | The decoder needs a concept of state to know when it should just stop attempting to decode. This is because ffmpeg will sometimes gives spurious frames back, which plays badly with the time presentation timestamp calculation logic. Review URL: http://codereview.chromium.org/132013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18990 0039d316-1c4b-4281-b951-d872f2087c98
* Removed message loop from MockPipeline as it is no longer needed.scherkus@chromium.org2009-06-221-16/+0
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/145022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18984 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
* 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