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