Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: media/filters/gpu_video_decoder.h

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/pepper_platform_video_decoder_impl.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.h
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h
index f4c3c63c71d0ef6c1d04bfe4901a759e886d673b..1ccbbde68e3fb33d9b7e5fe9659c18911b9c1244 100644
--- a/media/filters/gpu_video_decoder.h
+++ b/media/filters/gpu_video_decoder.h
@@ -119,6 +119,10 @@ class MEDIA_EXPORT GpuVideoDecoder
void GetBufferTimeData(
int32 id, base::TimeDelta* timestamp, base::TimeDelta* duration);
+ // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render
+ // thread).
+ void SetVDA(VideoDecodeAccelerator* vda);
+
// A shared memory segment and its allocated size.
struct SHMBuffer {
SHMBuffer(base::SharedMemory* m, size_t s);
@@ -158,8 +162,11 @@ class MEDIA_EXPORT GpuVideoDecoder
scoped_refptr<Factories> factories_;
- // Populated during Initialize() (on success) and unchanged thereafter.
- scoped_refptr<VideoDecodeAccelerator> vda_;
+ // Populated during Initialize() via SetVDA() (on success) and unchanged
+ // until an error occurs
+ scoped_ptr<VideoDecodeAccelerator> vda_;
+ // Used to post tasks from the GVD thread to the VDA thread safely.
+ base::WeakPtr<VideoDecodeAccelerator> weak_vda_;
// Callbacks that are !is_null() only during their respective operation being
// asynchronously executed.
« no previous file with comments | « content/renderer/media/pepper_platform_video_decoder_impl.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698