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

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 1820553002: Expose encrypted_only attribute on VDA supported profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment. 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/common/gpu/media/android_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 9eccdc65e0440ab49d2bdcb479e2e670382960ea..5e719f94f3ab07f039087975375c4b5e37302e54 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -317,15 +317,10 @@ bool AndroidVideoDecodeAccelerator::Initialize(const Config& config,
// Only use MediaCodec for VP8/9 if it's likely backed by hardware
// or if the stream is encrypted.
- if ((codec_ == media::kCodecVP8 || codec_ == media::kCodecVP9) &&
- !is_encrypted_) {
- if (media::VideoCodecBridge::IsKnownUnaccelerated(
- codec_, media::MEDIA_CODEC_DECODER)) {
- DVLOG(1) << "Initialization failed: "
- << (codec_ == media::kCodecVP8 ? "vp8" : "vp9")
- << " is not hardware accelerated";
- return false;
- }
+ if (codec_ == media::kCodecVP8 || codec_ == media::kCodecVP9) {
+ DCHECK(is_encrypted_ ||
+ !media::VideoCodecBridge::IsKnownUnaccelerated(
+ codec_, media::MEDIA_CODEC_DECODER));
}
if (!make_context_current_.Run()) {
@@ -1175,6 +1170,13 @@ AndroidVideoDecodeAccelerator::GetCapabilities() {
profile.profile = media::VP8PROFILE_ANY;
profile.min_resolution.SetSize(0, 0);
profile.max_resolution.SetSize(1920, 1088);
+ // If we know MediaCodec will just create a software codec, prefer our
+ // internal software decoder instead. It's more up to date and secured
+ // within the renderer sandbox. However if the content is encrypted, we
+ // must use MediaCodec anyways since MediaDrm offers no way to decrypt
+ // the buffers and let us use our internal software decoders.
+ profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated(
+ media::kCodecVP8, media::MEDIA_CODEC_DECODER);
profiles.push_back(profile);
}
@@ -1182,6 +1184,13 @@ AndroidVideoDecodeAccelerator::GetCapabilities() {
profile.profile = media::VP9PROFILE_ANY;
profile.min_resolution.SetSize(0, 0);
profile.max_resolution.SetSize(1920, 1088);
+ // If we know MediaCodec will just create a software codec, prefer our
+ // internal software decoder instead. It's more up to date and secured
+ // within the renderer sandbox. However if the content is encrypted, we
+ // must use MediaCodec anyways since MediaDrm offers no way to decrypt
+ // the buffers and let us use our internal software decoders.
+ profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated(
+ media::kCodecVP9, media::MEDIA_CODEC_DECODER);
profiles.push_back(profile);
}
« no previous file with comments | « content/common/gpu/gpu_param_traits_macros.h ('k') | content/common/gpu/media/gpu_video_accelerator_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698