| 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/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 #endif | 176 #endif |
| 177 #if defined(ARCH_CPU_X86_FAMILY) | 177 #if defined(ARCH_CPU_X86_FAMILY) |
| 178 vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles(); | 178 vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles(); |
| 179 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( | 179 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( |
| 180 vda_profiles, &capabilities.supported_profiles); | 180 vda_profiles, &capabilities.supported_profiles); |
| 181 #endif | 181 #endif |
| 182 #elif defined(OS_MACOSX) | 182 #elif defined(OS_MACOSX) |
| 183 capabilities.supported_profiles = | 183 capabilities.supported_profiles = |
| 184 VTVideoDecodeAccelerator::GetSupportedProfiles(); | 184 VTVideoDecodeAccelerator::GetSupportedProfiles(); |
| 185 #elif defined(OS_ANDROID) | 185 #elif defined(OS_ANDROID) |
| 186 capabilities = AndroidVideoDecodeAccelerator::GetCapabilities(); | 186 capabilities = |
| 187 AndroidVideoDecodeAccelerator::GetCapabilities(gpu_preferences); |
| 187 #endif | 188 #endif |
| 188 return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeCapabilities( | 189 return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeCapabilities( |
| 189 capabilities); | 190 capabilities); |
| 190 } | 191 } |
| 191 | 192 |
| 192 bool GpuVideoDecodeAccelerator::OnMessageReceived(const IPC::Message& msg) { | 193 bool GpuVideoDecodeAccelerator::OnMessageReceived(const IPC::Message& msg) { |
| 193 if (!video_decode_accelerator_) | 194 if (!video_decode_accelerator_) |
| 194 return false; | 195 return false; |
| 195 | 196 |
| 196 bool handled = true; | 197 bool handled = true; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; | 636 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; |
| 636 GLenum target = texture_ref->texture()->target(); | 637 GLenum target = texture_ref->texture()->target(); |
| 637 gpu::gles2::TextureManager* texture_manager = | 638 gpu::gles2::TextureManager* texture_manager = |
| 638 stub_->decoder()->GetContextGroup()->texture_manager(); | 639 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 639 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 640 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 640 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 641 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 641 uncleared_textures_.erase(it); | 642 uncleared_textures_.erase(it); |
| 642 } | 643 } |
| 643 | 644 |
| 644 } // namespace content | 645 } // namespace content |
| OLD | NEW |