OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const uint8* response, | 50 const uint8* response, |
51 uint32 response_size) OVERRIDE; | 51 uint32 response_size) OVERRIDE; |
52 virtual void ReleaseSession(uint32 promise_id, | 52 virtual void ReleaseSession(uint32 promise_id, |
53 const char* web_session_id, | 53 const char* web_session_id, |
54 uint32_t web_session_id_length) OVERRIDE; | 54 uint32_t web_session_id_length) OVERRIDE; |
55 virtual void SetServerCertificate( | 55 virtual void SetServerCertificate( |
56 uint32 promise_id, | 56 uint32 promise_id, |
57 const uint8_t* server_certificate_data, | 57 const uint8_t* server_certificate_data, |
58 uint32_t server_certificate_data_size) OVERRIDE; | 58 uint32_t server_certificate_data_size) OVERRIDE; |
59 virtual void TimerExpired(void* context) OVERRIDE; | 59 virtual void TimerExpired(void* context) OVERRIDE; |
60 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, | 60 virtual cdm::Status Decrypt(const cdm::InputBuffer_1& encrypted_buffer, |
61 cdm::DecryptedBlock* decrypted_block) OVERRIDE; | 61 cdm::DecryptedBlock* decrypted_block) OVERRIDE; |
62 virtual cdm::Status InitializeAudioDecoder( | 62 virtual cdm::Status InitializeAudioDecoder( |
63 const cdm::AudioDecoderConfig& audio_decoder_config) OVERRIDE; | 63 const cdm::AudioDecoderConfig& audio_decoder_config) OVERRIDE; |
64 virtual cdm::Status InitializeVideoDecoder( | 64 virtual cdm::Status InitializeVideoDecoder( |
65 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE; | 65 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE; |
66 virtual void DeinitializeDecoder(cdm::StreamType decoder_type) OVERRIDE; | 66 virtual void DeinitializeDecoder(cdm::StreamType decoder_type) OVERRIDE; |
67 virtual void ResetDecoder(cdm::StreamType decoder_type) OVERRIDE; | 67 virtual void ResetDecoder(cdm::StreamType decoder_type) OVERRIDE; |
68 virtual cdm::Status DecryptAndDecodeFrame( | 68 virtual cdm::Status DecryptAndDecodeFrame( |
69 const cdm::InputBuffer& encrypted_buffer, | 69 const cdm::InputBuffer_1& encrypted_buffer, |
70 cdm::VideoFrame* video_frame) OVERRIDE; | 70 cdm::VideoFrame* video_frame) OVERRIDE; |
71 virtual cdm::Status DecryptAndDecodeSamples( | 71 virtual cdm::Status DecryptAndDecodeSamples( |
72 const cdm::InputBuffer& encrypted_buffer, | 72 const cdm::InputBuffer_1& encrypted_buffer, |
73 cdm::AudioFrames* audio_frames) OVERRIDE; | 73 cdm::AudioFrames* audio_frames) OVERRIDE; |
74 virtual void Destroy() OVERRIDE; | 74 virtual void Destroy() OVERRIDE; |
75 virtual void OnPlatformChallengeResponse( | 75 virtual void OnPlatformChallengeResponse( |
76 const cdm::PlatformChallengeResponse& response) OVERRIDE; | 76 const cdm::PlatformChallengeResponse& response) OVERRIDE; |
77 virtual void OnQueryOutputProtectionStatus( | 77 virtual void OnQueryOutputProtectionStatus( |
78 uint32_t link_mask, uint32_t output_protection_mask) OVERRIDE; | 78 uint32_t link_mask, uint32_t output_protection_mask) OVERRIDE; |
79 | 79 |
80 private: | 80 private: |
81 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This | 81 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This |
82 // is necessary since aes_decryptor.cc does not support storing sessions. | 82 // is necessary since aes_decryptor.cc does not support storing sessions. |
(...skipping 21 matching lines...) Expand all Loading... |
104 | 104 |
105 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. | 105 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. |
106 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is | 106 // Returns cdm::kSuccess if decryption succeeded. The decrypted result is |
107 // put in |decrypted_buffer|. If |encrypted_buffer| is empty, the | 107 // put in |decrypted_buffer|. If |encrypted_buffer| is empty, the |
108 // |decrypted_buffer| is set to an empty (EOS) buffer. | 108 // |decrypted_buffer| is set to an empty (EOS) buffer. |
109 // Returns cdm::kNoKey if no decryption key was available. In this case | 109 // Returns cdm::kNoKey if no decryption key was available. In this case |
110 // |decrypted_buffer| should be ignored by the caller. | 110 // |decrypted_buffer| should be ignored by the caller. |
111 // Returns cdm::kDecryptError if any decryption error occurred. In this case | 111 // Returns cdm::kDecryptError if any decryption error occurred. In this case |
112 // |decrypted_buffer| should be ignored by the caller. | 112 // |decrypted_buffer| should be ignored by the caller. |
113 cdm::Status DecryptToMediaDecoderBuffer( | 113 cdm::Status DecryptToMediaDecoderBuffer( |
114 const cdm::InputBuffer& encrypted_buffer, | 114 const cdm::InputBuffer_1& encrypted_buffer, |
115 scoped_refptr<DecoderBuffer>* decrypted_buffer); | 115 scoped_refptr<DecoderBuffer>* decrypted_buffer); |
116 | 116 |
117 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) | 117 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) |
118 int64 CurrentTimeStampInMicroseconds() const; | 118 int64 CurrentTimeStampInMicroseconds() const; |
119 | 119 |
120 // Generates fake video frames with |duration_in_microseconds|. | 120 // Generates fake video frames with |duration_in_microseconds|. |
121 // Returns the number of samples generated in the |audio_frames|. | 121 // Returns the number of samples generated in the |audio_frames|. |
122 int GenerateFakeAudioFramesFromDuration(int64 duration_in_microseconds, | 122 int GenerateFakeAudioFramesFromDuration(int64 duration_in_microseconds, |
123 cdm::AudioFrames* audio_frames) const; | 123 cdm::AudioFrames* audio_frames) const; |
124 | 124 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 scoped_ptr<CdmVideoDecoder> video_decoder_; | 172 scoped_ptr<CdmVideoDecoder> video_decoder_; |
173 | 173 |
174 scoped_ptr<FileIOTestRunner> file_io_test_runner_; | 174 scoped_ptr<FileIOTestRunner> file_io_test_runner_; |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 176 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
177 }; | 177 }; |
178 | 178 |
179 } // namespace media | 179 } // namespace media |
180 | 180 |
181 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 181 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
OLD | NEW |