Index: webkit/glue/webvideoframe_impl.cc |
diff --git a/webkit/glue/webvideoframe_impl.cc b/webkit/glue/webvideoframe_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e03be05ff6c8b986a4fc050507576a517b50770d |
--- /dev/null |
+++ b/webkit/glue/webvideoframe_impl.cc |
@@ -0,0 +1,65 @@ |
+// Copyright (c) 2010 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 "webkit/glue/webvideoframe_impl.h" |
+ |
+#include "media/base/video_frame.h" |
+#include "third_party/WebKit/WebKit/chromium/public/WebVideoFrame.h" |
+ |
+namespace webkit_glue { |
+ |
+WebVideoFrameImpl::WebVideoFrameImpl(media::VideoFrame* frame) |
+ : frame_(frame) { |
+} |
+ |
+media::VideoFrame* WebVideoFrameImpl::toVideoFrame(WebKit::WebVideoFrame* frame) { |
+ WebVideoFrameImpl* wrappedFrame = static_cast<WebVideoFrameImpl*>(frame); |
+ if (wrappedFrame) |
+ return wrappedFrame->frame_; |
+ return 0; |
+} |
+ |
+WebKit::WebVideoFrame::SurfaceType WebVideoFrameImpl::type() const { |
+ if (frame_) |
+ return static_cast<WebKit::WebVideoFrame::SurfaceType>(frame_->type()); |
+ return TYPE_SYSTEM_MEMORY; |
+} |
+ |
+WebKit::WebVideoFrame::Format WebVideoFrameImpl::format() const { |
+ if (frame_) |
+ return static_cast<WebKit::WebVideoFrame::Format>(frame_->format()); |
+ return INVALID; |
+} |
+ |
+size_t WebVideoFrameImpl::width() const { |
+ if (frame_) |
+ return frame_->width(); |
+ return 0; |
+} |
+ |
+size_t WebVideoFrameImpl::height() const { |
+ if (frame_) |
+ return frame_->height(); |
+ return 0; |
+} |
+ |
+size_t WebVideoFrameImpl::planes() const { |
+ if (frame_) |
+ return frame_->planes(); |
+ return 0; |
+} |
+ |
+int WebVideoFrameImpl::stride(size_t plane) const { |
+ if (frame_) |
+ return static_cast<int>(frame_->stride(plane)); |
+ return 0; |
+} |
+ |
+void* WebVideoFrameImpl::data(size_t plane) const { |
+ if (frame_) |
+ return static_cast<void*>(frame_->data(plane)); |
+ return 0; |
+} |
+ |
+} // namespace webkit_glue |