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

Side by Side Diff: cc/layers/video_frame_provider_client_impl.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « cc/layers/ui_resource_layer_unittest.cc ('k') | cc/layers/video_layer.h » ('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_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/synchronization/lock.h"
10 #include "base/threading/thread_checker.h"
11 #include "cc/layers/video_frame_provider.h"
12 #include "ui/gfx/transform.h"
13
14 namespace media { class VideoFrame; }
15
16 namespace cc {
17 class VideoLayerImpl;
18
19 class VideoFrameProviderClientImpl
20 : public VideoFrameProvider::Client,
21 public base::RefCounted<VideoFrameProviderClientImpl> {
22 public:
23 static scoped_refptr<VideoFrameProviderClientImpl> Create(
24 VideoFrameProvider* provider);
25
26 VideoLayerImpl* active_video_layer() { return active_video_layer_; }
27 void SetActiveVideoLayer(VideoLayerImpl* video_layer);
28
29 void Stop();
30 bool Stopped();
31
32 scoped_refptr<media::VideoFrame> AcquireLockAndCurrentFrame();
33 void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame);
34 void ReleaseLock();
35 const gfx::Transform& stream_texture_matrix() const {
36 return stream_texture_matrix_;
37 }
38
39 // VideoFrameProvider::Client implementation. These methods are all callable
40 // on any thread.
41 void StopUsingProvider() override;
42 void DidReceiveFrame() override;
43 void DidUpdateMatrix(const float* matrix) override;
44
45 private:
46 explicit VideoFrameProviderClientImpl(VideoFrameProvider* provider);
47 friend class base::RefCounted<VideoFrameProviderClientImpl>;
48 ~VideoFrameProviderClientImpl() override;
49
50 VideoLayerImpl* active_video_layer_;
51
52 // Guards the destruction of provider_ and the frame that it provides
53 base::Lock provider_lock_;
54 VideoFrameProvider* provider_;
55 base::ThreadChecker thread_checker_;
56
57 gfx::Transform stream_texture_matrix_;
58
59 DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImpl);
60 };
61
62 } // namespace cc
63
64 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer_unittest.cc ('k') | cc/layers/video_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698