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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 1963903002: Remove VideoDecodeAccelerator::SetCdm() and pass the cdm in Initialize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cdm_id to paramtraits Created 4 years, 7 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 | « no previous file | media/gpu/android_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 41f697368edf6b6401c25b34d2e7c7f560104c7f..3f856c0aa20a75afbaec49c6713e2dd800c4cb48 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -263,7 +263,10 @@ void GpuVideoDecoder::CompleteInitialization(int cdm_id, int surface_id) {
DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
DCHECK(!init_cb_.is_null());
- VideoDecodeAccelerator::Config vda_config(config_);
+ VideoDecodeAccelerator::Config vda_config;
+ vda_config.profile = config_.profile();
+ vda_config.cdm_id = cdm_id;
+ vda_config.is_encrypted = config_.is_encrypted();
vda_config.surface_id = surface_id;
vda_config.is_deferred_initialization_allowed = true;
vda_config.initial_expected_coded_size = config_.coded_size();
@@ -273,25 +276,15 @@ void GpuVideoDecoder::CompleteInitialization(int cdm_id, int surface_id) {
return;
}
- // The VDA is now initialized, but if the stream is encrypted we need to
- // attach the CDM before completing GVD's initialization.
- if (config_.is_encrypted()) {
- // TODO(watk,timav): Pass this in the VDA::Config.
- vda_->SetCdm(cdm_id);
- DCHECK(supports_deferred_initialization_);
- }
-
- // We enable deferred initialization in the config, so if the VDA supports it,
- // then it will be in use. Otherwise, initialization is already complete.
- if (!supports_deferred_initialization_) {
+ // If deferred initialization is not supported, initialization is complete.
+ // Otherwise, a call to NotifyInitializationComplete will follow with the
+ // result of deferred initialization.
+ if (!supports_deferred_initialization_)
base::ResetAndReturn(&init_cb_).Run(true);
- }
-
- // A call to NotifyInitializationComplete will follow with the status.
}
void GpuVideoDecoder::NotifyInitializationComplete(bool success) {
- DVLOG_IF(2, !success) << __FUNCTION__ << ": CDM not attached.";
+ DVLOG_IF(1, !success) << __FUNCTION__ << " Deferred initialization failed.";
DCHECK(!init_cb_.is_null());
base::ResetAndReturn(&init_cb_).Run(success);
« no previous file with comments | « no previous file | media/gpu/android_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698