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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/renderer/media/android/stream_texture_factory.h" | 11 #include "content/renderer/media/android/stream_texture_factory.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 class ContextProvider; | 14 class ContextProvider; |
15 } | 15 } |
16 | 16 |
17 namespace gpu { | 17 namespace gpu { |
18 namespace gles2 { | 18 namespace gles2 { |
19 class GLES2Interface; | 19 class GLES2Interface; |
20 } // namespace gles2 | 20 } // namespace gles2 |
| 21 class GpuChannelHost; |
21 } // namespace gpu | 22 } // namespace gpu |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 class ContextProviderCommandBuffer; | 26 class ContextProviderCommandBuffer; |
26 class GpuChannelHost; | |
27 | 27 |
28 class StreamTextureFactoryImpl : public StreamTextureFactory { | 28 class StreamTextureFactoryImpl : public StreamTextureFactory { |
29 public: | 29 public: |
30 static scoped_refptr<StreamTextureFactoryImpl> Create( | 30 static scoped_refptr<StreamTextureFactoryImpl> Create( |
31 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 31 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
32 GpuChannelHost* channel); | 32 gpu::GpuChannelHost* channel); |
33 | 33 |
34 // StreamTextureFactory implementation. | 34 // StreamTextureFactory implementation. |
35 StreamTextureProxy* CreateProxy() override; | 35 StreamTextureProxy* CreateProxy() override; |
36 void EstablishPeer(int32_t stream_id, int player_id, int frame_id) override; | 36 void EstablishPeer(int32_t stream_id, int player_id, int frame_id) override; |
37 unsigned CreateStreamTexture(unsigned texture_target, | 37 unsigned CreateStreamTexture(unsigned texture_target, |
38 unsigned* texture_id, | 38 unsigned* texture_id, |
39 gpu::Mailbox* texture_mailbox) override; | 39 gpu::Mailbox* texture_mailbox) override; |
40 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size) override; | 40 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size) override; |
41 gpu::gles2::GLES2Interface* ContextGL() override; | 41 gpu::gles2::GLES2Interface* ContextGL() override; |
42 void AddObserver(StreamTextureFactoryContextObserver* obs) override; | 42 void AddObserver(StreamTextureFactoryContextObserver* obs) override; |
43 void RemoveObserver(StreamTextureFactoryContextObserver* obs) override; | 43 void RemoveObserver(StreamTextureFactoryContextObserver* obs) override; |
44 | 44 |
45 private: | 45 private: |
46 friend class base::RefCounted<StreamTextureFactoryImpl>; | 46 friend class base::RefCounted<StreamTextureFactoryImpl>; |
47 StreamTextureFactoryImpl( | 47 StreamTextureFactoryImpl( |
48 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 48 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
49 GpuChannelHost* channel); | 49 gpu::GpuChannelHost* channel); |
50 ~StreamTextureFactoryImpl() override; | 50 ~StreamTextureFactoryImpl() override; |
51 | 51 |
52 scoped_refptr<content::ContextProviderCommandBuffer> context_provider_; | 52 scoped_refptr<ContextProviderCommandBuffer> context_provider_; |
53 scoped_refptr<GpuChannelHost> channel_; | 53 scoped_refptr<gpu::GpuChannelHost> channel_; |
54 | 54 |
55 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); | 55 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace content | 58 } // namespace content |
59 | 59 |
60 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ | 60 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ |
OLD | NEW |