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