OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "media/gpu/content_video_view_overlay.h" | 5 #include "media/gpu/content_video_view_overlay.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "gpu/ipc/common/gpu_surface_lookup.h" | 10 #include "gpu/ipc/common/gpu_surface_lookup.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 weak_factory_.GetWeakPtr(), true)); | 21 weak_factory_.GetWeakPtr(), true)); |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 ContentVideoViewOverlay::~ContentVideoViewOverlay() { | 25 ContentVideoViewOverlay::~ContentVideoViewOverlay() { |
26 // Deallocate the surface. It's okay if we don't own it. | 26 // Deallocate the surface. It's okay if we don't own it. |
27 // Note that this only happens once any codec is done with us. | 27 // Note that this only happens once any codec is done with us. |
28 ContentVideoViewOverlayAllocator::GetInstance()->DeallocateSurface(this); | 28 ContentVideoViewOverlayAllocator::GetInstance()->DeallocateSurface(this); |
29 } | 29 } |
30 | 30 |
31 void ContentVideoViewOverlay::ScheduleLayout(const gfx::Rect& rect) { | 31 void ContentVideoViewOverlay::ScheduleLayout(const gfx::Rect& rect) {} |
32 NOTIMPLEMENTED(); | |
33 } | |
34 | 32 |
35 const base::android::JavaRef<jobject>& ContentVideoViewOverlay::GetJavaSurface() | 33 const base::android::JavaRef<jobject>& ContentVideoViewOverlay::GetJavaSurface() |
36 const { | 34 const { |
37 return surface_.j_surface(); | 35 return surface_.j_surface(); |
38 } | 36 } |
39 | 37 |
40 void ContentVideoViewOverlay::OnSurfaceAvailable(bool success) { | 38 void ContentVideoViewOverlay::OnSurfaceAvailable(bool success) { |
41 if (!success) { | 39 if (!success) { |
42 // Notify that the surface won't be available. | 40 // Notify that the surface won't be available. |
43 config_.is_failed(this); | 41 config_.is_failed(this); |
(...skipping 18 matching lines...) Expand all Loading... |
62 void ContentVideoViewOverlay::OnSurfaceDestroyed() { | 60 void ContentVideoViewOverlay::OnSurfaceDestroyed() { |
63 RunSurfaceDestroyedCallbacks(); | 61 RunSurfaceDestroyedCallbacks(); |
64 // |this| may be deleted, or deletion might be posted elsewhere. | 62 // |this| may be deleted, or deletion might be posted elsewhere. |
65 } | 63 } |
66 | 64 |
67 int32_t ContentVideoViewOverlay::GetSurfaceId() { | 65 int32_t ContentVideoViewOverlay::GetSurfaceId() { |
68 return surface_id_; | 66 return surface_id_; |
69 } | 67 } |
70 | 68 |
71 } // namespace media | 69 } // namespace media |
OLD | NEW |