Chromium Code Reviews| Index: content/renderer/pepper/video_encoder_shim.cc |
| diff --git a/content/renderer/pepper/video_encoder_shim.cc b/content/renderer/pepper/video_encoder_shim.cc |
| index 2684c89166ba82b80bd4de15d7e6dc222f074f81..23c82b3a276130de4b943cd382432d14900d7570 100644 |
| --- a/content/renderer/pepper/video_encoder_shim.cc |
| +++ b/content/renderer/pepper/video_encoder_shim.cc |
| @@ -74,7 +74,11 @@ void GetVpxCodecParameters(media::VideoCodecProfile codec, |
| *max_quantizer = kVp8DefaultMaxQuantizer; |
| *cpu_used = kVp8DefaultCpuUsed; |
| break; |
| - case media::VP9PROFILE_ANY: |
| + case media::VP9PROFILE_PROFILE0: |
| + case media::VP9PROFILE_PROFILE1: |
| + case media::VP9PROFILE_PROFILE2: |
| + case media::VP9PROFILE_PROFILE3: |
| + // TODO(servolk): These numbers should be adjusted for different profiles. |
|
ddorwin
2016/03/25 22:51:21
Bug?
servolk
2016/03/25 23:52:01
Done.
|
| *vpx_codec = vpx_codec_vp9_cx(); |
| *min_quantizer = kVp9DefaultMinQuantizer; |
| *max_quantizer = kVp9DefaultMaxQuantizer; |
| @@ -196,7 +200,10 @@ void VideoEncoderShim::EncoderImpl::Initialize( |
| // Use Q/CQ mode if no target bitrate is given. Note that in the VP8/CQ case |
| // the meaning of rc_target_bitrate changes to target maximum rate. |
| if (initial_bitrate == 0) { |
| - if (output_profile == media::VP9PROFILE_ANY) { |
| + if (output_profile == media::VP9PROFILE_PROFILE0 || |
| + output_profile == media::VP9PROFILE_PROFILE1 || |
| + output_profile == media::VP9PROFILE_PROFILE2 || |
| + output_profile == media::VP9PROFILE_PROFILE3) { |
| config_.rc_end_usage = VPX_Q; |
| } else if (output_profile == media::VP8PROFILE_ANY) { |
| config_.rc_end_usage = VPX_CQ; |
| @@ -223,7 +230,10 @@ void VideoEncoderShim::EncoderImpl::Initialize( |
| return; |
| } |
| - if (output_profile == media::VP9PROFILE_ANY) { |
| + if (output_profile == media::VP9PROFILE_PROFILE0 || |
| + output_profile == media::VP9PROFILE_PROFILE1 || |
| + output_profile == media::VP9PROFILE_PROFILE2 || |
| + output_profile == media::VP9PROFILE_PROFILE3) { |
| if (vpx_codec_control(&encoder_, VP9E_SET_AQ_MODE, |
| kVp9AqModeCyclicRefresh) != VPX_CODEC_OK) { |
| NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
| @@ -389,10 +399,16 @@ VideoEncoderShim::GetSupportedProfiles() { |
| ret = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), &config, 0); |
| if (ret == VPX_CODEC_OK) { |
| media::VideoEncodeAccelerator::SupportedProfile profile; |
| - profile.profile = media::VP9PROFILE_ANY; |
| profile.max_resolution = gfx::Size(kMaxWidth, kMaxHeight); |
| profile.max_framerate_numerator = config.g_timebase.den; |
| profile.max_framerate_denominator = config.g_timebase.num; |
| + profile.profile = media::VP9PROFILE_PROFILE0; |
| + profiles.push_back(profile); |
| + profile.profile = media::VP9PROFILE_PROFILE1; |
| + profiles.push_back(profile); |
| + profile.profile = media::VP9PROFILE_PROFILE2; |
| + profiles.push_back(profile); |
| + profile.profile = media::VP9PROFILE_PROFILE3; |
| profiles.push_back(profile); |
| } |
| @@ -412,7 +428,10 @@ bool VideoEncoderShim::Initialize( |
| return false; |
| if (output_profile != media::VP8PROFILE_ANY && |
| - output_profile != media::VP9PROFILE_ANY) |
| + output_profile != media::VP9PROFILE_PROFILE0 && |
| + output_profile != media::VP9PROFILE_PROFILE1 && |
| + output_profile != media::VP9PROFILE_PROFILE2 && |
| + output_profile != media::VP9PROFILE_PROFILE3) |
| return false; |
| media_task_runner_->PostTask( |