| 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 // Sends an IPC to the GPU process. |
| 90 // Asks the StreamTexture to forward its SurfaceTexture to the |
| 91 // ScopedSurfaceRequestManager, using the gpu::ScopedSurfaceRequestConduit. |
| 92 void ForwardStreamTextureForSurfaceRequest(int32_t stream_id, |
| 93 uint64_t request_token); |
| 94 |
| 89 // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the | 95 // 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 | 96 // client-side id of the gpu::StreamTexture. The texture is produced into |
| 91 // a mailbox so it can be shipped in a VideoFrame. | 97 // a mailbox so it can be shipped in a VideoFrame. |
| 92 unsigned CreateStreamTexture(unsigned texture_target, | 98 unsigned CreateStreamTexture(unsigned texture_target, |
| 93 unsigned* texture_id, | 99 unsigned* texture_id, |
| 94 gpu::Mailbox* texture_mailbox); | 100 gpu::Mailbox* texture_mailbox); |
| 95 | 101 |
| 96 // Set the streamTexture size for the given stream Id. | 102 // Set the streamTexture size for the given stream Id. |
| 97 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size); | 103 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size); |
| 98 | 104 |
| 99 gpu::gles2::GLES2Interface* ContextGL(); | 105 gpu::gles2::GLES2Interface* ContextGL(); |
| 100 | 106 |
| 101 private: | 107 private: |
| 102 friend class base::RefCounted<StreamTextureFactory>; | 108 friend class base::RefCounted<StreamTextureFactory>; |
| 103 StreamTextureFactory( | 109 StreamTextureFactory( |
| 104 scoped_refptr<ContextProviderCommandBuffer> context_provider); | 110 scoped_refptr<ContextProviderCommandBuffer> context_provider); |
| 105 ~StreamTextureFactory(); | 111 ~StreamTextureFactory(); |
| 106 | 112 |
| 107 scoped_refptr<ContextProviderCommandBuffer> context_provider_; | 113 scoped_refptr<ContextProviderCommandBuffer> context_provider_; |
| 108 scoped_refptr<gpu::GpuChannelHost> channel_; | 114 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 109 | 115 |
| 110 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); | 116 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); |
| 111 }; | 117 }; |
| 112 | 118 |
| 113 } // namespace content | 119 } // namespace content |
| 114 | 120 |
| 115 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ | 121 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ |
| OLD | NEW |