OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ | 5 #ifndef CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ |
6 #define CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ | 6 #define CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "cc/video_frame_provider.h" |
9 #include "cc/test/fake_video_frame.h" | 9 #include "media/base/video_frame.h" |
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoFrameProvid
er.h" | |
11 | 10 |
12 namespace cc { | 11 namespace cc { |
13 | 12 |
14 // Fake video frame provider that always provides the same VideoFrame. | 13 // Fake video frame provider that always provides the same VideoFrame. |
15 class FakeVideoFrameProvider: public WebKit::WebVideoFrameProvider { | 14 class FakeVideoFrameProvider: public VideoFrameProvider { |
16 public: | 15 public: |
17 FakeVideoFrameProvider(); | 16 FakeVideoFrameProvider(); |
18 virtual ~FakeVideoFrameProvider(); | 17 virtual ~FakeVideoFrameProvider(); |
19 | 18 |
20 | 19 |
21 virtual void setVideoFrameProviderClient(Client* client) OVERRIDE; | 20 virtual void SetVideoFrameProviderClient(Client* client) OVERRIDE; |
22 virtual WebKit::WebVideoFrame* getCurrentFrame() OVERRIDE; | 21 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; |
23 virtual void putCurrentFrame(WebKit::WebVideoFrame*) OVERRIDE {} | 22 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame>) OVERRIDE {} |
24 | 23 |
25 void set_frame(FakeVideoFrame* frame) { | 24 void set_frame(const scoped_refptr<media::VideoFrame>& frame) { |
26 frame_ = frame; | 25 frame_ = frame; |
27 } | 26 } |
28 | 27 |
29 private: | 28 private: |
30 FakeVideoFrame* frame_; | 29 scoped_refptr<media::VideoFrame> frame_; |
31 Client* client_; | 30 Client* client_; |
32 }; | 31 }; |
33 | 32 |
34 } // namespace cc | 33 } // namespace cc |
35 | 34 |
36 #endif // CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ | 35 #endif // CC_TEST_FAKE_VIDEO_FRAME_PROVIDER_H_ |
OLD | NEW |