Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / cc / test / fake_video_frame_provider.h
blob4cbd80a2ff743187dc8b535c066503e096d02161
1 // Copyright 2012 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.
5 #ifndef CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_
6 #define CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_
8 #include "cc/layers/video_frame_provider.h"
9 #include "media/base/video_frame.h"
11 namespace cc {
13 // Fake video frame provider that always provides the same VideoFrame.
14 class FakeVideoFrameProvider : public VideoFrameProvider {
15 public:
16 FakeVideoFrameProvider();
17 ~FakeVideoFrameProvider() override;
19 void SetVideoFrameProviderClient(Client* client) override;
20 bool UpdateCurrentFrame(base::TimeTicks deadline_min,
21 base::TimeTicks deadline_max) override;
22 bool HasCurrentFrame() override;
23 scoped_refptr<media::VideoFrame> GetCurrentFrame() override;
24 void PutCurrentFrame() override;
26 Client* client() { return client_; }
28 void set_frame(const scoped_refptr<media::VideoFrame>& frame) {
29 frame_ = frame;
32 int put_current_frame_count() const { return put_current_frame_count_; }
34 private:
35 scoped_refptr<media::VideoFrame> frame_;
36 Client* client_;
37 int put_current_frame_count_;
40 } // namespace cc
42 #endif // CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_