blob: 02919b15273d768ced94889b5bd7d672538a4c56 [file] [log] [blame]
[email protected]cd57cc5a2012-10-12 22:43:411// Copyright 2010 The Chromium Authors. All rights reserved.
[email protected]0fb25002012-10-12 07:20:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
[email protected]cd57cc5a2012-10-12 22:43:414
[email protected]cc3cfaa2013-03-18 09:05:525#ifndef CC_LAYERS_VIDEO_LAYER_H_
6#define CC_LAYERS_VIDEO_LAYER_H_
[email protected]cd57cc5a2012-10-12 22:43:417
[email protected]59cb7b352012-10-30 06:45:488#include "base/callback.h"
avi02a4d172015-12-21 06:14:369#include "base/macros.h"
chrishtrac41ff942017-03-17 05:07:3010#include "cc/cc_export.h"
[email protected]cc3cfaa2013-03-18 09:05:5211#include "cc/layers/layer.h"
[email protected]f78c3e82014-08-08 01:24:4712#include "media/base/video_rotation.h"
[email protected]cd57cc5a2012-10-12 22:43:4113
[email protected]50657802013-03-13 06:43:3514namespace media { class VideoFrame; }
[email protected]59cb7b352012-10-30 06:45:4815
[email protected]cd57cc5a2012-10-12 22:43:4116namespace cc {
17
[email protected]568285b2013-01-07 23:19:1918class VideoFrameProvider;
[email protected]96baf3e2012-10-22 23:09:5519class VideoLayerImpl;
[email protected]cd57cc5a2012-10-12 22:43:4120
21// A Layer that contains a Video element.
[email protected]52347c842012-11-02 21:06:2022class CC_EXPORT VideoLayer : public Layer {
[email protected]50657802013-03-13 06:43:3523 public:
loyso0940d412016-03-14 01:30:3124 static scoped_refptr<VideoLayer> Create(VideoFrameProvider* provider,
[email protected]f78c3e82014-08-08 01:24:4725 media::VideoRotation video_rotation);
[email protected]cd57cc5a2012-10-12 22:43:4126
danakj60bc3bc2016-04-09 00:24:4827 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
[email protected]cd57cc5a2012-10-12 22:43:4128
danakj5f46636a2015-06-19 00:01:4029 bool Update() override;
[email protected]34ba1ffb2014-03-05 06:55:0330
dalecurtise1edb312016-06-22 02:33:2131 // Clears |provider_| to ensure it is not used after destruction.
32 void StopUsingProvider();
33
[email protected]50657802013-03-13 06:43:3534 private:
loyso0940d412016-03-14 01:30:3135 VideoLayer(VideoFrameProvider* provider, media::VideoRotation video_rotation);
dcheng716bedf2014-10-21 09:51:0836 ~VideoLayer() override;
[email protected]cd57cc5a2012-10-12 22:43:4137
[email protected]50657802013-03-13 06:43:3538 // This pointer is only for passing to VideoLayerImpl's constructor. It should
39 // never be dereferenced by this class.
40 VideoFrameProvider* provider_;
[email protected]fa2d9a52013-03-27 18:47:0841
[email protected]f78c3e82014-08-08 01:24:4742 media::VideoRotation video_rotation_;
43
[email protected]fa2d9a52013-03-27 18:47:0844 DISALLOW_COPY_AND_ASSIGN(VideoLayer);
[email protected]cd57cc5a2012-10-12 22:43:4145};
46
[email protected]59cb7b352012-10-30 06:45:4847} // namespace cc
48
[email protected]cc3cfaa2013-03-18 09:05:5249#endif // CC_LAYERS_VIDEO_LAYER_H_