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/crypto/ppapi/clear_key_cdm.h" | 5 #include "webkit/media/crypto/ppapi/clear_key_cdm.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 channel_count_ = 0; | 182 channel_count_ = 0; |
| 183 bits_per_channel_ = 0; | 183 bits_per_channel_ = 0; |
| 184 samples_per_second_ = 0; | 184 samples_per_second_ = 0; |
| 185 last_timestamp_ = media::kNoTimestamp(); | 185 last_timestamp_ = media::kNoTimestamp(); |
| 186 last_duration_ = media::kInfiniteDuration(); | 186 last_duration_ = media::kInfiniteDuration(); |
| 187 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 187 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
| 188 } | 188 } |
| 189 | 189 |
| 190 ClearKeyCdm::~ClearKeyCdm() {} | 190 ClearKeyCdm::~ClearKeyCdm() {} |
| 191 | 191 |
| 192 cdm::Status ClearKeyCdm::GenerateKeyRequest(const uint8_t* init_data, | 192 // TODO(tomfinegan): Use |mime_type| to determine type of |init_data|. |
|
ddorwin
2012/10/26 18:37:06
I think this TODO actually belongs in AesDecryptor
Tom Finegan
2012/10/26 22:51:33
Done.
| |
| 193 cdm::Status ClearKeyCdm::GenerateKeyRequest(const char* /* mime_type */, | |
| 194 int /* mime_type_size */, | |
| 195 const uint8_t* init_data, | |
| 193 int init_data_size, | 196 int init_data_size, |
| 194 cdm::KeyMessage* key_request) { | 197 cdm::KeyMessage* key_request) { |
| 195 DVLOG(1) << "GenerateKeyRequest()"; | 198 DVLOG(1) << "GenerateKeyRequest()"; |
| 196 base::AutoLock auto_lock(client_lock_); | 199 base::AutoLock auto_lock(client_lock_); |
| 197 ScopedResetter<Client> auto_resetter(&client_); | 200 ScopedResetter<Client> auto_resetter(&client_); |
| 198 decryptor_.GenerateKeyRequest("", init_data, init_data_size); | 201 decryptor_.GenerateKeyRequest("", init_data, init_data_size); |
| 199 | 202 |
| 200 if (client_.status() != Client::kKeyMessage) | 203 if (client_.status() != Client::kKeyMessage) |
| 201 return cdm::kSessionError; | 204 return cdm::kSessionError; |
| 202 | 205 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 | 540 |
| 538 static unsigned char color = 0; | 541 static unsigned char color = 0; |
| 539 color += 10; | 542 color += 10; |
| 540 | 543 |
| 541 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), | 544 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), |
| 542 color, frame_size); | 545 color, frame_size); |
| 543 } | 546 } |
| 544 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 547 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 545 | 548 |
| 546 } // namespace webkit_media | 549 } // namespace webkit_media |
| OLD | NEW |