| 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/memory/scoped_ptr.h" |
| 13 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 14 #include "media/base/decryptor_client.h" | 15 #include "media/base/decryptor_client.h" |
| 15 #include "media/crypto/aes_decryptor.h" | 16 #include "media/crypto/aes_decryptor.h" |
| 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" | 17 #include "webkit/media/crypto/ppapi/content_decryption_module.h" |
| 17 | 18 |
| 18 namespace media { | 19 namespace media { |
| 19 class DecoderBuffer; | 20 class DecoderBuffer; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace webkit_media { | 23 namespace webkit_media { |
| 23 | 24 |
| 25 class FFmpegCdmVideoDecoder; |
| 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*); |
| 28 virtual ~ClearKeyCdm(); | 31 virtual ~ClearKeyCdm(); |
| 29 | 32 |
| 30 // ContentDecryptionModule implementation. | 33 // ContentDecryptionModule implementation. |
| 31 virtual cdm::Status GenerateKeyRequest( | 34 virtual cdm::Status GenerateKeyRequest( |
| 32 const uint8_t* init_data, | 35 const uint8_t* init_data, |
| 33 int init_data_size, | 36 int init_data_size, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 Client client_; | 104 Client client_; |
| 102 media::AesDecryptor decryptor_; | 105 media::AesDecryptor decryptor_; |
| 103 | 106 |
| 104 // Protects the |client_| from being accessed by the |decryptor_| | 107 // Protects the |client_| from being accessed by the |decryptor_| |
| 105 // simultaneously. | 108 // simultaneously. |
| 106 base::Lock client_lock_; | 109 base::Lock client_lock_; |
| 107 | 110 |
| 108 cdm::Allocator* const allocator_; | 111 cdm::Allocator* const allocator_; |
| 112 scoped_ptr<FFmpegCdmVideoDecoder> video_decoder_; |
| 109 }; | 113 }; |
| 110 | 114 |
| 111 } // namespace webkit_media | 115 } // namespace webkit_media |
| 112 | 116 |
| 113 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 117 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |