Index: cc/test/fake_video_frame.cc |
diff --git a/cc/test/fake_video_frame.cc b/cc/test/fake_video_frame.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..404a5d779fa05c3feb02db5043ac0b5e472b0ef2 |
--- /dev/null |
+++ b/cc/test/fake_video_frame.cc |
@@ -0,0 +1,67 @@ |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "cc/test/fake_video_frame.h" |
+ |
+using WebKit::WebRect; |
jamesr
2013/01/03 21:30:08
don't really need these using statements since the
danakj
2013/01/03 21:52:20
Done.
|
+using WebKit::WebSize; |
+using WebKit::WebVideoFrame; |
+ |
+namespace cc { |
+ |
+FakeVideoFrame::FakeVideoFrame(const scoped_refptr<media::VideoFrame>& frame) |
+ : frame_(frame) {} |
+ |
+FakeVideoFrame::~FakeVideoFrame() {} |
+ |
+WebVideoFrame::Format FakeVideoFrame::format() const { |
+ return FormatInvalid; |
+} |
+ |
+unsigned FakeVideoFrame::width() const { |
+ return frame_->natural_size().width(); |
+} |
+ |
+unsigned FakeVideoFrame::height() const { |
+ return frame_->natural_size().height(); |
+} |
+ |
+unsigned FakeVideoFrame::planes() const { |
+ return 0; |
+} |
+ |
+int FakeVideoFrame::stride(unsigned plane) const { |
+ return 0; |
+} |
+ |
+const void* FakeVideoFrame::data(unsigned plane) const { |
+ return NULL; |
+} |
+ |
+unsigned FakeVideoFrame::textureId() const { |
+ return frame_->texture_id(); |
+} |
+ |
+unsigned FakeVideoFrame::textureTarget() const { |
+ return frame_->texture_target(); |
+} |
+ |
+WebRect FakeVideoFrame::visibleRect() const { |
+ return frame_->visible_rect(); |
+} |
+ |
+WebSize FakeVideoFrame::textureSize() const { |
+ return frame_->coded_size(); |
+} |
+ |
+// static |
+media::VideoFrame* FakeVideoFrame::ToVideoFrame( |
+ WebVideoFrame* web_video_frame) { |
+ if (!web_video_frame) |
+ return NULL; |
+ FakeVideoFrame* fake_frame = static_cast<FakeVideoFrame*>(web_video_frame); |
+ return fake_frame->frame_.get(); |
+} |
+ |
+} // namespace cc |