Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/media/key_systems.h" | 5 #include "webkit/media/crypto/key_systems.h" |
| 6 | 6 |
| 7 #include "media/base/decryptor.h" | |
| 8 #include "media/base/decryptor_client.h" | |
|
ddorwin
2012/06/28 22:15:38
Is this one necessary?
xhwang
2012/06/28 23:31:42
Removed.
| |
| 9 #include "media/crypto/aes_decryptor.h" | |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 8 | 11 |
| 9 namespace webkit_media { | 12 namespace webkit_media { |
| 10 | 13 |
| 11 namespace { | 14 namespace { |
| 12 | 15 |
| 13 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | 16 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
| 14 | 17 |
| 15 struct MediaFormatAndKeySystem { | 18 struct MediaFormatAndKeySystem { |
| 16 const char* mime_type; | 19 const char* mime_type; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 71 |
| 69 for (size_t i = 0; i < codecs.size(); ++i) { | 72 for (size_t i = 0; i < codecs.size(); ++i) { |
| 70 if (!IsSupportedKeySystemWithContainerAndCodec( | 73 if (!IsSupportedKeySystemWithContainerAndCodec( |
| 71 mime_type, codecs[i], key_system)) | 74 mime_type, codecs[i], key_system)) |
| 72 return false; | 75 return false; |
| 73 } | 76 } |
| 74 | 77 |
| 75 return true; | 78 return true; |
| 76 } | 79 } |
| 77 | 80 |
| 81 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system, | |
| 82 media::DecryptorClient* client) { | |
| 83 if (key_system == kClearKeyKeySystem) | |
| 84 return scoped_ptr<media::Decryptor>(new media::AesDecryptor(client)); | |
| 85 return scoped_ptr<media::Decryptor>(); | |
| 86 } | |
| 87 | |
| 78 } // namespace webkit_media | 88 } // namespace webkit_media |
| OLD | NEW |