summaryrefslogtreecommitdiffstats
path: root/webkit/glue/media
Commit message (Collapse)AuthorAgeFilesLines
* Fix a crash in BufferedDataSourcehclam@chromium.org2009-07-312-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This crash is caused by a race condition when the media pipeline is shutting down. Here is a sequence that leads to crash: 1. PipelineImpl::Stop() is called. 2. BufferedDataSource::Stop() is called on pipeline thread. BufferedDataSource::StopTask() is posted on render thread. 3. BufferedDataSource::StopTask() is executed. 4. BufferedDataSource::Read() is called on demuxer thread. 5. BufferedDataSource::ReadTask() is executed. *bang* The cause of the crash is the involvement of three threads and it happens that ReadTask() is executed after StopTask(). Since we cannot prevent BufferedDataSource::Read() being called by FFmpegDemuxer since the stop signal hasn't arrived at the demuxer yet. This change will suppress activity of data source after the stop task executed. I didn't reuse the |stopped_| variable to suppress activity but instead introduce another |stop_task_executed_| signal because |stopped_| is prevent the data source from making callbacks to the demuxer after stopped has received. And by doing this we don't need to introduce an additional critical section which is not desirable. Review URL: http://codereview.chromium.org/159675 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22128 0039d316-1c4b-4281-b951-d872f2087c98
* Add plumbing for allowing the renderer to intercept and cancel redirects beforedarin@chromium.org2009-07-304-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are sent. A good portion of this CL is to support the new UI test. The IPC to notify the renderer of a redirect now includes a ResponseInfo struct allowing WebURLLoaderImpl to provide detailed response info (including response headers) to WebKit. This isn't strictly necessary, but I thought I'd include this to make the code more future proof. A cross origin restriction is added to SyncResourceHandler::OnRequestRedirected that mimics the code in WebCore/platform/network/cf/ResourceHandleCFNet.cpp. This is most unfortunate, and I filed a bug at bugs.webkit.org about the similar duplication of logic in WebCore. There seemed to be enough code paths leading to request cancellation at the ResourceDispatcher level that I couldn't easily ensure that a request only gets cancelled once. So, I added an is_cancelled flag to record if it is not necessary to send a ViewHostMsg_CancelRequest IPC. This avoids some warnings in the ResourceDispatcherHost. To support my UI test, I needed to change URLRequestMockHttpJob to know how to serve redirects. I moved URLRequestHttpJob::IsRedirectResponse to its base class, URLRequestJob so that the implementation could be shared. This revealed a minor bug in URLRequest. We were never resetting response_info_ upon following a redirect. I added this code consolidated similar code from URLRequest::Redirect and URLRequest::RestartWithJob into a new PrepareToRestart method. To support my UI test, I added a "hit count" field to URLRequestFilter, and I added an associated automation IPC to query the value. The test was a bit challenging to write because there is no way to tell the difference from JS. Before and after, it appears to JS as though the cross-origin redirect failed. However, the server can see the extra redirect request. So, I simply record the number of hits against URLs of the form http://mock.http/foo, and use that to observe if any extra requests were made. I implemented the new IPC message by extending the AutomationResourceMessageFilter. This allowed me to trap the IPC message on the IO thread where it is safe to probe the URLRequestFilter. I then changed the implementation of AutomationMsg_SetFilteredInet to work similarly. I revised URLRequestMockHTTPJob::GetOnDiskPath to support ports. This actually allowed me to reuse URLRequestMockHTTPJob to service URLs in different security origins. My test redirects from http://mock.http/ to http://mock.http:4000/. Please see the comments in cross-origin-redirect-blocked.html for details about how the test functions. R=brettw,wtc BUG=16413 TEST=covered by resource_dispatcher_host_uitest.cc Review URL: http://codereview.chromium.org/159370 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22067 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build bustage due to r21999hclam@chromium.org2009-07-291-1/+1
| | | | | | | | TBR=scherkus Review URL: http://codereview.chromium.org/159606 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22002 0039d316-1c4b-4281-b951-d872f2087c98
* BufferedDataSource to support server without range request supporthclam@chromium.org2009-07-295-159/+318
| | | | | | | | | | | | | | | 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
* Retry requests that has timed out in BufferedDataSourcehclam@google.com2009-07-293-1/+134
| | | | | | | | | | | | | | | Retries request if the read request is not fulfilled in 5 seconds and at most 3 times. This will handle the case when a user pause a movie and starts it in a later time when the connection to the server has already timed out. TEST=BufferedDataSourceTest.* BUG=17479 done Review URL: http://codereview.chromium.org/159382 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21982 0039d316-1c4b-4281-b951-d872f2087c98
* Changes to provide asynchronous read in data source:hclam@chromium.org2009-07-228-22/+1949
| | | | | | | | | | | | | 1. FFmpegGlue now taks a FFmpegProtocol instead of DataSource as input 2. FFmpegDemuxr implements FFmpegProtocol and does the blocking read and submit asynchronous read request to DataSource (with unit tests) 3. Changed SimpleDataSource to work with asynchronous read (with unit tests) 4. Reimplemented BufferedDataSource to work with asynchronous read (with unit tests) 5. Moved BufferedDataSource from chrome/renderer/media to webkit/glue/media (for faster build/debug and better coverage in automated testing) TEST=BufferedDataSourceTest.*, SimpleDataSourceTest.*, FFmpegDemuxerTest.* Review URL: http://codereview.chromium.org/149567 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21326 0039d316-1c4b-4281-b951-d872f2087c98
* Changing the include from "base/gfx/platform_canvas.h" to ↵ajwong@chromium.org2009-07-221-1/+1
| | | | | | | | | | | | "skia/ext/platform_canvas.h" BUG=None TEST=None Review URL: http://codereview.chromium.org/159057 Patch from Thiago Farina <thiago.farina@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21258 0039d316-1c4b-4281-b951-d872f2087c98
* Renamed FilterHost::Error() and Pipeline::GetTime() to more appropriate names.scherkus@chromium.org2009-07-171-2/+2
| | | | | | | | | 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
* Adding callback support to media filter Initialize() and Seek().scherkus@chromium.org2009-07-162-12/+21
| | | | | | | | | | | | | Also includes unit tests for AudioRendererBase and VideoRendererBase. I had to rollback my first attempt at this change. Original review: http://codereview.chromium.org/155469 BUG=16014,16031 TEST=media_unittests, layout tests Review URL: http://codereview.chromium.org/155608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20836 0039d316-1c4b-4281-b951-d872f2087c98
* Made MediaFilter::host_ and MediaFilter::message_loop_ private.scherkus@chromium.org2009-07-091-5/+5
| | | | | | | | | | | 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-091-5/+5
| | | | | | | | | | 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-091-5/+5
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20335 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring to introduce refcount to WebMediaPlayerImplhclam@chromium.org2009-07-072-14/+15
| | | | | | | | | | 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
* Micro-refactor: added VideoRendererBase::OnStop().scherkus@chromium.org2009-06-262-8/+8
| | | | | | | | | | | | Updated subclasses WtlRenderer and VideoRendererImpl as well. TEST=none BUG=none Review URL: http://codereview.chromium.org/147191 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19372 0039d316-1c4b-4281-b951-d872f2087c98
* Logic in MediaResourceLoaderBridgeFactory was wronghclam@chromium.org2009-06-261-2/+2
| | | | | | | | | | | | | | The logic outputs an extra "Not implemented" message for a correct case, and this extra message causes some layout tests to fail.. BUG=13907 TBR=scherkus TEST=MediaResourceLoaderBridgeFactoryTest.* Review URL: http://codereview.chromium.org/147184 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19323 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorying to create the ResourceLoaderBridge through a factory class for ↵hclam@chromium.org2009-06-255-30/+213
| | | | | | | | | | | <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
* Renamed media::VideoThread to the more appropriate media::VideoRendererBase.scherkus@chromium.org2009-06-222-6/+6
| | | | | | | | | | 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
* Reject invalid URLs in SimpleDataSourcehclam@chromium.org2009-06-181-1/+18
| | | | | | | | | Report an error when an invalid url is received. Checks also the scheme against, ftp, http, https and file. Review URL: http://codereview.chromium.org/131061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18754 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing a bug in SimpleDataSourcehclam@chromium.org2009-06-171-0/+5
| | | | | | | | | SimpleDataSource might be stopped before StartTask is called, so handle this case. Review URL: http://codereview.chromium.org/125278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18668 0039d316-1c4b-4281-b951-d872f2087c98
* Cancel SimpleDataSource's request when stopped to prevent asserting.scherkus@chromium.org2009-06-172-22/+79
| | | | | | | | BUG=http://crbug.com/13907 TEST=some media layout tests might start passing Review URL: http://codereview.chromium.org/125229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18652 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing a bug that <video> is not rendered if clipped/mirroredhclam@chromium.org2009-06-151-4/+13
| | | | | | | | | | | | Since we are not using the YUV->RGB code to perform fast flipping and mirroring. Use FastPaint to handle flipping and mirroring was wrong. There's no plan to support fast flipping and mirroring in the short future so fall back to SlowPaint for this case. Review URL: http://codereview.chromium.org/126093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18403 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SimpleDataSource so it doesn't double-initialize.scherkus@chromium.org2009-06-121-3/+3
| | | | | | | | TBR=hclam Review URL: http://codereview.chromium.org/126030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18243 0039d316-1c4b-4281-b951-d872f2087c98
* The following two layout tests were failed because ofhclam@chromium.org2009-06-111-4/+8
| | | | | | | | | | | | | a bug in video rendering code. The formula to find projected clip dimension in the video frame was wrong, leading to scale factor in the canvas being omitted. LayoutTests/media/video-zoom.html LayoutTests/media/video-layer-crash.html Review URL: http://codereview.chromium.org/123013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18204 0039d316-1c4b-4281-b951-d872f2087c98
* Enable <video> in test_shellhclam@chromium.org2009-06-114-0/+623
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