diff options
author | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 09:10:14 +0000 |
---|---|---|
committer | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 09:10:14 +0000 |
commit | bdad92a1a551b080f0c1effcf8d20531a68d3f93 (patch) | |
tree | a41a509445ff0e0b2fc4612dc7836dbcc923a1be /webkit/media | |
parent | 597ad694e4abe1881225fae6e253e8ba77941099 (diff) | |
download | chromium_src-bdad92a1a551b080f0c1effcf8d20531a68d3f93.zip chromium_src-bdad92a1a551b080f0c1effcf8d20531a68d3f93.tar.gz chromium_src-bdad92a1a551b080f0c1effcf8d20531a68d3f93.tar.bz2 |
Revert "Android: Delete StreamTextureProxy on impl thread."
This reverts r190599 which broke WebKit Android compilation.
TBR=pdr
BUG=167586
Review URL: https://codereview.chromium.org/12618017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media')
-rw-r--r-- | webkit/media/android/stream_texture_factory_android.h | 23 | ||||
-rw-r--r-- | webkit/media/android/webmediaplayer_android.cc | 5 | ||||
-rw-r--r-- | webkit/media/android/webmediaplayer_android.h | 5 |
3 files changed, 12 insertions, 21 deletions
diff --git a/webkit/media/android/stream_texture_factory_android.h b/webkit/media/android/stream_texture_factory_android.h index 7a149bc..dffcb8b 100644 --- a/webkit/media/android/stream_texture_factory_android.h +++ b/webkit/media/android/stream_texture_factory_android.h @@ -5,7 +5,6 @@ #ifndef WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ #define WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ -#include "base/memory/scoped_ptr.h" #include "cc/layers/video_frame_provider.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoFrame.h" @@ -19,11 +18,13 @@ namespace webkit_media { // when a new video frame is available. class StreamTextureProxy { public: - // Initialize and bind to the current thread, which becomes the thread that - // a connected client will receive callbacks on. - virtual void BindToCurrentThread(int stream_id, int width, int height) = 0; + virtual ~StreamTextureProxy() {} + + // Initialize the the stream_id, texture width and height. This should + // be called on the compositor thread. + virtual bool Initialize(int stream_id, int width, int height) = 0; - virtual bool IsBoundToThread() = 0; + virtual bool IsInitialized() = 0; // Setting the target for callback when a frame is available. This function // could be called on both the main thread and the compositor thread. @@ -32,20 +33,8 @@ class StreamTextureProxy { #else virtual void SetClient(cc::VideoFrameProvider::Client* client) = 0; #endif - - struct Deleter { - inline void operator()(StreamTextureProxy* ptr) const { ptr->Release(); } - }; - - protected: - virtual ~StreamTextureProxy() {} - - // Causes this instance to be deleted on the thread it is bound to. - virtual void Release() = 0; }; -typedef scoped_ptr<StreamTextureProxy, StreamTextureProxy::Deleter> - ScopedStreamTextureProxy; // Factory class for managing the stream texture. class StreamTextureFactory { diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc index 4f096c4..15dd860 100644 --- a/webkit/media/android/webmediaplayer_android.cc +++ b/webkit/media/android/webmediaplayer_android.cc @@ -13,6 +13,7 @@ #include "net/base/mime_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.h" #include "webkit/compositor_bindings/web_layer_impl.h" +#include "webkit/media/android/stream_texture_factory_android.h" #include "webkit/media/android/webmediaplayer_manager_android.h" #include "webkit/media/media_switches.h" #include "webkit/media/webmediaplayer_util.h" @@ -449,10 +450,10 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() { #ifndef REMOVE_WEBVIDEOFRAME WebVideoFrame* WebMediaPlayerAndroid::getCurrentFrame() { - if (stream_texture_proxy_ && !stream_texture_proxy_->IsBoundToThread() && + if (stream_texture_proxy_ && !stream_texture_proxy_->IsInitialized() && stream_id_ && !needs_external_surface_) { gfx::Size natural_size = current_frame_->natural_size(); - stream_texture_proxy_->BindToCurrentThread( + stream_texture_proxy_->Initialize( stream_id_, natural_size.width(), natural_size.height()); } diff --git a/webkit/media/android/webmediaplayer_android.h b/webkit/media/android/webmediaplayer_android.h index 8deb2fe..fb5fae1 100644 --- a/webkit/media/android/webmediaplayer_android.h +++ b/webkit/media/android/webmediaplayer_android.h @@ -16,7 +16,6 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" -#include "webkit/media/android/stream_texture_factory_android.h" namespace WebKit { class WebVideoFrame; @@ -28,6 +27,8 @@ class WebLayerImpl; namespace webkit_media { +class StreamTextureFactory; +class StreamTextureProxy; class WebMediaPlayerManagerAndroid; class WebVideoFrameImpl; @@ -264,7 +265,7 @@ class WebMediaPlayerAndroid // Object for calling back the compositor thread to repaint the video when a // frame available. It should be initialized on the compositor thread. - ScopedStreamTextureProxy stream_texture_proxy_; + scoped_ptr<StreamTextureProxy> stream_texture_proxy_; // Whether media player needs external surface. bool needs_external_surface_; |