1 // Copyright 2014 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_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_
8 #include "content/renderer/media/android/stream_texture_factory.h"
11 class ContextProvider
;
24 class StreamTextureFactoryImpl
: public StreamTextureFactory
{
26 static scoped_refptr
<StreamTextureFactoryImpl
> Create(
27 const scoped_refptr
<cc::ContextProvider
>& context_provider
,
28 GpuChannelHost
* channel
,
31 // StreamTextureFactory implementation.
32 virtual StreamTextureProxy
* CreateProxy() override
;
33 virtual void EstablishPeer(int32 stream_id
, int player_id
) override
;
34 virtual unsigned CreateStreamTexture(unsigned texture_target
,
36 gpu::Mailbox
* texture_mailbox
) override
;
37 virtual void SetStreamTextureSize(int32 texture_id
,
38 const gfx::Size
& size
) override
;
39 virtual gpu::gles2::GLES2Interface
* ContextGL() override
;
40 virtual void AddObserver(StreamTextureFactoryContextObserver
* obs
) override
;
41 virtual void RemoveObserver(
42 StreamTextureFactoryContextObserver
* obs
) override
;
45 friend class base::RefCounted
<StreamTextureFactoryImpl
>;
46 StreamTextureFactoryImpl(
47 const scoped_refptr
<cc::ContextProvider
>& context_provider
,
48 GpuChannelHost
* channel
,
50 virtual ~StreamTextureFactoryImpl();
52 scoped_refptr
<cc::ContextProvider
> context_provider_
;
53 scoped_refptr
<GpuChannelHost
> channel_
;
56 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl
);
59 } // namespace content
61 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_