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 "base/memory/weak_ptr.h"
11 #include "cc/layers/video_frame_provider.h"
12 #include "gpu/command_buffer/common/mailbox.h"
13 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/size.h"
24 class SurfaceTextureBridge
;
29 class SurfaceTextureTransportClient
: public cc::VideoFrameProvider
{
31 SurfaceTextureTransportClient();
32 virtual ~SurfaceTextureTransportClient();
34 scoped_refptr
<cc::Layer
> Initialize();
35 gfx::GLSurfaceHandle
GetCompositingSurface(int surface_id
);
36 void SetSize(const gfx::Size
& size
);
38 // cc::VideoFrameProvider implementation.
39 virtual void SetVideoFrameProviderClient(Client
*) OVERRIDE
{}
40 virtual scoped_refptr
<media::VideoFrame
> GetCurrentFrame() OVERRIDE
;
41 virtual void PutCurrentFrame(const scoped_refptr
<media::VideoFrame
>& frame
)
45 void OnSurfaceTextureFrameAvailable();
47 scoped_refptr
<cc::VideoLayer
> video_layer_
;
48 scoped_refptr
<gfx::SurfaceTextureBridge
> surface_texture_
;
49 ANativeWindow
* window_
;
50 scoped_refptr
<media::VideoFrame
> video_frame_
;
52 gpu::Mailbox texture_mailbox_
;
53 uint32 texture_mailbox_sync_point_
;
55 base::WeakPtrFactory
<SurfaceTextureTransportClient
> weak_factory_
;
57 DISALLOW_COPY_AND_ASSIGN(SurfaceTextureTransportClient
);
60 } // namespace content
62 #endif // CONTENT_BROWSER_RENDERER_HOST_SURFACE_TEXTURE_TRANSPORT_CLIENT_ANDROID_H_