Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: third_party/WebKit/WebKit/chromium/src/VideoFrameChromiumImpl.cpp

Issue 3058055: Implemented way to share video frames between WebKit and Chromium (Closed)
Patch Set: Adding WebKit side for easy reading (will delete in final patch) Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698