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 |