OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 5 #ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/base/cc_export.h" | |
9 | 10 |
10 namespace media { | 11 namespace media { |
11 class VideoFrame; | 12 class VideoFrame; |
12 } | 13 } |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 // Threading notes: This class may be used in a multi threaded manner. | 17 // Threading notes: This class may be used in a multi threaded manner. |
17 // Specifically, the implementation may call GetCurrentFrame() or | 18 // Specifically, the implementation may call GetCurrentFrame() or |
18 // PutCurrentFrame() from the compositor thread. If so, the caller is | 19 // PutCurrentFrame() from the compositor thread. If so, the caller is |
19 // responsible for making sure Client::DidReceiveFrame() and | 20 // responsible for making sure Client::DidReceiveFrame() and |
20 // Client::DidUpdateMatrix() are only called from this same thread. | 21 // Client::DidUpdateMatrix() are only called from this same thread. |
21 class VideoFrameProvider { | 22 class CC_EXPORT VideoFrameProvider { |
danakj
2015/03/26 22:38:35
we don't need to export pure virtual things right?
sunnyps
2015/03/27 00:38:46
I think we do in this case - my CL fails on dll bu
| |
22 public: | 23 public: |
23 virtual ~VideoFrameProvider() {} | 24 virtual ~VideoFrameProvider() {} |
24 | 25 |
25 class Client { | 26 class CC_EXPORT Client { |
26 public: | 27 public: |
27 // Provider will call this method to tell the client to stop using it. | 28 // Provider will call this method to tell the client to stop using it. |
28 // StopUsingProvider() may be called from any thread. The client should | 29 // StopUsingProvider() may be called from any thread. The client should |
29 // block until it has PutCurrentFrame() any outstanding frames. | 30 // block until it has PutCurrentFrame() any outstanding frames. |
30 virtual void StopUsingProvider() = 0; | 31 virtual void StopUsingProvider() = 0; |
31 | 32 |
32 // Notifies the provider's client that a call to GetCurrentFrame() will | 33 // Notifies the provider's client that a call to GetCurrentFrame() will |
33 // return new data. | 34 // return new data. |
34 virtual void DidReceiveFrame() = 0; | 35 virtual void DidReceiveFrame() = 0; |
35 | 36 |
(...skipping 18 matching lines...) Expand all Loading... | |
54 // called after GetCurrentFrame(). Frames passed into this method | 55 // called after GetCurrentFrame(). Frames passed into this method |
55 // should no longer be referenced after the call is made. Only the current | 56 // should no longer be referenced after the call is made. Only the current |
56 // provider client should call this function. | 57 // provider client should call this function. |
57 virtual void PutCurrentFrame( | 58 virtual void PutCurrentFrame( |
58 const scoped_refptr<media::VideoFrame>& frame) = 0; | 59 const scoped_refptr<media::VideoFrame>& frame) = 0; |
59 }; | 60 }; |
60 | 61 |
61 } // namespace cc | 62 } // namespace cc |
62 | 63 |
63 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 64 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
OLD | NEW |