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

Unified Diff: webkit/glue/webvideoframe_impl.cc

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
« no previous file with comments | « webkit/glue/webvideoframe_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « webkit/glue/webvideoframe_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698