diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:01:21 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:01:21 +0000 |
commit | e81283bbf1beafe0a5dafbca2e7484b1d7a6a055 (patch) | |
tree | 3b9a98ff9ba4dc7f7d48d5e63db98e1281481503 /webkit/glue/webvideoframe_impl.h | |
parent | 44af30973fa42b01e622e4c15c0f4428ddce066f (diff) | |
download | chromium_src-e81283bbf1beafe0a5dafbca2e7484b1d7a6a055.zip chromium_src-e81283bbf1beafe0a5dafbca2e7484b1d7a6a055.tar.gz chromium_src-e81283bbf1beafe0a5dafbca2e7484b1d7a6a055.tar.bz2 |
Adding way to pass video frames between Chromium and WebKit
This patch adds an implementation of the WebVideoFrame interface defined in
WebKit, and it adds behavior to WebMediaPlayerImpl to pass video frame data
between WebKit and Chromium.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3155050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webvideoframe_impl.h')
-rw-r--r-- | webkit/glue/webvideoframe_impl.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/webkit/glue/webvideoframe_impl.h b/webkit/glue/webvideoframe_impl.h new file mode 100644 index 0000000..6dc9cde --- /dev/null +++ b/webkit/glue/webvideoframe_impl.h @@ -0,0 +1,36 @@ +// 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. + +#ifndef WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ +#define WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ + +#include "media/base/video_frame.h" +#include "third_party/WebKit/WebKit/chromium/public/WebVideoFrame.h" + +using namespace WebKit; + +namespace webkit_glue { + +class WebVideoFrameImpl : public WebVideoFrame { + public: + // This converts a WebKit::WebVideoFrame to a media::VideoFrame. + static media::VideoFrame* toVideoFrame(WebVideoFrame* web_video_frame); + + WebVideoFrameImpl(scoped_refptr<media::VideoFrame> video_frame); + virtual WebVideoFrame::SurfaceType surfaceType() const; + virtual WebVideoFrame::Format format() const; + virtual unsigned width() const; + virtual unsigned height() const; + virtual unsigned planes() const; + virtual int stride(unsigned plane) const; + virtual const void* data(unsigned plane) const; + + private: + scoped_refptr<media::VideoFrame> video_frame_; + DISALLOW_COPY_AND_ASSIGN(WebVideoFrameImpl); +}; + +} // namespace webkit_glue + +#endif // WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ |