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

Unified Diff: media/base/audio_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/audio_decoder_config.h ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_decoder_config.cc
diff --git a/media/base/audio_decoder_config.cc b/media/base/audio_decoder_config.cc
index 253c82b147c96b0304ce49d83ec7c4334bb78fdb..225f19a7f796c34c42c31e2dfcf78dd11f8181d5 100644
--- a/media/base/audio_decoder_config.cc
+++ b/media/base/audio_decoder_config.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "media/base/limits.h"
+#include "media/base/media_util.h"
namespace media {
@@ -95,4 +96,19 @@ std::string AudioDecoderConfig::AsHumanReadableString() const {
return s.str();
}
+void AudioDecoderConfig::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/audio_decoder_config.h ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698