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_VIDEO_FRAME_PROVIDER_H_ | 5 #ifndef CC_VIDEO_FRAME_PROVIDER_H_ |
6 #define CC_VIDEO_FRAME_PROVIDER_H_ | 6 #define CC_VIDEO_FRAME_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 17 matching lines...) Expand all Loading... |
28 // StopUsingProvider() may be called from any thread. The client should | 28 // StopUsingProvider() may be called from any thread. The client should |
29 // block until it has PutCurrentFrame() any outstanding frames. | 29 // block until it has PutCurrentFrame() any outstanding frames. |
30 virtual void StopUsingProvider() = 0; | 30 virtual void StopUsingProvider() = 0; |
31 | 31 |
32 // Notifies the provider's client that a call to GetCurrentFrame() will | 32 // Notifies the provider's client that a call to GetCurrentFrame() will |
33 // return new data. | 33 // return new data. |
34 virtual void DidReceiveFrame() = 0; | 34 virtual void DidReceiveFrame() = 0; |
35 | 35 |
36 // Notifies the provider's client of a new UV transform matrix to be used. | 36 // Notifies the provider's client of a new UV transform matrix to be used. |
37 virtual void DidUpdateMatrix(const float*) = 0; | 37 virtual void DidUpdateMatrix(const float*) = 0; |
| 38 |
| 39 protected: |
| 40 virtual ~Client() { } |
38 }; | 41 }; |
39 | 42 |
40 // May be called from any thread, but there must be some external guarantee | 43 // May be called from any thread, but there must be some external guarantee |
41 // that the provider is not destroyed before this call returns. | 44 // that the provider is not destroyed before this call returns. |
42 virtual void SetVideoFrameProviderClient(Client*) = 0; | 45 virtual void SetVideoFrameProviderClient(Client*) = 0; |
43 | 46 |
44 // This function places a lock on the current frame and returns a pointer to | 47 // This function places a lock on the current frame and returns a pointer to |
45 // it. Calls to this method should always be followed with a call to | 48 // it. Calls to this method should always be followed with a call to |
46 // PutCurrentFrame(). | 49 // PutCurrentFrame(). |
47 // Only the current provider client should call this function. | 50 // Only the current provider client should call this function. |
48 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0; | 51 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0; |
49 | 52 |
50 // This function releases the lock on the video frame. It should always be | 53 // This function releases the lock on the video frame. It should always be |
51 // called after GetCurrentFrame(). Frames passed into this method | 54 // called after GetCurrentFrame(). Frames passed into this method |
52 // should no longer be referenced after the call is made. Only the current | 55 // should no longer be referenced after the call is made. Only the current |
53 // provider client should call this function. | 56 // provider client should call this function. |
54 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&) = 0; | 57 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&) = 0; |
55 }; | 58 }; |
56 | 59 |
57 } // namespace cc | 60 } // namespace cc |
58 | 61 |
59 #endif // CC_VIDEO_FRAME_PROVIDER_H_ | 62 #endif // CC_VIDEO_FRAME_PROVIDER_H_ |
OLD | NEW |