Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Side by Side Diff: webkit/renderer/media/android/stream_texture_factory_android.h

Issue 17502007: Move webkit/renderer/media/android/ to content/renderer/media/android/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shared lib Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_
6 #define WEBKIT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/layers/video_frame_provider.h"
10
11 namespace webkit_media {
12
13 // The proxy class for the gpu thread to notify the compositor thread
14 // when a new video frame is available.
15 class StreamTextureProxy {
16 public:
17 // Initialize and bind to the current thread, which becomes the thread that
18 // a connected client will receive callbacks on.
19 virtual void BindToCurrentThread(int stream_id, int width, int height) = 0;
20
21 virtual bool IsBoundToThread() = 0;
22
23 // Setting the target for callback when a frame is available. This function
24 // could be called on both the main thread and the compositor thread.
25 virtual void SetClient(cc::VideoFrameProvider::Client* client) = 0;
26
27 struct Deleter {
28 inline void operator()(StreamTextureProxy* ptr) const { ptr->Release(); }
29 };
30
31 protected:
32 virtual ~StreamTextureProxy() {}
33
34 // Causes this instance to be deleted on the thread it is bound to.
35 virtual void Release() = 0;
36 };
37
38 typedef scoped_ptr<StreamTextureProxy, StreamTextureProxy::Deleter>
39 ScopedStreamTextureProxy;
40
41 // Factory class for managing the stream texture.
42 class StreamTextureFactory {
43 public:
44 virtual ~StreamTextureFactory() {}
45
46 // Create the StreamTextureProxy object.
47 virtual StreamTextureProxy* CreateProxy() = 0;
48
49 // 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 // it will be passed back to the WebMediaPlayerAndroid object identified by
52 // the player_id.
53 virtual void EstablishPeer(int stream_id, int player_id) = 0;
54
55 // Create the streamTexture and return the stream Id and set the texture id.
56 virtual unsigned CreateStreamTexture(unsigned* texture_id) = 0;
57
58 // Destroy the streamTexture for the given texture Id.
59 virtual void DestroyStreamTexture(unsigned texture_id) = 0;
60 };
61
62 } // namespace webkit_media
63
64 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_H_
OLDNEW
« no previous file with comments | « webkit/renderer/media/android/proxy_media_keys.cc ('k') | webkit/renderer/media/android/webmediaplayer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698