Commit 6089c736 authored by mcasas's avatar mcasas Committed by Commit bot

MediaRecorder: enable encode acceleration for VP8 in Android

This is a refry of https://crrev.com/2801803002 (as pointed out
in https://crrev.com/2836013006) that enables only VP8
hardware encoding in Android.

Tested via webrtc_media_recorder_browsertest.cc [1]

[1] https://cs.chromium.org/chromium/src/content/browser/webrtc/webrtc_media_recorder_browsertest.cc?q=webrtc+mediarecorder&sq=package:chromium&dr=CSs&l=27

BUG=638664

Review-Url: https://codereview.chromium.org/2852583002
Cr-Commit-Position: refs/heads/master@{#467879}
parent 3b3ae152
......@@ -109,11 +109,6 @@ CodecEnumerator::CodecEnumerator() {
return;
#endif
#if defined(OS_ANDROID)
// See https://crbug.com/653864.
return;
#endif
content::RenderThreadImpl* const render_thread_impl =
content::RenderThreadImpl::current();
if (!render_thread_impl) {
......@@ -132,12 +127,17 @@ CodecEnumerator::CodecEnumerator() {
gpu_factories->GetVideoEncodeAcceleratorSupportedProfiles();
for (const auto& supported_profile : vea_supported_profiles) {
for (auto& codec_id_and_profile : kPreferredCodecIdAndVEAProfiles) {
if (supported_profile.profile >= codec_id_and_profile.min_profile &&
supported_profile.profile <= codec_id_and_profile.max_profile) {
DVLOG(2) << "Accelerated codec found: "
<< media::GetProfileName(supported_profile.profile);
codec_id_to_profile_.insert(std::make_pair(
codec_id_and_profile.codec_id, supported_profile.profile));
const media::VideoCodecProfile codec = supported_profile.profile;
#if defined(OS_ANDROID)
// TODO(mcasas): enable other codecs, https://crbug.com/653864.
if (codec < media::VP8PROFILE_MIN || codec > media::VP8PROFILE_MAX)
continue;
#endif
if (codec >= codec_id_and_profile.min_profile &&
codec <= codec_id_and_profile.max_profile) {
DVLOG(2) << "Accelerated codec found: " << media::GetProfileName(codec);
codec_id_to_profile_.insert(
std::make_pair(codec_id_and_profile.codec_id, codec));
}
}
}
......
......@@ -32,8 +32,13 @@ class VideoFrame;
} // namespace media
namespace video_track_recorder {
#if defined(OS_ANDROID)
const int kVEAEncoderMinResolutionWidth = 176;
const int kVEAEncoderMinResolutionHeight = 144;
#else
const int kVEAEncoderMinResolutionWidth = 640;
const int kVEAEncoderMinResolutionHeight = 480;
#endif
} // namespace video_track_recorder
namespace content {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment