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

Unified Diff: media/filters/gpu_video_decoder.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
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/video/video_decode_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 0109dc7dae39901d94d3fb7a493da6aa722941bd..6100bdc09e1b839cd3db14ffd2b7510ed4e134ad 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -168,10 +168,12 @@ void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
VideoDecodeAccelerator::Capabilities capabilities =
factories_->GetVideoDecodeAcceleratorCapabilities();
- if (!IsProfileSupported(capabilities, config.profile(),
- config.coded_size())) {
- DVLOG(1) << "Profile " << config.profile() << " or coded size "
- << config.coded_size().ToString() << " not supported.";
+ if (!IsProfileSupported(capabilities, config.profile(), config.coded_size(),
+ config.is_encrypted())) {
+ DVLOG(1) << "Unsupported profile " << config.profile()
+ << ", unsupported coded size " << config.coded_size().ToString()
+ << ", or accelerator should only be used for encrypted content. "
+ << " is_encrypted: " << (config.is_encrypted() ? "yes." : "no.");
bound_init_cb.Run(false);
return;
}
@@ -708,10 +710,14 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
bool GpuVideoDecoder::IsProfileSupported(
const VideoDecodeAccelerator::Capabilities& capabilities,
VideoCodecProfile profile,
- const gfx::Size& coded_size) {
+ const gfx::Size& coded_size,
+ bool is_encrypted) {
DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
for (const auto& supported_profile : capabilities.supported_profiles) {
if (profile == supported_profile.profile) {
+ if (supported_profile.encrypted_only && !is_encrypted)
+ continue;
+
return IsCodedSizeSupported(coded_size,
supported_profile.min_resolution,
supported_profile.max_resolution);
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/video/video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698