1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ 6 #define WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ 7 8 #include "media/base/video_frame.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" 10 11 namespace webkit_glue { 12 13 class WebVideoFrameImpl : public WebKit::WebVideoFrame { 14 public: 15 // This converts a WebKit::WebVideoFrame to a media::VideoFrame. 16 static media::VideoFrame* toVideoFrame( 17 WebKit::WebVideoFrame* web_video_frame); 18 19 WebVideoFrameImpl(scoped_refptr<media::VideoFrame> video_frame); 20 virtual ~WebVideoFrameImpl(); 21 virtual WebVideoFrame::SurfaceType surfaceType() const; 22 virtual WebVideoFrame::Format format() const; 23 virtual unsigned width() const; 24 virtual unsigned height() const; 25 virtual unsigned planes() const; 26 virtual int stride(unsigned plane) const; 27 virtual const void* data(unsigned plane) const; 28 virtual unsigned texture(unsigned plane) const; 29 30 private: 31 scoped_refptr<media::VideoFrame> video_frame_; 32 DISALLOW_COPY_AND_ASSIGN(WebVideoFrameImpl); 33 }; 34 35 } // namespace webkit_glue 36 37 #endif // WEBKIT_GLUE_WEBVIDEOFRAME_IMPL_H_ 38