OLD | NEW |
| (Empty) |
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 #include "cc/test/fake_video_frame.h" | |
6 | |
7 using WebKit::WebRect; | |
8 using WebKit::WebSize; | |
9 using WebKit::WebVideoFrame; | |
10 | |
11 namespace cc { | |
12 | |
13 FakeVideoFrame::FakeVideoFrame(const scoped_refptr<media::VideoFrame>& frame) | |
14 : frame_(frame) {} | |
15 | |
16 FakeVideoFrame::~FakeVideoFrame() {} | |
17 | |
18 WebVideoFrame::Format FakeVideoFrame::format() const { | |
19 return FormatInvalid; | |
20 } | |
21 | |
22 unsigned FakeVideoFrame::width() const { | |
23 return frame_->natural_size().width(); | |
24 } | |
25 | |
26 unsigned FakeVideoFrame::height() const { | |
27 return frame_->natural_size().height(); | |
28 } | |
29 | |
30 unsigned FakeVideoFrame::planes() const { | |
31 return 0; | |
32 } | |
33 | |
34 int FakeVideoFrame::stride(unsigned plane) const { | |
35 return 0; | |
36 } | |
37 | |
38 const void* FakeVideoFrame::data(unsigned plane) const { | |
39 return NULL; | |
40 } | |
41 | |
42 unsigned FakeVideoFrame::textureId() const { | |
43 return frame_->texture_id(); | |
44 } | |
45 | |
46 unsigned FakeVideoFrame::textureTarget() const { | |
47 return frame_->texture_target(); | |
48 } | |
49 | |
50 WebRect FakeVideoFrame::visibleRect() const { | |
51 return frame_->visible_rect(); | |
52 } | |
53 | |
54 WebSize FakeVideoFrame::textureSize() const { | |
55 return frame_->coded_size(); | |
56 } | |
57 | |
58 // static | |
59 media::VideoFrame* FakeVideoFrame::ToVideoFrame( | |
60 WebVideoFrame* web_video_frame) { | |
61 if (!web_video_frame) | |
62 return NULL; | |
63 FakeVideoFrame* fake_frame = static_cast<FakeVideoFrame*>(web_video_frame); | |
64 return fake_frame->frame_.get(); | |
65 } | |
66 | |
67 } // namespace cc | |
OLD | NEW |