Chromium Code Reviews| Index: content/common/gpu/client/gpu_video_encode_accelerator_host.cc |
| diff --git a/content/common/gpu/client/gpu_video_encode_accelerator_host.cc b/content/common/gpu/client/gpu_video_encode_accelerator_host.cc |
| index c33e27078120b70cf04c53cc6d311716062075cd..fbdee71dcaafab8ede86144b515405a57b928a1e 100644 |
| --- a/content/common/gpu/client/gpu_video_encode_accelerator_host.cc |
| +++ b/content/common/gpu/client/gpu_video_encode_accelerator_host.cc |
| @@ -74,7 +74,25 @@ GpuVideoEncodeAcceleratorHost::GetSupportedProfiles() { |
| DCHECK(CalledOnValidThread()); |
| if (!channel_) |
| return std::vector<media::VideoEncodeAccelerator::SupportedProfile>(); |
| - return channel_->gpu_info().video_encode_accelerator_supported_profiles; |
| + return ConvertGpuToMediaProfiles( |
| + channel_->gpu_info().video_encode_accelerator_supported_profiles); |
| +} |
| + |
| +std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
| +GpuVideoEncodeAcceleratorHost::ConvertGpuToMediaProfiles(const std::vector< |
| + gpu::VideoEncodeAcceleratorSupportedProfile>& gpu_profiles) { |
| + std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; |
| + for (size_t i = 0; i < gpu_profiles.size(); i++) { |
| + media::VideoEncodeAccelerator::SupportedProfile profile; |
| + profile.profile = |
| + static_cast<media::VideoCodecProfile>(gpu_profiles[i].profile); |
|
piman
2014/10/22 20:46:31
Can you add a list of static_asserts that check th
|
| + profile.max_resolution = gpu_profiles[i].max_resolution; |
| + profile.max_framerate_numerator = gpu_profiles[i].max_framerate_numerator; |
| + profile.max_framerate_denominator = |
| + gpu_profiles[i].max_framerate_denominator; |
| + profiles.push_back(profile); |
| + } |
| + return profiles; |
| } |
| bool GpuVideoEncodeAcceleratorHost::Initialize( |