1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SURFACE_TEXTURE_TRANSPORT_CLIENT_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_SURFACE_TEXTURE_TRANSPORT_CLIENT_ANDROID_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoFrameProvider.h"
11 #include "ui/gfx/native_widget_types.h"
21 class SurfaceTextureBridge
;
23 class SurfaceTextureTransportClient
: public WebKit::WebVideoFrameProvider
{
25 SurfaceTextureTransportClient();
26 virtual ~SurfaceTextureTransportClient();
28 scoped_refptr
<cc::Layer
> Initialize();
29 gfx::GLSurfaceHandle
GetCompositingSurface(int surface_id
);
30 void SetSize(const gfx::Size
& size
);
32 // WebKit::WebVideoFrameProvider implementation.
33 virtual void setVideoFrameProviderClient(Client
*) OVERRIDE
{}
34 virtual WebKit::WebVideoFrame
* getCurrentFrame() OVERRIDE
;
35 virtual void putCurrentFrame(WebKit::WebVideoFrame
* frame
) OVERRIDE
;
38 void OnSurfaceTextureFrameAvailable();
40 scoped_refptr
<cc::VideoLayer
> video_layer_
;
41 scoped_refptr
<SurfaceTextureBridge
> surface_texture_
;
42 ANativeWindow
* window_
;
43 scoped_ptr
<WebKit::WebVideoFrame
> video_frame_
;
46 DISALLOW_COPY_AND_ASSIGN(SurfaceTextureTransportClient
);
49 } // namespace content
51 #endif // CONTENT_BROWSER_RENDERER_HOST_SURFACE_TEXTURE_TRANSPORT_CLIENT_ANDROID_H_