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