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 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 5 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
6 | 6 |
7 #include "content/browser/android/media_player_manager_android.h" | 7 #include "content/browser/android/media_player_manager_android.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/common/android/surface_callback.h" | 9 #include "content/common/android/surface_callback.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 JNIEnv* env = base::android::AttachCurrentThread(); | 33 JNIEnv* env = base::android::AttachCurrentThread(); |
34 DCHECK(env); | 34 DCHECK(env); |
35 if (renderer_id) { | 35 if (renderer_id) { |
36 RenderViewHostImpl* host = RenderViewHostImpl::FromID( | 36 RenderViewHostImpl* host = RenderViewHostImpl::FromID( |
37 renderer_id, render_view_id); | 37 renderer_id, render_view_id); |
38 if (host) { | 38 if (host) { |
39 media::MediaPlayerBridge* player = | 39 media::MediaPlayerBridge* player = |
40 host->media_player_manager()->GetPlayer(player_id); | 40 host->media_player_manager()->GetPlayer(player_id); |
41 if (player) { | 41 if (player && |
42 player->SetVideoSurface(j_surface); | 42 player != host->media_player_manager()->GetFullscreenPlayer()) { |
| 43 player->SetVideoSurface(j_surface); |
43 } | 44 } |
44 } | 45 } |
45 } | 46 } |
46 | 47 |
47 ReleaseSurface(j_surface); | 48 ReleaseSurface(j_surface); |
48 env->DeleteGlobalRef(j_surface); | 49 env->DeleteGlobalRef(j_surface); |
49 } | 50 } |
50 | 51 |
51 SurfaceTexturePeerBrowserImpl::SurfaceTexturePeerBrowserImpl( | 52 SurfaceTexturePeerBrowserImpl::SurfaceTexturePeerBrowserImpl( |
52 bool player_in_render_process) | 53 bool player_in_render_process) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 player_id)); | 88 player_id)); |
88 } | 89 } |
89 } | 90 } |
90 | 91 |
91 bool SurfaceTexturePeerBrowserImpl::RegisterBrowserProcessSurfaceTexture( | 92 bool SurfaceTexturePeerBrowserImpl::RegisterBrowserProcessSurfaceTexture( |
92 JNIEnv* env) { | 93 JNIEnv* env) { |
93 return RegisterNativesImpl(env); | 94 return RegisterNativesImpl(env); |
94 } | 95 } |
95 | 96 |
96 } // namespace content | 97 } // namespace content |
OLD | NEW |