[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 1 | // Copyright 2010 The Chromium Authors. All rights reserved. |
[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 5 | #ifndef CC_LAYERS_VIDEO_LAYER_H_ |
6 | #define CC_LAYERS_VIDEO_LAYER_H_ | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 7 | |
[email protected] | 59cb7b35 | 2012-10-30 06:45:48 | [diff] [blame] | 8 | #include "base/callback.h" |
avi | 02a4d17 | 2015-12-21 06:14:36 | [diff] [blame] | 9 | #include "base/macros.h" |
chrishtr | ac41ff94 | 2017-03-17 05:07:30 | [diff] [blame] | 10 | #include "cc/cc_export.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 11 | #include "cc/layers/layer.h" |
[email protected] | f78c3e8 | 2014-08-08 01:24:47 | [diff] [blame] | 12 | #include "media/base/video_rotation.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 13 | |
[email protected] | 5065780 | 2013-03-13 06:43:35 | [diff] [blame] | 14 | namespace media { class VideoFrame; } |
[email protected] | 59cb7b35 | 2012-10-30 06:45:48 | [diff] [blame] | 15 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 16 | namespace cc { |
17 | |||||
[email protected] | 568285b | 2013-01-07 23:19:19 | [diff] [blame] | 18 | class VideoFrameProvider; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 19 | class VideoLayerImpl; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 20 | |
21 | // A Layer that contains a Video element. | ||||
[email protected] | 52347c84 | 2012-11-02 21:06:20 | [diff] [blame] | 22 | class CC_EXPORT VideoLayer : public Layer { |
[email protected] | 5065780 | 2013-03-13 06:43:35 | [diff] [blame] | 23 | public: |
loyso | 0940d41 | 2016-03-14 01:30:31 | [diff] [blame] | 24 | static scoped_refptr<VideoLayer> Create(VideoFrameProvider* provider, |
[email protected] | f78c3e8 | 2014-08-08 01:24:47 | [diff] [blame] | 25 | media::VideoRotation video_rotation); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 26 | |
danakj | 60bc3bc | 2016-04-09 00:24:48 | [diff] [blame] | 27 | std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 28 | |
danakj | 5f46636a | 2015-06-19 00:01:40 | [diff] [blame] | 29 | bool Update() override; |
[email protected] | 34ba1ffb | 2014-03-05 06:55:03 | [diff] [blame] | 30 | |
dalecurtis | e1edb31 | 2016-06-22 02:33:21 | [diff] [blame] | 31 | // Clears |provider_| to ensure it is not used after destruction. |
32 | void StopUsingProvider(); | ||||
33 | |||||
[email protected] | 5065780 | 2013-03-13 06:43:35 | [diff] [blame] | 34 | private: |
loyso | 0940d41 | 2016-03-14 01:30:31 | [diff] [blame] | 35 | VideoLayer(VideoFrameProvider* provider, media::VideoRotation video_rotation); |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 36 | ~VideoLayer() override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 37 | |
[email protected] | 5065780 | 2013-03-13 06:43:35 | [diff] [blame] | 38 | // This pointer is only for passing to VideoLayerImpl's constructor. It should |
39 | // never be dereferenced by this class. | ||||
40 | VideoFrameProvider* provider_; | ||||
[email protected] | fa2d9a5 | 2013-03-27 18:47:08 | [diff] [blame] | 41 | |
[email protected] | f78c3e8 | 2014-08-08 01:24:47 | [diff] [blame] | 42 | media::VideoRotation video_rotation_; |
43 | |||||
[email protected] | fa2d9a5 | 2013-03-27 18:47:08 | [diff] [blame] | 44 | DISALLOW_COPY_AND_ASSIGN(VideoLayer); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 45 | }; |
46 | |||||
[email protected] | 59cb7b35 | 2012-10-30 06:45:48 | [diff] [blame] | 47 | } // namespace cc |
48 | |||||
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 49 | #endif // CC_LAYERS_VIDEO_LAYER_H_ |