OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
| 6 #define WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
| 7 #pragma once |
| 8 |
| 9 namespace WebKit { |
| 10 class WebStreamTextureClient; |
| 11 } |
| 12 |
| 13 namespace webkit_media { |
| 14 |
| 15 // The proxy class for the gpu thread to notify the compositor thread |
| 16 // when a new video frame is available. |
| 17 class StreamTextureProxy { |
| 18 public: |
| 19 virtual ~StreamTextureProxy() {} |
| 20 |
| 21 // Initialize the the stream_id, texture width and height. This should |
| 22 // be called on the compositor thread. |
| 23 virtual bool Initialize(int stream_id, int width, int height) = 0; |
| 24 |
| 25 virtual bool IsInitialized() = 0; |
| 26 |
| 27 // Setting the target for callback when a frame is available. This function |
| 28 // could be called on both the main thread and the compositor thread. |
| 29 virtual void SetClient(WebKit::WebStreamTextureClient* client) = 0; |
| 30 }; |
| 31 |
| 32 |
| 33 // Factory class for managing the stream texture. |
| 34 class StreamTextureFactory { |
| 35 public: |
| 36 virtual ~StreamTextureFactory() {} |
| 37 |
| 38 // Create the StreamTextureProxy object. |
| 39 virtual StreamTextureProxy* CreateProxy() = 0; |
| 40 |
| 41 // Send an IPC message to the browser process to request a java surface |
| 42 // object for the given stream_id. After the the surface is created, |
| 43 // it will be passed back to the WebMediaPlayerAndroid object identified by |
| 44 // the player_id. |
| 45 virtual void EstablishPeer(int stream_id, int player_id) = 0; |
| 46 |
| 47 // Create the streamTexture and return the stream Id and set the texture id. |
| 48 virtual unsigned CreateStreamTexture(unsigned* texture_id) = 0; |
| 49 |
| 50 // Destroy the streamTexture for the given texture Id. |
| 51 virtual void DestroyStreamTexture(unsigned texture_id) = 0; |
| 52 }; |
| 53 |
| 54 } // namespace webkit_media |
| 55 |
| 56 #endif // WEBKIT_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_ |
OLD | NEW |