• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_
6 #define CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_
7 
8 #include "cc/layers/video_frame_provider.h"
9 #include "media/base/video_frame.h"
10 
11 namespace cc {
12 
13 // Fake video frame provider that always provides the same VideoFrame.
14 class FakeVideoFrameProvider : public VideoFrameProvider {
15  public:
16   FakeVideoFrameProvider();
17   virtual ~FakeVideoFrameProvider();
18 
19   virtual void SetVideoFrameProviderClient(Client* client) OVERRIDE;
20   virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE;
PutCurrentFrame(const scoped_refptr<media::VideoFrame> &)21   virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&)
22       OVERRIDE {}
23 
set_frame(const scoped_refptr<media::VideoFrame> & frame)24   void set_frame(const scoped_refptr<media::VideoFrame>& frame) {
25     frame_ = frame;
26   }
27 
28  private:
29   scoped_refptr<media::VideoFrame> frame_;
30   Client* client_;
31 };
32 
33 }  // namespace cc
34 
35 #endif  // CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_
36