Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(732)

Unified Diff: content/renderer/pepper/video_encoder_shim.cc

Issue 1769593002: Add 4 VP9 profiles to the media::VideoCodecProfile enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hevc-codec-7
Patch Set: Removed the change in ppapi_cdm_adapter.cc Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3dc35b52d83c22cd8a170030be48dd092aeb1f09 100644
--- a/content/renderer/pepper/video_encoder_shim.cc
+++ b/content/renderer/pepper/video_encoder_shim.cc
@@ -74,7 +74,12 @@ void GetVpxCodecParameters(media::VideoCodecProfile codec,
*max_quantizer = kVp8DefaultMaxQuantizer;
*cpu_used = kVp8DefaultCpuUsed;
break;
- case media::VP9PROFILE_ANY:
+ case media::VP9PROFILE_PROFILE0:
+ case media::VP9PROFILE_PROFILE1:
bbudge 2016/03/31 17:24:44 profiles 1-3 shouldn't be possible here, since the
servolk 2016/03/31 17:42:04 Done.
+ case media::VP9PROFILE_PROFILE2:
+ case media::VP9PROFILE_PROFILE3:
+ // TODO(servolk): These numbers should be adjusted for different profiles.
+ // crbug.com/598107
*vpx_codec = vpx_codec_vp9_cx();
*min_quantizer = kVp9DefaultMinQuantizer;
*max_quantizer = kVp9DefaultMaxQuantizer;
@@ -196,7 +201,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 ||
bbudge 2016/03/31 17:24:44 ditto.
servolk 2016/03/31 17:42:04 Done.
+ 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 +231,10 @@ void VideoEncoderShim::EncoderImpl::Initialize(
return;
}
- if (output_profile == media::VP9PROFILE_ANY) {
+ if (output_profile == media::VP9PROFILE_PROFILE0 ||
+ output_profile == media::VP9PROFILE_PROFILE1 ||
bbudge 2016/03/31 17:24:44 ditto
servolk 2016/03/31 17:42:04 Done.
+ 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 +400,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;
bbudge 2016/03/31 17:24:44 It's confusing to the client to return multiple vp
servolk 2016/03/31 17:42:04 Done.
+ profiles.push_back(profile);
+ profile.profile = media::VP9PROFILE_PROFILE2;
+ profiles.push_back(profile);
+ profile.profile = media::VP9PROFILE_PROFILE3;
profiles.push_back(profile);
}
@@ -412,7 +429,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(

Powered by Google App Engine
This is Rietveld 408576698