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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/tree_synchronizer_unittest.cc ('k') | cc/video_frame_provider_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
6 #define CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/synchronization/lock.h"
10 #include "cc/video_frame_provider.h"
11 #include "ui/gfx/transform.h"
12
13 namespace media {
14 class VideoFrame;
15 }
16
17 namespace cc {
18 class VideoLayerImpl;
19
20 class VideoFrameProviderClientImpl :
21 public VideoFrameProvider::Client,
22 public base::RefCounted<VideoFrameProviderClientImpl> {
23 public:
24 static scoped_refptr<VideoFrameProviderClientImpl> Create(
25 VideoFrameProvider* provider);
26
27 void set_active_video_layer(VideoLayerImpl* video_layer) {
28 active_video_layer_ = video_layer;
29 }
30
31 void Stop();
32 bool Stopped() const { return !provider_; }
33
34 media::VideoFrame* AcquireLockAndCurrentFrame();
35 void PutCurrentFrame(media::VideoFrame* frame);
36 void ReleaseLock();
37 const gfx::Transform& stream_texture_matrix() const {
38 return stream_texture_matrix_;
39 }
40
41 // VideoFrameProvider::Client implementation.
42 virtual void StopUsingProvider() OVERRIDE; // Callable on any thread.
43 virtual void DidReceiveFrame() OVERRIDE; // Callable on impl thread.
44 virtual void DidUpdateMatrix(const float*) OVERRIDE; // Callable on impl threa d.
45
46 private:
47 explicit VideoFrameProviderClientImpl(VideoFrameProvider* provider);
48 friend class base::RefCounted<VideoFrameProviderClientImpl>;
49 virtual ~VideoFrameProviderClientImpl();
50
51 VideoLayerImpl* active_video_layer_;
52
53 // Guards the destruction of provider_ and the frame that it provides
54 base::Lock provider_lock_;
55 VideoFrameProvider* provider_;
56
57 gfx::Transform stream_texture_matrix_;
58 };
59
60 } // namespace cc
61
62 #endif // CC_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
OLDNEW
« 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