diff options
author | qinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 04:38:17 +0000 |
---|---|---|
committer | qinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 04:38:17 +0000 |
commit | 11387d28032c36724cfe108c544b639c33a6109a (patch) | |
tree | 49d99ef2a67d94fe295deb8f01277a33427671cd /content/common/gpu/stream_texture_manager_android.h | |
parent | 51c2e9ad1b2e61ef88fb616c00be7ee11491fd9f (diff) | |
download | chromium_src-11387d28032c36724cfe108c544b639c33a6109a.zip chromium_src-11387d28032c36724cfe108c544b639c33a6109a.tar.gz chromium_src-11387d28032c36724cfe108c544b639c33a6109a.tar.bz2 |
Fix a race condition that SurfaceTextureBridge can get released before passing it to the mediaplayer
Use a scoped_refptr to protect SurfaceTextureBridge from being released when DestroyStreamTextureChromium and SetVideoSurface() get called at the same time on GPU and UI thread.
Review URL: https://chromiumcodereview.appspot.com/11092010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/stream_texture_manager_android.h')
-rw-r--r-- | content/common/gpu/stream_texture_manager_android.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content/common/gpu/stream_texture_manager_android.h b/content/common/gpu/stream_texture_manager_android.h index cbecdc5..f0529d3 100644 --- a/content/common/gpu/stream_texture_manager_android.h +++ b/content/common/gpu/stream_texture_manager_android.h @@ -58,7 +58,9 @@ class StreamTextureManagerAndroid : public gpu::StreamTextureManager { virtual void Update() OVERRIDE; - SurfaceTextureBridge* bridge() { return surface_texture_.get(); } + scoped_refptr<SurfaceTextureBridge> surface_texture_bridge() { + return surface_texture_bridge_; + } // Called when a new frame is available. void OnFrameAvailable(int route_id); @@ -74,7 +76,7 @@ class StreamTextureManagerAndroid : public gpu::StreamTextureManager { } private: - scoped_ptr<SurfaceTextureBridge> surface_texture_; + scoped_refptr<SurfaceTextureBridge> surface_texture_bridge_; // Current transform matrix of the surface texture. float current_matrix_[16]; |