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

Unified Diff: content/renderer/media/crypto/proxy_decryptor.cc

Issue 472493003: Convert between |init_data_type| and content type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 years, 4 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 | content/renderer/media/crypto/proxy_media_keys.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/proxy_decryptor.cc
diff --git a/content/renderer/media/crypto/proxy_decryptor.cc b/content/renderer/media/crypto/proxy_decryptor.cc
index 28cd421e85ff099858007c541c025fd594b92bc0..b6b900847063a536f6006dbae723e1863b796574 100644
--- a/content/renderer/media/crypto/proxy_decryptor.cc
+++ b/content/renderer/media/crypto/proxy_decryptor.cc
@@ -128,8 +128,19 @@ bool ProxyDecryptor::GenerateKeyRequest(const std::string& content_type,
media::MediaKeys::SessionType session_type =
persistent ? media::MediaKeys::PERSISTENT_SESSION
: media::MediaKeys::TEMPORARY_SESSION;
- media_keys_->CreateSession(
- content_type, init_data, init_data_length, session_type, promise.Pass());
+
+ // Translate content types.
ddorwin 2014/08/13 21:43:34 nit: "Convert MIME type's used in the prefixed imp
sandersd (OOO until July 31) 2014/08/13 21:50:58 Done.
+ std::string init_data_type;
+ if (content_type == "audio/mp4" || content_type == "video/mp4") {
+ init_data_type = "cenc";
+ } else if (content_type == "audio/webm" || content_type == "video/webm") {
+ init_data_type = "webm";
+ } else {
+ init_data_type = content_type;
ddorwin 2014/08/13 21:43:34 I wonder if we can add NOTREACHED(). If it only co
sandersd (OOO until July 31) 2014/08/13 21:50:58 Well, it's worth a try.
+ }
+
+ media_keys_->CreateSession(init_data_type, init_data, init_data_length,
+ session_type, promise.Pass());
return true;
}
« no previous file with comments | « no previous file | content/renderer/media/crypto/proxy_media_keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698