OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ | 5 #ifndef WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
6 #define WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ | 6 #define WEBKIT_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 "gpu/command_buffer/common/mailbox.h" |
10 | 11 |
11 namespace webkit_media { | 12 namespace webkit_media { |
12 | 13 |
13 // The proxy class for the gpu thread to notify the compositor thread | 14 // The proxy class for the gpu thread to notify the compositor thread |
14 // when a new video frame is available. | 15 // when a new video frame is available. |
15 class StreamTextureProxy { | 16 class StreamTextureProxy { |
16 public: | 17 public: |
17 // Initialize and bind to the current thread, which becomes the thread that | 18 // Initialize and bind to the current thread, which becomes the thread that |
18 // a connected client will receive callbacks on. | 19 // a connected client will receive callbacks on. |
19 virtual void BindToCurrentThread(int stream_id, int width, int height) = 0; | 20 virtual void BindToCurrentThread(int stream_id, int width, int height) = 0; |
(...skipping 25 matching lines...) Expand all Loading... |
45 | 46 |
46 // Create the StreamTextureProxy object. | 47 // Create the StreamTextureProxy object. |
47 virtual StreamTextureProxy* CreateProxy() = 0; | 48 virtual StreamTextureProxy* CreateProxy() = 0; |
48 | 49 |
49 // Send an IPC message to the browser process to request a java surface | 50 // Send an IPC message to the browser process to request a java surface |
50 // object for the given stream_id. After the the surface is created, | 51 // object for the given stream_id. After the the surface is created, |
51 // it will be passed back to the WebMediaPlayerAndroid object identified by | 52 // it will be passed back to the WebMediaPlayerAndroid object identified by |
52 // the player_id. | 53 // the player_id. |
53 virtual void EstablishPeer(int stream_id, int player_id) = 0; | 54 virtual void EstablishPeer(int stream_id, int player_id) = 0; |
54 | 55 |
55 // Create the streamTexture and return the stream Id and set the texture id. | 56 // Create the streamTexture and return the stream Id and create a client-side |
56 virtual unsigned CreateStreamTexture(unsigned* texture_id) = 0; | 57 // texture id to refer to the streamTexture. The texture id is produced into |
| 58 // a mailbox so it can be used to ship in a VideoFrame, with a sync point for |
| 59 // when the mailbox can be accessed. |
| 60 virtual unsigned CreateStreamTexture( |
| 61 unsigned texture_target, |
| 62 unsigned* texture_id, |
| 63 gpu::Mailbox* texture_mailbox, |
| 64 unsigned* texture_mailbox_sync_point) = 0; |
57 | 65 |
58 // Destroy the streamTexture for the given texture Id. | 66 // Destroy the streamTexture for the given texture id. Also consumes the |
59 virtual void DestroyStreamTexture(unsigned texture_id) = 0; | 67 // mailbox for the client-side texture id and destroys the client side |
| 68 // texture. |
| 69 virtual void DestroyStreamTexture( |
| 70 unsigned texture_target, |
| 71 unsigned texture_id, |
| 72 const gpu::Mailbox& texture_mailbox, |
| 73 unsigned texture_mailbox_sync_point) = 0; |
60 }; | 74 }; |
61 | 75 |
62 } // namespace webkit_media | 76 } // namespace webkit_media |
63 | 77 |
64 #endif // WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ | 78 #endif // WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
OLD | NEW |