summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update the paused time when seeking while paused.scherkus@chromium.org2009-10-241-1/+15
| | | | | | | | | | | | Fixes regression caused by r29851. BUG=13907 TEST=video-seeking.html should start passing reliably Review URL: http://codereview.chromium.org/332017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29983 0039d316-1c4b-4281-b951-d872f2087c98
* Use a saved copy of the time when pausing media elements.scherkus@chromium.org2009-10-231-0/+4
| | | | | | | | | | | | | | Since our internal pause is asynchronous and we don't want to hang the render thread, it's possible to have our clock creep ahead. This produces unexpected behaviour when pausing media elements, such as seeing currentTime attribute nudge a little ahead after calling pause(). This so happens to also address layout test flakiness. BUG=13907 TEST=layout tests, especially video-pause-immediately.html -- a new layout test I wrote and am upstreaming Review URL: http://codereview.chromium.org/334002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29851 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in webkit/glue to remove some dependencies.darin@chromium.org2009-10-221-2/+0
| | | | | | | | | | | | | | | | Switch scoped_ptr to OwnPtr. Switch base::RefCounted to WTF::RefCounted. Switch string16/wstring to WebCore::String Switch DCHECK to ASSERT. Switch from Chromium #ifdefs to WebKit #ifdefs for ports. R=dglazkov BUG=none TEST=none Review URL: http://codereview.chromium.org/292042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29779 0039d316-1c4b-4281-b951-d872f2087c98
* Do not lower our ready state if the media resource is completely loaded.scherkus@chromium.org2009-10-221-1/+5
| | | | | | | | | | | | If the media resource is a file:// we can always report that we have enough data to play the file. We end up passing a bunch of layout tests. BUG=13907 TEST=more layout tests pass Review URL: http://codereview.chromium.org/316003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29753 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented WebMediaPlayerImpl::hasSingleSecurityOrigin().scherkus@chromium.org2009-10-211-2/+4
| | | | | | | | | | BUG=13907 TEST=video-canvas-source.html passes. Review URL: http://codereview.chromium.org/293059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29705 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build bustage of 29235hclam@chromium.org2009-10-161-1/+1
| | | | | | | | | | TBR=scherkus From 1u to static_cast<size_t>(1). Review URL: http://codereview.chromium.org/276057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29238 0039d316-1c4b-4281-b951-d872f2087c98
* Report stalled event correctly for <video>hclam@chromium.org2009-10-161-2/+26
| | | | | | | | | | | | | | | | | | | | | BUG=20127 BUG=13568 TEST=Opens a web page, stalled event should be fire only if network is actuall stalled. What this patch does: 1. Report Loading / Idle according to whether we are actively receiving data in the BuffereResourceLoader. This is done by signaling the network events to BufferedDataSource and then to the media playback pipeline. 2. Report byteLoaded() as the last byte position buffered. This will enable an actual ticking progress for the progress event. With this value actually ticking, stalled event is suppressed. Review URL: http://codereview.chromium.org/269002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29235 0039d316-1c4b-4281-b951-d872f2087c98
* Use WebKit::WebVector instead of std::vector in WebKit::WebMediaPlayerhclam@chromium.org2009-10-091-4/+5
| | | | | | | | Get rid of the use of std::vector. Review URL: http://codereview.chromium.org/259053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28616 0039d316-1c4b-4281-b951-d872f2087c98
* Reimplement video painting for mac using CGContext.ajwong@chromium.org2009-09-211-2/+35
| | | | | | | | | | | | | This is still a bit hacky. We need to avoid doing the double copy of the bits by making the skia::PlatformCanvas take in a CGContext and use that as its backing store. BUG=19536 TEST=watched at video with it :) Review URL: http://codereview.chromium.org/208039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26683 0039d316-1c4b-4281-b951-d872f2087c98
* Buffered time ranges for <video>hclam@chromium.org2009-09-101-3/+9
| | | | | | | | | | | | API change and related changes to support multiple buffered time ranges. This change doesn't change any behavior. BUG=21305 TEST=Open a video or audio file, you see the full bar of buffered ranges. Review URL: http://codereview.chromium.org/199037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25932 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for audio/video not firing ended if you change src and call load().scherkus@chromium.org2009-08-251-0/+4
| | | | | | | | | | | | Another instance of HTMLMediaElement becoming out of sync with WebMediaPlayerImpl. Most of these bugs are a result of HTMLMediaElement re-creating WebMediaPlayerImpl whenever src changes but not completely resetting internal state, causing inconsistent behaviour. BUG=16768,20152 TEST=change src and call load(), wait until the end of the clip -- ended should fire Review URL: http://codereview.chromium.org/173388 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24331 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug where changing the src of an audio/video element would stop firing ↵scherkus@chromium.org2009-08-251-8/+6
| | | | | | | | | | | | | | events. HTMLMediaElement keeps track of network/ready state separately. When re-using an element by setting the src and calling load(), HTMLMediaElement's network/ready states became out of sync with the actual values inside WebMediaPlayerImpl. This led to the second media never firing 'loadedmetadata' and other events. BUG=16768,20152 TEST=change src of an audio/video, call load(), should see durationchange and loadedmetadata events Review URL: http://codereview.chromium.org/174385 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24251 0039d316-1c4b-4281-b951-d872f2087c98
* Correct network state and ready state reporting.ajwong@chromium.org2009-08-211-2/+11
| | | | | | | | | | | | | For network state, make it return "loading" for everything that's not a file source since our cache does not yet reliably support caching the full media w/o need for a network. For ready state, correctly handle seeks to drop from HaveEnoughData down to HaveMetaData until the seek completes. Also implement the seeking() function. BUG=18975 TEST=none Review URL: http://codereview.chromium.org/165432 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24036 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r24002 due to test_shell_tests rednessajwong@chromium.org2009-08-211-11/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24004 0039d316-1c4b-4281-b951-d872f2087c98
* Correct network state and ready state reporting.ajwong@chromium.org2009-08-211-2/+11
| | | | | | | | | | | | | For network state, make it return "loading" for everything that's not a file source since our cache does not yet reliably support caching the full media w/o need for a network. For ready state, correctly handle seeks to drop from HaveEnoughData down to HaveMetaData until the seek completes. Also implement the seeking() function. BUG=18975 TEST=none Review URL: http://codereview.chromium.org/165432 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24002 0039d316-1c4b-4281-b951-d872f2087c98
* Change WebCanvas to be a CGContext on Mac.darin@chromium.org2009-08-191-0/+5
| | | | | | | | | | | | This change removes the code that previously existed to render HTML5 video on Mac. That code was already broken (video doesn't work at all on tip-of-tree), and so instead of trying to translate broken code, I just removed it. Andrew approved this. R=amanda,scherkus BUG=none TEST=none Review URL: http://codereview.chromium.org/174022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23742 0039d316-1c4b-4281-b951-d872f2087c98
* Finished implementation of hasAudio() to detect media without playback audio ↵scherkus@chromium.org2009-08-181-0/+3
| | | | | | | | | | | | | | tracks. There is a WebKit side to this patch out for review as well: https://bugs.webkit.org/show_bug.cgi?id=28310 BUG=18970 TEST=play a video without audio (i.e., trek0.ogv), the UI should display a disabled audio icon Review URL: http://codereview.chromium.org/171091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23671 0039d316-1c4b-4281-b951-d872f2087c98
* Video plays on server without range requesthclam@chromium.org2009-08-181-3/+7
| | | | | | | | | | | | | | BUG=19521 TEST=Go to http://htmlfive.appspot.com/static/video.html and it will play. r23255 introduced a regression that causes an extra seek in the beginning of playing a video file. This extra seek causes FFmpeg to look for index at the end of file which issue a range request at the end of the file. Review URL: http://codereview.chromium.org/171084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23598 0039d316-1c4b-4281-b951-d872f2087c98
* Framework to display disabled mute button when audio fails.kylep@chromium.org2009-08-141-0/+6
| | | | | | | | BUG=18970 TEST=play a video with no audio hardware, verify that UI changes Review URL: http://codereview.chromium.org/169010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23491 0039d316-1c4b-4281-b951-d872f2087c98
* Add disabled play and mute icons for media player.kylep@chromium.org2009-08-141-0/+3
| | | | | | | | BUG=18969,18970 TEST=none Review URL: http://codereview.chromium.org/164356 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23415 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented end-of-stream callback for media::PipelineImpl.scherkus@chromium.org2009-08-121-2/+26
| | | | | | | | | | | | | | | A new method HasEnded() was added to renderer interfaces. Renderers return true when they have both received and rendered an end-of-stream buffer. For audio this translates to sending the very last buffer to the hardware. For video this translates to displaying a black frame after the very last frame has been displayed. Renderers can notify the pipeline that the value of HasEnded() has changed to true via FilterHost::NotifyEnded(). Instead of tracking which renderers have called NotifyEnded(), the pipeline uses the notification to poll every renderer. The ended callback will only be executed once every renderer returns true for HasEnded(). This has a nice benefit of being able to ignore extra NotifyEnded() calls if we already determine the pipeline has ended. With the changes to WebMediaPlayerImpl, we should now properly support both the ended event and looping. BUG=16768,17970,18433,18846 TEST=media_unittests, media layout tests, ended event, timeupdate should stop firing, looping should work, seeking after video ends Review URL: http://codereview.chromium.org/164403 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23255 0039d316-1c4b-4281-b951-d872f2087c98
* Disallow setting the rate to values that would cause busy loops (< 1/16x) or ↵kylep@chromium.org2009-08-111-0/+32
| | | | | | | | | | rendering issues (> 16x) BUG=18362 TEST=none Review URL: http://codereview.chromium.org/164032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23037 0039d316-1c4b-4281-b951-d872f2087c98
* Change to WebMediaPlayerImpl incorrectly translated some pipeline errors.kylep@chromium.org2009-07-311-7/+7
| | | | | | | | BUG=16738 TEST=run the media LayoutTests Review URL: http://codereview.chromium.org/159669 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22125 0039d316-1c4b-4281-b951-d872f2087c98
* Pipeline will execute a callback whenever an run-time error has happened.kylep@chromium.org2009-07-301-2/+51
| | | | | | | | BUG=16738 TEST=pipeline_impl_unittest.cc Review URL: http://codereview.chromium.org/160298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22075 0039d316-1c4b-4281-b951-d872f2087c98
* BufferedDataSource to support server without range request supporthclam@chromium.org2009-07-291-10/+25
| | | | | | | | | | | | | | | This patch will enable BufferedDataSource to support servers with no range request support. It will start a probe request of 1 byte size besides the regular request. If the server does not support range request, we will turn on the is_streamed flag of FFmpeg and will not do any seeking. BUG=17628 TEST=test_shell_tests --gtest_filter=BufferedDataSource.* Review URL: http://codereview.chromium.org/160076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21999 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Pipeline will execute a callback whenever an run-time error has ↵scherkus@chromium.org2009-07-281-46/+0
| | | | | | | | | | happened." TBR=kylep Review URL: http://codereview.chromium.org/160287 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21885 0039d316-1c4b-4281-b951-d872f2087c98
* Pipeline will execute a callback whenever an run-time error has happened.kylep@chromium.org2009-07-281-0/+46
| | | | | | | | BUG=16738 TEST=pipeline_impl_unittest.cc Review URL: http://codereview.chromium.org/159373 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21877 0039d316-1c4b-4281-b951-d872f2087c98
* Added reference counting to the Pipeline interface.scherkus@chromium.org2009-07-181-1/+1
| | | | | | | | | BUG=17107 TEST=none Review URL: http://codereview.chromium.org/155713 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21044 0039d316-1c4b-4281-b951-d872f2087c98
* Renamed FilterHost::Error() and Pipeline::GetTime() to more appropriate names.scherkus@chromium.org2009-07-171-1/+1
| | | | | | | | | BUG=17107 TEST=none Review URL: http://codereview.chromium.org/155711 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21013 0039d316-1c4b-4281-b951-d872f2087c98
* Begin implementation of the context menu for Video and Audio tags.ajwong@chromium.org2009-07-171-0/+10
| | | | | | | | | | | This code should enable the creation of a basic context menu for the Video and Audio tags. The actions for fullscreen, save screenshot, loop, and set playback rate are not yet implemented. BUG=15686 TEST=None Review URL: http://codereview.chromium.org/149604 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20931 0039d316-1c4b-4281-b951-d872f2087c98
* Removed the bool parameter from PipelineCallback and cleaned up ↵scherkus@chromium.org2009-07-151-72/+53
| | | | | | | | | | | | | 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
* Fixed bug where playbackRate wasn't being respected.scherkus@chromium.org2009-07-141-4/+9
| | | | | | | | | BUG=16502 TEST=setting defaultPlaybackRate before the media starts playing should be respected when play() is called Review URL: http://codereview.chromium.org/155404 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20652 0039d316-1c4b-4281-b951-d872f2087c98
* Unreverting "Implemented injected message loops for PipelineImpl"scherkus@chromium.org2009-07-111-23/+31
| | | | | | | | | | 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-101-31/+23
| | | | | | | | | | | | 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-101-23/+31
| | | | | | | | | | | 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
* Refactoring to introduce refcount to WebMediaPlayerImplhclam@chromium.org2009-07-071-148/+218
| | | | | | | | | | WebMediaPlayerImpl interacts with multiple threads that it becomes necessary to make it refcounted so we can post task on different threads' message loop. Review URL: http://codereview.chromium.org/147225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20038 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorying to create the ResourceLoaderBridge through a factory class for ↵hclam@chromium.org2009-06-251-10/+6
| | | | | | | | | | | <video> Extract the code to create a ResourceLoaderBridge to a factory class to enable testing on the data source filters. Review URL: http://codereview.chromium.org/146007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19262 0039d316-1c4b-4281-b951-d872f2087c98
* Report load errors for <video> according to WebKit's hclam@chromium.org2009-06-171-7/+23
| | | | | | | | | | | | | BUG=13907 This patch resolve failures for: LayoutTests/media/video-src-plus-source.html LayoutTests/media/video-src-invalid-remove.html LayoutTests/media/video-load-networkState.html Review URL: http://codereview.chromium.org/125226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18632 0039d316-1c4b-4281-b951-d872f2087c98
* Hack to enable video on mac by creating a blank PlatformContextMac to draw on.ajwong@chromium.org2009-06-161-4/+2
| | | | | | | | This isn't a great solution, but it kinda works. Video renders, and the speed is acceptable even though we're doing an extra copy for each frame. The image shows up upside-down though. :( Review URL: http://codereview.chromium.org/126087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18503 0039d316-1c4b-4281-b951-d872f2087c98
* Enable <video> in test_shellhclam@chromium.org2009-06-111-0/+348
| | | | | | | | | | | | | | | | | | | | | 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
* Refactor media player to move away from webkit_gluehclam@chromium.org2009-05-071-90/+0
| | | | | | | | | | | | Highlights: 1. WebCore::MediaPlayerPrivate now only has one static method that constructs WebMediaPlayerClient 2. Implementation of WebCore::MediaPlayerPrivateInterface now is WebMediaPlayerClient 3. WebMediaPlayerClient does the delgation to WebMediaPlayer 4. Implemtnation of real media player will go into chrome/renderer and implements WebMediaPlayer Review URL: http://codereview.chromium.org/105007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15492 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enabling ENABLE_VIDEO since and made appropriate changes due toWebKit ↵hclam@chromium.org2009-03-311-0/+15
| | | | | | | | merge since r41907 (http://trac.webkit.org/changeset/41907).Changes include change names of state enums and adding method tosupport added state change event in WebCore::MediaPlayer. Review URL: http://codereview.chromium.org/56038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12917 0039d316-1c4b-4281-b951-d872f2087c98
* Merged with latest media pipeline and cleaned up some style stuff.hclam@chromium.org2009-02-031-75/+13
| | | | | | | | Changed WebMediaPlayerDelegateImpl to contains a PipelineImpl object rather keeping a pointer to Pipeline interface. Also added code for task coordination between pipeline thread and main thread. Review URL: http://codereview.chromium.org/19481 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9069 0039d316-1c4b-4281-b951-d872f2087c98
* Add resource loading glue code for WebMediaPlayerDelegatehclam@chromium.org2009-01-171-0/+76
| | | | | | | | Added glue code to ResourceHandle for WebMediaPlayerDelegate. Review URL: http://codereview.chromium.org/18282 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8246 0039d316-1c4b-4281-b951-d872f2087c98
* Bridge out media player from MediaPlayerPrivate.hclam@chromium.org2008-12-181-0/+61
- Remove MediaPlayerPrivateChromium.cpp and move it to webkit/glue/media_player_private_impl.cc - Added the following classes: WebMediaPlayer WebMediaPlayerImpl WebMediaPlayerDelegate WebMediaPlayerDelegateImpl TestWebMediaPlayerDelegate VideoStackMediaPlayer (Just a forward declaration) - One include fix for webkit/glue/webframe.h - Overview of what each class is doing: WebMediaPlayer and WebMediaPlayerImpl Wrapper over the MediaPlayerPrivate, it provides methods like Repaint(), NotifyNetworkStateChange(), etc to VideoStackMediaPlayer. It also creates the ResourceHandle for VideoStackMediaPlayer for resource loading, or maybe VideoStackMediaPlayer can simply use webkit_glue::ResourceDispatcher? WebMediaPlayerDelegate, WebMediaPlayerDelegateImpl Delegate calls from webkit to the internal media player. MediaPlayerPrivate Forward calls to WebMidiaPlayerDelegate, creates WebMediaPlayerDelegate and WebMediaPlayer in the constructor. Expose some public methods to WebMediaPlayer so we can actually do repaint and notification of changes. Review URL: http://codereview.chromium.org/13762 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7256 0039d316-1c4b-4281-b951-d872f2087c98