OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/layers/video_frame_provider.h" | 9 #include "cc/layers/video_frame_provider.h" |
10 #include "content/renderer/gpu/stream_texture_host_android.h" | 10 #include "content/renderer/gpu/stream_texture_host_android.h" |
| 11 #include "gpu/command_buffer/common/mailbox.h" |
11 | 12 |
12 namespace WebKit { | 13 namespace WebKit { |
13 class WebGraphicsContext3D; | 14 class WebGraphicsContext3D; |
14 } | 15 } |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 // The proxy class for the gpu thread to notify the compositor thread | 19 // The proxy class for the gpu thread to notify the compositor thread |
19 // when a new video frame is available. | 20 // when a new video frame is available. |
20 class StreamTextureProxy : public StreamTextureHost::Listener { | 21 class StreamTextureProxy : public StreamTextureHost::Listener { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 67 |
67 // Create the StreamTextureProxy object. | 68 // Create the StreamTextureProxy object. |
68 StreamTextureProxy* CreateProxy(); | 69 StreamTextureProxy* CreateProxy(); |
69 | 70 |
70 // Send an IPC message to the browser process to request a java surface | 71 // Send an IPC message to the browser process to request a java surface |
71 // object for the given stream_id. After the the surface is created, | 72 // object for the given stream_id. After the the surface is created, |
72 // it will be passed back to the WebMediaPlayerAndroid object identified by | 73 // it will be passed back to the WebMediaPlayerAndroid object identified by |
73 // the player_id. | 74 // the player_id. |
74 void EstablishPeer(int stream_id, int player_id); | 75 void EstablishPeer(int stream_id, int player_id); |
75 | 76 |
76 // Create the streamTexture and return the stream Id and set the texture id. | 77 // Create the streamTexture and return the stream Id and create a client-side |
77 unsigned CreateStreamTexture(unsigned* texture_id); | 78 // texture id to refer to the streamTexture. The texture id is produced into |
| 79 // a mailbox so it can be used to ship in a VideoFrame, with a sync point for |
| 80 // when the mailbox can be accessed. |
| 81 unsigned CreateStreamTexture( |
| 82 unsigned texture_target, |
| 83 unsigned* texture_id, |
| 84 gpu::Mailbox* texture_mailbox, |
| 85 unsigned* texture_mailbox_sync_point); |
78 | 86 |
79 // Destroy the streamTexture for the given texture Id. | 87 // Destroy the streamTexture for the given texture id, as well as the |
| 88 // client side texture. |
80 void DestroyStreamTexture(unsigned texture_id); | 89 void DestroyStreamTexture(unsigned texture_id); |
81 | 90 |
82 private: | 91 private: |
83 WebKit::WebGraphicsContext3D* context_; | 92 WebKit::WebGraphicsContext3D* context_; |
84 scoped_refptr<GpuChannelHost> channel_; | 93 scoped_refptr<GpuChannelHost> channel_; |
85 int view_id_; | 94 int view_id_; |
86 | 95 |
87 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); | 96 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); |
88 }; | 97 }; |
89 | 98 |
90 } // namespace content | 99 } // namespace content |
91 | 100 |
92 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ | 101 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
OLD | NEW |