| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/avda_picture_buffer_manager.h" | 5 #include "media/gpu/avda_picture_buffer_manager.h" |
| 6 | 6 |
| 7 #include <EGL/egl.h> | 7 #include <EGL/egl.h> |
| 8 #include <EGL/eglext.h> | 8 #include <EGL/eglext.h> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 gl::ScopedJavaSurface AVDAPictureBufferManager::Initialize( | 133 gl::ScopedJavaSurface AVDAPictureBufferManager::Initialize( |
| 134 AVDAStateProvider* state_provider, | 134 AVDAStateProvider* state_provider, |
| 135 int surface_view_id) { | 135 int surface_view_id) { |
| 136 state_provider_ = state_provider; | 136 state_provider_ = state_provider; |
| 137 shared_state_ = new AVDASharedState(); | 137 shared_state_ = new AVDASharedState(); |
| 138 | 138 |
| 139 bool using_virtual_context = false; | 139 bool using_virtual_context = false; |
| 140 if (gl::GLContext* context = gl::GLContext::GetCurrent()) { | 140 if (gl::GLContext* context = gl::GLContext::GetCurrent()) { |
| 141 if (gl::GLShareGroup* share_group = context->share_group()) | 141 if (gl::GLShareGroup* share_group = context->share_group()) |
| 142 using_virtual_context = !!share_group->GetSharedContext(); | 142 using_virtual_context = |
| 143 !!share_group->GetSharedContext(gl::GLSurface::GetCurrent()); |
| 143 } | 144 } |
| 144 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.VirtualContext", using_virtual_context); | 145 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.VirtualContext", using_virtual_context); |
| 145 | 146 |
| 146 // Acquire the SurfaceView surface if given a valid id. | 147 // Acquire the SurfaceView surface if given a valid id. |
| 147 if (surface_view_id != VideoDecodeAccelerator::Config::kNoSurfaceID) { | 148 if (surface_view_id != VideoDecodeAccelerator::Config::kNoSurfaceID) { |
| 148 return gpu::GpuSurfaceLookup::GetInstance()->AcquireJavaSurface( | 149 return gpu::GpuSurfaceLookup::GetInstance()->AcquireJavaSurface( |
| 149 surface_view_id); | 150 surface_view_id); |
| 150 } | 151 } |
| 151 | 152 |
| 152 // Otherwise create a SurfaceTexture. | 153 // Otherwise create a SurfaceTexture. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 shared_state_->CodecChanged(codec); | 401 shared_state_->CodecChanged(codec); |
| 401 } | 402 } |
| 402 | 403 |
| 403 bool AVDAPictureBufferManager::ArePicturesOverlayable() { | 404 bool AVDAPictureBufferManager::ArePicturesOverlayable() { |
| 404 // SurfaceView frames are always overlayable because that's the only way to | 405 // SurfaceView frames are always overlayable because that's the only way to |
| 405 // display them. | 406 // display them. |
| 406 return !surface_texture_; | 407 return !surface_texture_; |
| 407 } | 408 } |
| 408 | 409 |
| 409 } // namespace media | 410 } // namespace media |
| OLD | NEW |