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

Unified Diff: cc/video_frame_provider_client_impl.h

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | « cc/tree_synchronizer_unittest.cc ('k') | cc/video_frame_provider_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/video_frame_provider_client_impl.h
diff --git a/cc/video_frame_provider_client_impl.h b/cc/video_frame_provider_client_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..70722b86c65cb4dd9bcb58fbe605ccfb71b83937
--- /dev/null
+++ b/cc/video_frame_provider_client_impl.h
@@ -0,0 +1,62 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
+#define CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
+#include "cc/video_frame_provider.h"
+#include "ui/gfx/transform.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace cc {
+class VideoLayerImpl;
+
+class VideoFrameProviderClientImpl :
+ public VideoFrameProvider::Client,
+ public base::RefCounted<VideoFrameProviderClientImpl> {
+ public:
+ static scoped_refptr<VideoFrameProviderClientImpl> Create(
+ VideoFrameProvider* provider);
+
+ void set_active_video_layer(VideoLayerImpl* video_layer) {
+ active_video_layer_ = video_layer;
+ }
+
+ void Stop();
+ bool Stopped() const { return !provider_; }
+
+ media::VideoFrame* AcquireLockAndCurrentFrame();
+ void PutCurrentFrame(media::VideoFrame* frame);
+ void ReleaseLock();
+ const gfx::Transform& stream_texture_matrix() const {
+ return stream_texture_matrix_;
+ }
+
+ // VideoFrameProvider::Client implementation.
+ virtual void StopUsingProvider() OVERRIDE; // Callable on any thread.
+ virtual void DidReceiveFrame() OVERRIDE; // Callable on impl thread.
+ virtual void DidUpdateMatrix(const float*) OVERRIDE; // Callable on impl thread.
+
+ private:
+ explicit VideoFrameProviderClientImpl(VideoFrameProvider* provider);
+ friend class base::RefCounted<VideoFrameProviderClientImpl>;
+ virtual ~VideoFrameProviderClientImpl();
+
+ VideoLayerImpl* active_video_layer_;
+
+ // Guards the destruction of provider_ and the frame that it provides
+ base::Lock provider_lock_;
+ VideoFrameProvider* provider_;
+
+ gfx::Transform stream_texture_matrix_;
+};
+
+} // namespace cc
+
+#endif // CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
« no previous file with comments | « cc/tree_synchronizer_unittest.cc ('k') | cc/video_frame_provider_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698