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

Unified Diff: media/base/video_decoder_config.cc

Issue 2701203003: media: Prefer decrypting pipeline when CDM is attached (Closed)
Patch Set: comments addressed Created 3 years, 10 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/base/video_decoder_config.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_decoder_config.cc
diff --git a/media/base/video_decoder_config.cc b/media/base/video_decoder_config.cc
index a9dbcd21cf211321a1bb4f34f48086a82ffb351c..6e0c61fa372aa48dfbbcf19434a8bc6907884afc 100644
--- a/media/base/video_decoder_config.cc
+++ b/media/base/video_decoder_config.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/logging.h"
+#include "media/base/media_util.h"
#include "media/base/video_frame.h"
#include "media/base/video_types.h"
@@ -158,4 +159,19 @@ void VideoDecoderConfig::SetExtraData(const std::vector<uint8_t>& extra_data) {
extra_data_ = extra_data;
}
+void VideoDecoderConfig::SetIsEncrypted(bool is_encrypted) {
+ if (!is_encrypted) {
+ DCHECK(encryption_scheme_.is_encrypted()) << "Config is already clear.";
+ encryption_scheme_ = Unencrypted();
+ } else {
+ DCHECK(!encryption_scheme_.is_encrypted())
+ << "Config is already encrypted.";
+ // TODO(xhwang): This is only used to guide decoder selection, so set
+ // a common encryption scheme that should be supported by all decrypting
+ // decoders. We should be able to remove this when we support switching
+ // decoders at run time. See http://crbug.com/695595
+ encryption_scheme_ = AesCtrEncryptionScheme();
+ }
+}
+
} // namespace media
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698