Chromium Code Reviews| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 media::MediaOzonePlatform* platform = | 488 media::MediaOzonePlatform* platform = |
| 488 media::MediaOzonePlatform::GetInstance(); | 489 media::MediaOzonePlatform::GetInstance(); |
| 489 return make_scoped_ptr<media::VideoDecodeAccelerator>( | 490 return make_scoped_ptr<media::VideoDecodeAccelerator>( |
| 490 platform->CreateVideoDecodeAccelerator(make_context_current_)); | 491 platform->CreateVideoDecodeAccelerator(make_context_current_)); |
| 491 } | 492 } |
| 492 #endif | 493 #endif |
| 493 | 494 |
| 494 #if defined(OS_ANDROID) | 495 #if defined(OS_ANDROID) |
| 495 scoped_ptr<media::VideoDecodeAccelerator> | 496 scoped_ptr<media::VideoDecodeAccelerator> |
| 496 GpuVideoDecodeAccelerator::CreateAndroidVDA() { | 497 GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
| 498 const gpu::GpuPreferences& gpu_preferences = | |
|
DaleCurtis
2016/03/21 16:15:55
Does this need to be passed in here or is this som
william.xie
2016/03/22 01:09:24
Done.
| |
| 499 stub_->channel()->gpu_channel_manager()->gpu_preferences(); | |
| 497 return make_scoped_ptr<media::VideoDecodeAccelerator>( | 500 return make_scoped_ptr<media::VideoDecodeAccelerator>( |
| 498 new AndroidVideoDecodeAccelerator(stub_->decoder()->AsWeakPtr(), | 501 new AndroidVideoDecodeAccelerator(stub_->decoder()->AsWeakPtr(), |
| 502 gpu_preferences, | |
| 499 make_context_current_)); | 503 make_context_current_)); |
| 500 } | 504 } |
| 501 #endif | 505 #endif |
| 502 | 506 |
| 503 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { | 507 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { |
| 504 DCHECK(video_decode_accelerator_); | 508 DCHECK(video_decode_accelerator_); |
| 505 video_decode_accelerator_->SetCdm(cdm_id); | 509 video_decode_accelerator_->SetCdm(cdm_id); |
| 506 } | 510 } |
| 507 | 511 |
| 508 void GpuVideoDecodeAccelerator::CallOrPostNotifyError( | 512 void GpuVideoDecodeAccelerator::CallOrPostNotifyError( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 635 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; | 639 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; |
| 636 GLenum target = texture_ref->texture()->target(); | 640 GLenum target = texture_ref->texture()->target(); |
| 637 gpu::gles2::TextureManager* texture_manager = | 641 gpu::gles2::TextureManager* texture_manager = |
| 638 stub_->decoder()->GetContextGroup()->texture_manager(); | 642 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 639 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 643 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 640 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 644 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 641 uncleared_textures_.erase(it); | 645 uncleared_textures_.erase(it); |
| 642 } | 646 } |
| 643 | 647 |
| 644 } // namespace content | 648 } // namespace content |
| OLD | NEW |