Index: third_party/WebKit/WebKit/chromium/src/VideoFrameChromiumImpl.cpp |
diff --git a/third_party/WebKit/WebKit/chromium/src/VideoFrameChromiumImpl.cpp b/third_party/WebKit/WebKit/chromium/src/VideoFrameChromiumImpl.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7f481513c182ea61bd0961a33ef34d287b1baf60 |
--- /dev/null |
+++ b/third_party/WebKit/WebKit/chromium/src/VideoFrameChromiumImpl.cpp |
@@ -0,0 +1,75 @@ |
+// 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 "config.h" |
+#include "VideoFrameChromiumImpl.h" |
+ |
+#include "VideoFrameChromium.h" |
+#include "WebVideoFrame.h" |
+ |
+namespace WebKit { |
+ |
+WebVideoFrame* VideoFrameChromiumImpl::toWebVideoFrame(WebCore::VideoFrameChromium* frame) |
+{ |
+ VideoFrameChromiumImpl* wrappedFrame = static_cast<VideoFrameChromiumImpl*>(frame); |
+ if (wrappedFrame) |
+ return wrappedFrame->m_webFrame; |
+ return 0; |
+} |
+ |
+VideoFrameChromiumImpl::VideoFrameChromiumImpl(WebVideoFrame* frame) : |
+ m_webFrame(frame) |
+{ |
+} |
+ |
+WebCore::VideoFrameChromium::SurfaceType VideoFrameChromiumImpl::type() const |
+{ |
+ if (m_webFrame) |
+ return static_cast<VideoFrameChromium::SurfaceType>(m_webFrame->type()); |
+ return TYPE_SYSTEM_MEMORY; |
+} |
+ |
+WebCore::VideoFrameChromium::Format VideoFrameChromiumImpl::format() const |
+{ |
+ if (m_webFrame) |
+ return static_cast<VideoFrameChromium::Format>(m_webFrame->format()); |
+ return INVALID; |
+} |
+ |
+size_t VideoFrameChromiumImpl::width() const |
+{ |
+ if (m_webFrame) |
+ return m_webFrame->width(); |
+ return 0; |
+} |
+ |
+size_t VideoFrameChromiumImpl::height() const |
+{ |
+ if (m_webFrame) |
+ return m_webFrame->height(); |
+ return 0; |
+} |
+ |
+size_t VideoFrameChromiumImpl::planes() const |
+{ |
+ if (m_webFrame) |
+ return m_webFrame->planes(); |
+ return 0; |
+} |
+ |
+int VideoFrameChromiumImpl::stride(size_t plane) const |
+{ |
+ if (m_webFrame) |
+ return m_webFrame->stride(plane); |
+ return 0; |
+} |
+ |
+void* VideoFrameChromiumImpl::data(size_t plane) const |
+{ |
+ if (m_webFrame) |
+ return m_webFrame->data(plane); |
+ return 0; |
+} |
+ |
+} // namespace WebKit |