| 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 "media/gpu/gpu_video_decode_accelerator_factory.h" | 5 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "gpu/command_buffer/service/gpu_preferences.h" | 8 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 9 #include "media/base/media_switches.h" | 9 #include "media/base/media_switches.h" |
| 10 #include "media/gpu/gpu_video_accelerator_util.h" | 10 #include "media/gpu/gpu_video_accelerator_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // static | 59 // static |
| 60 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> | 60 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
| 61 GpuVideoDecodeAcceleratorFactory::CreateWithNoGL() { | 61 GpuVideoDecodeAcceleratorFactory::CreateWithNoGL() { |
| 62 return Create(GetGLContextCallback(), MakeGLContextCurrentCallback(), | 62 return Create(GetGLContextCallback(), MakeGLContextCurrentCallback(), |
| 63 BindGLImageCallback()); | 63 BindGLImageCallback()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // static | 66 // static |
| 67 MEDIA_GPU_EXPORT gpu::VideoDecodeAcceleratorCapabilities | 67 MEDIA_GPU_EXPORT gpu::VideoDecodeAcceleratorCapabilities |
| 68 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities( | 68 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities( |
| 69 const gpu::GpuPreferences& gpu_preferences) { | 69 const gpu::GpuPreferences& gpu_preferences, |
| 70 const gpu::GpuDriverBugWorkarounds& workarounds) { |
| 70 VideoDecodeAccelerator::Capabilities capabilities; | 71 VideoDecodeAccelerator::Capabilities capabilities; |
| 71 if (gpu_preferences.disable_accelerated_video_decode) | 72 if (gpu_preferences.disable_accelerated_video_decode) |
| 72 return gpu::VideoDecodeAcceleratorCapabilities(); | 73 return gpu::VideoDecodeAcceleratorCapabilities(); |
| 73 | 74 |
| 74 // Query VDAs for their capabilities and construct a set of supported | 75 // Query VDAs for their capabilities and construct a set of supported |
| 75 // profiles for current platform. This must be done in the same order as in | 76 // profiles for current platform. This must be done in the same order as in |
| 76 // CreateVDA(), as we currently preserve additional capabilities (such as | 77 // CreateVDA(), as we currently preserve additional capabilities (such as |
| 77 // resolutions supported) only for the first VDA supporting the given codec | 78 // resolutions supported) only for the first VDA supporting the given codec |
| 78 // profile (instead of calculating a superset). | 79 // profile (instead of calculating a superset). |
| 79 // TODO(posciak,henryhsu): improve this so that we choose a superset of | 80 // TODO(posciak,henryhsu): improve this so that we choose a superset of |
| 80 // resolutions and other supported profile parameters. | 81 // resolutions and other supported profile parameters. |
| 81 #if defined(OS_WIN) | 82 #if defined(OS_WIN) |
| 82 capabilities.supported_profiles = | 83 capabilities.supported_profiles = |
| 83 DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences); | 84 DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences, |
| 85 workarounds); |
| 84 #elif defined(OS_CHROMEOS) | 86 #elif defined(OS_CHROMEOS) |
| 85 VideoDecodeAccelerator::SupportedProfiles vda_profiles; | 87 VideoDecodeAccelerator::SupportedProfiles vda_profiles; |
| 86 #if defined(USE_V4L2_CODEC) | 88 #if defined(USE_V4L2_CODEC) |
| 87 vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); | 89 vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); |
| 88 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( | 90 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( |
| 89 vda_profiles, &capabilities.supported_profiles); | 91 vda_profiles, &capabilities.supported_profiles); |
| 90 vda_profiles = V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles(); | 92 vda_profiles = V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles(); |
| 91 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( | 93 GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( |
| 92 vda_profiles, &capabilities.supported_profiles); | 94 vda_profiles, &capabilities.supported_profiles); |
| 93 #endif | 95 #endif |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 const BindGLImageCallback& bind_image_cb, | 261 const BindGLImageCallback& bind_image_cb, |
| 260 const GetGLES2DecoderCallback& get_gles2_decoder_cb) | 262 const GetGLES2DecoderCallback& get_gles2_decoder_cb) |
| 261 : get_gl_context_cb_(get_gl_context_cb), | 263 : get_gl_context_cb_(get_gl_context_cb), |
| 262 make_context_current_cb_(make_context_current_cb), | 264 make_context_current_cb_(make_context_current_cb), |
| 263 bind_image_cb_(bind_image_cb), | 265 bind_image_cb_(bind_image_cb), |
| 264 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} | 266 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} |
| 265 | 267 |
| 266 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} | 268 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} |
| 267 | 269 |
| 268 } // namespace media | 270 } // namespace media |
| OLD | NEW |