| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media/android/browser_surface_view_manager.h" | 5 #include "content/browser/media/android/browser_surface_view_manager.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "content/browser/android/content_view_core_impl.h" | 9 #include "content/browser/android/content_view_core_impl.h" |
| 10 #include "content/browser/gpu/gpu_process_host.h" | 10 #include "content/browser/gpu/gpu_process_host.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 gpu::GpuSurfaceTracker::Get()->UnregisterViewSurface(surface_id_); | 44 gpu::GpuSurfaceTracker::Get()->UnregisterViewSurface(surface_id_); |
| 45 SendDestroyingVideoSurface(surface_id_); | 45 SendDestroyingVideoSurface(surface_id_); |
| 46 surface_id_ = media::SurfaceManager::kNoSurfaceID; | 46 surface_id_ = media::SurfaceManager::kNoSurfaceID; |
| 47 } else { | 47 } else { |
| 48 // We just use the surface tracker to allocate a surface id for us. The | 48 // We just use the surface tracker to allocate a surface id for us. The |
| 49 // lookup will go through the Android specific path and get the java | 49 // lookup will go through the Android specific path and get the java |
| 50 // surface directly, so there's no need to add a valid native widget here. | 50 // surface directly, so there's no need to add a valid native widget here. |
| 51 surface_id_ = gpu::GpuSurfaceTracker::Get()->AddSurfaceForNativeWidget( | 51 surface_id_ = gpu::GpuSurfaceTracker::Get()->AddSurfaceForNativeWidget( |
| 52 gfx::kNullAcceleratedWidget); | 52 gfx::kNullAcceleratedWidget); |
| 53 gpu::GpuSurfaceTracker::GetInstance()->RegisterViewSurface( | 53 gpu::GpuSurfaceTracker::GetInstance()->RegisterViewSurface( |
| 54 surface_id_, surface.j_surface()); | 54 surface_id_, surface.j_surface().obj()); |
| 55 SendSurfaceID(surface_id_); | 55 SendSurfaceID(surface_id_); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 void BrowserSurfaceViewManager::DidExitFullscreen(bool release_media_player) { | 59 void BrowserSurfaceViewManager::DidExitFullscreen(bool release_media_player) { |
| 60 DVLOG(3) << __func__; | 60 DVLOG(3) << __func__; |
| 61 content_video_view_.reset(); | 61 content_video_view_.reset(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void BrowserSurfaceViewManager::OnCreateFullscreenSurface( | 64 void BrowserSurfaceViewManager::OnCreateFullscreenSurface( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 BrowserThread::IO, FROM_HERE, | 112 BrowserThread::IO, FROM_HERE, |
| 113 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id, | 113 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id, |
| 114 base::Bind(&base::WaitableEvent::Signal, | 114 base::Bind(&base::WaitableEvent::Signal, |
| 115 base::Unretained(&waiter))))) { | 115 base::Unretained(&waiter))))) { |
| 116 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 116 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
| 117 waiter.Wait(); | 117 waiter.Wait(); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace content | 121 } // namespace content |
| OLD | NEW |