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 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "media/base/decryptor_client.h" | 14 #include "media/base/decryptor_client.h" |
| 15 #include "media/crypto/aes_decryptor.h" | 15 #include "media/crypto/aes_decryptor.h" |
| 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" | 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" |
| 17 | 17 |
| 18 // Enable this to use the fake decoder for testing. | |
| 19 // #define CLEAR_KEY_CDM_USE_FAKE_DECODER | |
| 20 | |
| 18 namespace media { | 21 namespace media { |
| 19 class DecoderBuffer; | 22 class DecoderBuffer; |
| 20 } | 23 } |
| 21 | 24 |
| 22 namespace webkit_media { | 25 namespace webkit_media { |
| 23 | 26 |
| 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 27 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { | 28 class ClearKeyCdm : public cdm::ContentDecryptionModule { |
| 26 public: | 29 public: |
| 27 explicit ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*); | 30 explicit ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 106 |
| 104 Client client_; | 107 Client client_; |
| 105 media::AesDecryptor decryptor_; | 108 media::AesDecryptor decryptor_; |
| 106 | 109 |
| 107 // Protects the |client_| from being accessed by the |decryptor_| | 110 // Protects the |client_| from being accessed by the |decryptor_| |
| 108 // simultaneously. | 111 // simultaneously. |
| 109 base::Lock client_lock_; | 112 base::Lock client_lock_; |
| 110 | 113 |
| 111 cdm::Allocator* const allocator_; | 114 cdm::Allocator* const allocator_; |
| 112 | 115 |
| 116 #if defined(CLEAR_KEY_CDM_USE_FAKE_DECODER) | |
|
Tom Finegan
2012/10/15 21:35:28
CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
xhwang
2012/10/15 23:05:22
Done.
| |
| 113 cdm::Size video_size_; | 117 cdm::Size video_size_; |
| 118 #endif | |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 } // namespace webkit_media | 121 } // namespace webkit_media |
| 117 | 122 |
| 118 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 123 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |