OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ |
7 | 7 |
8 #include "content/renderer/media/android/stream_texture_factory.h" | 8 #include "content/renderer/media/android/stream_texture_factory.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 class ContextProvider; | 11 class ContextProvider; |
12 } | 12 } |
13 | 13 |
14 namespace gpu { | 14 namespace gpu { |
15 namespace gles2 { | 15 namespace gles2 { |
16 class GLES2Interface; | 16 class GLES2Interface; |
17 } // namespace gles2 | 17 } // namespace gles2 |
18 } // namespace gpu | 18 } // namespace gpu |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
| 22 class ContextProviderCommandBuffer; |
22 class GpuChannelHost; | 23 class GpuChannelHost; |
23 | 24 |
24 class StreamTextureFactoryImpl : public StreamTextureFactory { | 25 class StreamTextureFactoryImpl : public StreamTextureFactory { |
25 public: | 26 public: |
26 static scoped_refptr<StreamTextureFactoryImpl> Create( | 27 static scoped_refptr<StreamTextureFactoryImpl> Create( |
27 const scoped_refptr<cc::ContextProvider>& context_provider, | 28 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
28 GpuChannelHost* channel, | 29 GpuChannelHost* channel, |
29 int frame_id); | 30 int frame_id); |
30 | 31 |
31 // StreamTextureFactory implementation. | 32 // StreamTextureFactory implementation. |
32 StreamTextureProxy* CreateProxy() override; | 33 StreamTextureProxy* CreateProxy() override; |
33 void EstablishPeer(int32 stream_id, int player_id) override; | 34 void EstablishPeer(int32 stream_id, int player_id) override; |
34 unsigned CreateStreamTexture(unsigned texture_target, | 35 unsigned CreateStreamTexture(unsigned texture_target, |
35 unsigned* texture_id, | 36 unsigned* texture_id, |
36 gpu::Mailbox* texture_mailbox) override; | 37 gpu::Mailbox* texture_mailbox) override; |
37 void SetStreamTextureSize(int32 texture_id, const gfx::Size& size) override; | 38 void SetStreamTextureSize(int32 texture_id, const gfx::Size& size) override; |
38 gpu::gles2::GLES2Interface* ContextGL() override; | 39 gpu::gles2::GLES2Interface* ContextGL() override; |
39 void AddObserver(StreamTextureFactoryContextObserver* obs) override; | 40 void AddObserver(StreamTextureFactoryContextObserver* obs) override; |
40 void RemoveObserver(StreamTextureFactoryContextObserver* obs) override; | 41 void RemoveObserver(StreamTextureFactoryContextObserver* obs) override; |
41 | 42 |
42 private: | 43 private: |
43 friend class base::RefCounted<StreamTextureFactoryImpl>; | 44 friend class base::RefCounted<StreamTextureFactoryImpl>; |
44 StreamTextureFactoryImpl( | 45 StreamTextureFactoryImpl( |
45 const scoped_refptr<cc::ContextProvider>& context_provider, | 46 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
46 GpuChannelHost* channel, | 47 GpuChannelHost* channel, |
47 int frame_id); | 48 int frame_id); |
48 ~StreamTextureFactoryImpl() override; | 49 ~StreamTextureFactoryImpl() override; |
49 | 50 |
50 scoped_refptr<cc::ContextProvider> context_provider_; | 51 scoped_refptr<content::ContextProviderCommandBuffer> context_provider_; |
51 scoped_refptr<GpuChannelHost> channel_; | 52 scoped_refptr<GpuChannelHost> channel_; |
52 int frame_id_; | 53 int frame_id_; |
53 | 54 |
54 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); | 55 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace content | 58 } // namespace content |
58 | 59 |
59 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ | 60 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ |
OLD | NEW |