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