| 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/crypto/aes_decryptor.h" |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 8 | 10 |
| 9 namespace webkit_media { | 11 namespace webkit_media { |
| 10 | 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | 15 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
| 14 | 16 |
| 15 struct MediaFormatAndKeySystem { | 17 struct MediaFormatAndKeySystem { |
| 16 const char* mime_type; | 18 const char* mime_type; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 70 |
| 69 for (size_t i = 0; i < codecs.size(); ++i) { | 71 for (size_t i = 0; i < codecs.size(); ++i) { |
| 70 if (!IsSupportedKeySystemWithContainerAndCodec( | 72 if (!IsSupportedKeySystemWithContainerAndCodec( |
| 71 mime_type, codecs[i], key_system)) | 73 mime_type, codecs[i], key_system)) |
| 72 return false; | 74 return false; |
| 73 } | 75 } |
| 74 | 76 |
| 75 return true; | 77 return true; |
| 76 } | 78 } |
| 77 | 79 |
| 80 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system, |
| 81 media::DecryptorClient* client) { |
| 82 if (key_system == kClearKeyKeySystem) |
| 83 return scoped_ptr<media::Decryptor>(new media::AesDecryptor(client)); |
| 84 return scoped_ptr<media::Decryptor>(); |
| 85 } |
| 86 |
| 78 } // namespace webkit_media | 87 } // namespace webkit_media |
| OLD | NEW |