diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 21:14:02 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 21:14:02 +0000 |
commit | e4c5a7d5a7c92c7644d9f00fa2c6e089c562d0c3 (patch) | |
tree | 54b40e1a0c60a140dac3ae7c323dd96289513587 | |
parent | 402b12138bcabb5a5508e2492852be7a1e17bd8d (diff) | |
download | chromium_src-e4c5a7d5a7c92c7644d9f00fa2c6e089c562d0c3.zip chromium_src-e4c5a7d5a7c92c7644d9f00fa2c6e089c562d0c3.tar.gz chromium_src-e4c5a7d5a7c92c7644d9f00fa2c6e089c562d0c3.tar.bz2 |
Merge 146897 - WebMediaPlayerImpl needs to own the audio source provider.
WebMediaPlayerImpl needs to own the audio source provider to keep it from being destroyed too soon.
BUG=132890
TEST=See test in bug report.
Review URL: https://chromiumcodereview.appspot.com/10662030
TBR=rtoy@google.com
Review URL: https://chromiumcodereview.appspot.com/10808089
git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@147946 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/chrome_content_renderer_client.cc | 5 | ||||
-rw-r--r-- | chrome/renderer/chrome_content_renderer_client.h | 5 | ||||
-rw-r--r-- | chrome/renderer/prerender/prerender_webmediaplayer.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/prerender/prerender_webmediaplayer.h | 2 | ||||
-rw-r--r-- | content/public/renderer/content_renderer_client.cc | 1 | ||||
-rw-r--r-- | content/public/renderer/content_renderer_client.h | 2 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 6 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_impl.cc | 2 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_impl.h | 12 | ||||
-rw-r--r-- | webkit/support/webkit_support.cc | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 1 |
11 files changed, 34 insertions, 5 deletions
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index f67675c..724faea 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -346,6 +346,7 @@ ChromeContentRendererClient::OverrideCreateWebMediaPlayer( base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log) { @@ -353,8 +354,8 @@ ChromeContentRendererClient::OverrideCreateWebMediaPlayer( return NULL; return new prerender::PrerenderWebMediaPlayer(render_view, frame, client, - delegate, collection, audio_source_provider, message_loop_factory, - media_stream_client, media_log); + delegate, collection, audio_source_provider, audio_renderer_sink, + message_loop_factory, media_stream_client, media_log); } WebPlugin* ChromeContentRendererClient::CreatePlugin( diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index 17fea34..a1e15f0 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h @@ -25,6 +25,10 @@ class VisitedLinkSlave; struct ChromeViewHostMsg_GetPluginInfo_Status; +namespace media { +class AudioRendererSink; +} + namespace prerender { class PrerenderDispatcher; } @@ -74,6 +78,7 @@ class ChromeContentRendererClient : public content::ContentRendererClient { base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log) OVERRIDE; diff --git a/chrome/renderer/prerender/prerender_webmediaplayer.cc b/chrome/renderer/prerender/prerender_webmediaplayer.cc index 417d420..54b6dd7 100644 --- a/chrome/renderer/prerender/prerender_webmediaplayer.cc +++ b/chrome/renderer/prerender/prerender_webmediaplayer.cc @@ -21,6 +21,7 @@ PrerenderWebMediaPlayer::PrerenderWebMediaPlayer( base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log) @@ -30,6 +31,7 @@ PrerenderWebMediaPlayer::PrerenderWebMediaPlayer( delegate, collection, audio_source_provider, + audio_renderer_sink, message_loop_factory, media_stream_client, media_log), diff --git a/chrome/renderer/prerender/prerender_webmediaplayer.h b/chrome/renderer/prerender/prerender_webmediaplayer.h index 1ef4de6..00e82b9 100644 --- a/chrome/renderer/prerender/prerender_webmediaplayer.h +++ b/chrome/renderer/prerender/prerender_webmediaplayer.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/renderer/render_view_observer.h" +#include "media/base/audio_renderer_sink.h" #include "webkit/media/webmediaplayer_impl.h" namespace webkit_media { @@ -31,6 +32,7 @@ class PrerenderWebMediaPlayer base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log); diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc index ab57c08..09dd455 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc @@ -41,6 +41,7 @@ webkit_media::WebMediaPlayerImpl* base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log) { diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index f5d8b71..913637a 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -37,6 +37,7 @@ struct WebPluginInfo; } namespace media { +class AudioRendererSink; class FilterCollection; class MediaLog; class MessageLoopFactory; @@ -117,6 +118,7 @@ class CONTENT_EXPORT ContentRendererClient { base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, media::MediaLog* media_log); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index a99de63..b80a01c 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -2382,11 +2382,13 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( WebMediaPlayer* media_player = content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( this, frame, client, AsWeakPtr(), collection, audio_source_provider, - message_loop_factory, media_stream_impl_, render_media_log); + audio_source_provider, message_loop_factory, media_stream_impl_, + render_media_log); if (!media_player) { media_player = new webkit_media::WebMediaPlayerImpl( frame, client, AsWeakPtr(), collection, audio_source_provider, - message_loop_factory, media_stream_impl_, render_media_log); + audio_source_provider, message_loop_factory, media_stream_impl_, + render_media_log); } return media_player; } diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc index 588801c..d14d967 100644 --- a/webkit/media/webmediaplayer_impl.cc +++ b/webkit/media/webmediaplayer_impl.cc @@ -97,6 +97,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( base::WeakPtr<WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, MediaStreamClient* media_stream_client, media::MediaLog* media_log) @@ -120,6 +121,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( accelerated_compositing_reported_(false), incremented_externally_allocated_memory_(false), audio_source_provider_(audio_source_provider), + audio_renderer_sink_(audio_renderer_sink), is_local_source_(false) { media_log_->AddEvent( media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); diff --git a/webkit/media/webmediaplayer_impl.h b/webkit/media/webmediaplayer_impl.h index 30d15f0..a2c85b00 100644 --- a/webkit/media/webmediaplayer_impl.h +++ b/webkit/media/webmediaplayer_impl.h @@ -73,7 +73,7 @@ class WebFrame; } namespace media { -class AesDecryptor; +class AudioRendererSink; class MediaLog; } @@ -103,11 +103,19 @@ class WebMediaPlayerImpl // filter if they wish to hear any sound coming out the speakers, otherwise // audio data is discarded and media plays back based on wall clock time. // + // When calling this, the |audio_source_provider| and + // |audio_renderer_sink| arguments should be the same object. + // + // TODO(scherkus): Remove WebAudioSourceProvider parameter once we + // refactor RenderAudioSourceProvider to live under webkit/media/ + // instead of content/renderer/, see http://crbug.com/136442 + WebMediaPlayerImpl(WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, + media::AudioRendererSink* audio_renderer_sink, media::MessageLoopFactory* message_loop_factory, MediaStreamClient* media_stream_client, media::MediaLog* media_log); @@ -338,6 +346,8 @@ class WebMediaPlayerImpl WebKit::WebAudioSourceProvider* audio_source_provider_; + scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; + bool is_local_source_; DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index 7ac04e7..8c7620c 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -372,6 +372,7 @@ WebKit::WebMediaPlayer* CreateMediaPlayer( base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), collection.release(), NULL, + NULL, message_loop_factory.release(), media_stream_client, new media::MediaLog()); diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index e9f090f..4a9a38db 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -649,6 +649,7 @@ WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), collection.release(), NULL, + NULL, message_loop_factory.release(), NULL, new media::MediaLog()); |