| 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 GpuChannelHost; | 22 class GpuChannelHost; |
| 23 | 23 |
| 24 class StreamTextureFactoryImpl : public StreamTextureFactory { | 24 class StreamTextureFactoryImpl : public StreamTextureFactory { |
| 25 public: | 25 public: |
| 26 static scoped_refptr<StreamTextureFactoryImpl> Create( | 26 static scoped_refptr<StreamTextureFactoryImpl> Create( |
| 27 const scoped_refptr<cc::ContextProvider>& context_provider, | 27 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 28 GpuChannelHost* channel, | 28 GpuChannelHost* channel, |
| 29 int view_id); | 29 int frame_id); |
| 30 | 30 |
| 31 // StreamTextureFactory implementation. | 31 // StreamTextureFactory implementation. |
| 32 virtual StreamTextureProxy* CreateProxy() OVERRIDE; | 32 virtual StreamTextureProxy* CreateProxy() OVERRIDE; |
| 33 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE; | 33 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE; |
| 34 virtual unsigned CreateStreamTexture(unsigned texture_target, | 34 virtual unsigned CreateStreamTexture(unsigned texture_target, |
| 35 unsigned* texture_id, | 35 unsigned* texture_id, |
| 36 gpu::Mailbox* texture_mailbox) OVERRIDE; | 36 gpu::Mailbox* texture_mailbox) OVERRIDE; |
| 37 virtual void SetStreamTextureSize(int32 texture_id, | 37 virtual void SetStreamTextureSize(int32 texture_id, |
| 38 const gfx::Size& size) OVERRIDE; | 38 const gfx::Size& size) OVERRIDE; |
| 39 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 39 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 friend class base::RefCounted<StreamTextureFactoryImpl>; | 42 friend class base::RefCounted<StreamTextureFactoryImpl>; |
| 43 StreamTextureFactoryImpl( | 43 StreamTextureFactoryImpl( |
| 44 const scoped_refptr<cc::ContextProvider>& context_provider, | 44 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 45 GpuChannelHost* channel, | 45 GpuChannelHost* channel, |
| 46 int view_id); | 46 int frame_id); |
| 47 virtual ~StreamTextureFactoryImpl(); | 47 virtual ~StreamTextureFactoryImpl(); |
| 48 | 48 |
| 49 scoped_refptr<cc::ContextProvider> context_provider_; | 49 scoped_refptr<cc::ContextProvider> context_provider_; |
| 50 scoped_refptr<GpuChannelHost> channel_; | 50 scoped_refptr<GpuChannelHost> channel_; |
| 51 int view_id_; | 51 int frame_id_; |
| 52 | 52 |
| 53 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); | 53 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| 57 | 57 |
| 58 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ | 58 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_IMPL_H_ |
| OLD | NEW |