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 CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ |
6 #define CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/common/android/surface_texture_peer.h" | 10 #include "content/common/android/surface_texture_peer.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // The SurfaceTexturePeer implementation for browser process. | 14 // The SurfaceTexturePeer implementation for browser process. |
15 class SurfaceTexturePeerBrowserImpl : public SurfaceTexturePeer { | 15 class SurfaceTexturePeerBrowserImpl : public SurfaceTexturePeer { |
16 public: | 16 public: |
17 // Construct a SurfaceTexturePeerBrowserImpl object. If | 17 // Construct a SurfaceTexturePeerBrowserImpl object. If |
18 // |player_in_render_process| is true, calling EstablishSurfaceTexturePeer() | 18 // |player_in_render_process| is true, calling EstablishSurfaceTexturePeer() |
19 // will send the java surface texture object to the render process through | 19 // will send the java surface texture object to the render process through |
20 // SandboxedProcessService. Otherwise, it will pass the surface texture | 20 // SandboxedProcessService. Otherwise, it will pass the surface texture |
21 // to the MediaPlayerBridge object in the browser process. | 21 // to the MediaPlayerBridge object in the browser process. |
22 explicit SurfaceTexturePeerBrowserImpl(bool player_in_render_process); | 22 explicit SurfaceTexturePeerBrowserImpl(); |
bulach
2013/03/01 11:38:24
nit: s/explicit//
no sievers
2013/03/01 22:29:12
Done.
| |
23 virtual ~SurfaceTexturePeerBrowserImpl(); | 23 virtual ~SurfaceTexturePeerBrowserImpl(); |
24 | 24 |
25 // SurfaceTexturePeer implementation. | 25 // SurfaceTexturePeer implementation. |
26 virtual void EstablishSurfaceTexturePeer( | 26 virtual void EstablishSurfaceTexturePeer( |
27 base::ProcessHandle render_process_handle, | 27 base::ProcessHandle render_process_handle, |
28 SurfaceTextureTarget type, | 28 SurfaceTextureTarget type, |
29 scoped_refptr<SurfaceTextureBridge> surface_texture_bridge, | 29 scoped_refptr<SurfaceTextureBridge> surface_texture_bridge, |
30 int render_view_id, | 30 int render_view_id, |
31 int player_id) OVERRIDE; | 31 int player_id) OVERRIDE; |
32 | 32 |
33 static bool RegisterBrowserProcessSurfaceTexture(JNIEnv* env); | |
34 | |
35 private: | 33 private: |
36 // Whether the media player is in render process. | |
37 bool player_in_render_process_; | |
38 | |
39 base::android::ScopedJavaGlobalRef<jobject> surface_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerBrowserImpl); | 34 DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerBrowserImpl); |
42 }; | 35 }; |
43 | 36 |
44 } // namespace content | 37 } // namespace content |
45 | 38 |
46 #endif // CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ | 39 #endif // CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_ |
OLD | NEW |