| 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_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 // Create the StreamTextureProxy object. | 80 // Create the StreamTextureProxy object. |
| 81 StreamTextureProxy* CreateProxy(); | 81 StreamTextureProxy* CreateProxy(); |
| 82 | 82 |
| 83 // Send an IPC message to the browser process to request a java surface | 83 // Send an IPC message to the browser process to request a java surface |
| 84 // object for the given stream_id. After the the surface is created, | 84 // object for the given stream_id. After the the surface is created, |
| 85 // it will be passed back to the WebMediaPlayerAndroid object identified by | 85 // it will be passed back to the WebMediaPlayerAndroid object identified by |
| 86 // the player_id. | 86 // the player_id. |
| 87 void EstablishPeer(int32_t stream_id, int player_id, int frame_id); | 87 void EstablishPeer(int32_t stream_id, int player_id, int frame_id); |
| 88 | 88 |
| 89 // Registers the StreamTexture's SurfaceTexure for retrieval and use in the |
| 90 // Browser process, using the provided |surface_texture_id| |
| 91 void RegisterStreamTexture(int32_t stream_id, int surface_texture_id); |
| 92 |
| 89 // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the | 93 // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the |
| 90 // client-side id of the gpu::StreamTexture. The texture is produced into | 94 // client-side id of the gpu::StreamTexture. The texture is produced into |
| 91 // a mailbox so it can be shipped in a VideoFrame. | 95 // a mailbox so it can be shipped in a VideoFrame. |
| 92 unsigned CreateStreamTexture(unsigned texture_target, | 96 unsigned CreateStreamTexture(unsigned texture_target, |
| 93 unsigned* texture_id, | 97 unsigned* texture_id, |
| 94 gpu::Mailbox* texture_mailbox); | 98 gpu::Mailbox* texture_mailbox); |
| 95 | 99 |
| 96 // Set the streamTexture size for the given stream Id. | 100 // Set the streamTexture size for the given stream Id. |
| 97 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size); | 101 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size); |
| 98 | 102 |
| 99 gpu::gles2::GLES2Interface* ContextGL(); | 103 gpu::gles2::GLES2Interface* ContextGL(); |
| 100 | 104 |
| 101 private: | 105 private: |
| 102 friend class base::RefCounted<StreamTextureFactory>; | 106 friend class base::RefCounted<StreamTextureFactory>; |
| 103 StreamTextureFactory( | 107 StreamTextureFactory( |
| 104 scoped_refptr<ContextProviderCommandBuffer> context_provider); | 108 scoped_refptr<ContextProviderCommandBuffer> context_provider); |
| 105 ~StreamTextureFactory(); | 109 ~StreamTextureFactory(); |
| 106 | 110 |
| 107 scoped_refptr<ContextProviderCommandBuffer> context_provider_; | 111 scoped_refptr<ContextProviderCommandBuffer> context_provider_; |
| 108 scoped_refptr<gpu::GpuChannelHost> channel_; | 112 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 109 | 113 |
| 110 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); | 114 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace content | 117 } // namespace content |
| 114 | 118 |
| 115 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ | 119 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ |
| OLD | NEW |