| 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 #include "media/cdm/ppapi/clear_key_cdm.h" | 5 #include "media/cdm/ppapi/clear_key_cdm.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 if (status == media::Decryptor::kError) | 489 if (status == media::Decryptor::kError) |
| 490 return cdm::kDecryptError; | 490 return cdm::kDecryptError; |
| 491 | 491 |
| 492 if (status == media::Decryptor::kNoKey) | 492 if (status == media::Decryptor::kNoKey) |
| 493 return cdm::kNoKey; | 493 return cdm::kNoKey; |
| 494 | 494 |
| 495 DCHECK_EQ(status, media::Decryptor::kSuccess); | 495 DCHECK_EQ(status, media::Decryptor::kSuccess); |
| 496 return cdm::kSuccess; | 496 return cdm::kSuccess; |
| 497 } | 497 } |
| 498 | 498 |
| 499 void ClearKeyCdm::OnPlatformChallengeResponse( |
| 500 const cdm::PlatformChallengeResponse& response) { |
| 501 NOTIMPLEMENTED(); |
| 502 } |
| 503 |
| 504 void ClearKeyCdm::OnQueryOutputProtectionStatus( |
| 505 uint32_t link_mask, uint32_t output_protection_mask) { |
| 506 NOTIMPLEMENTED(); |
| 507 }; |
| 508 |
| 499 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) | 509 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) |
| 500 int64 ClearKeyCdm::CurrentTimeStampInMicroseconds() const { | 510 int64 ClearKeyCdm::CurrentTimeStampInMicroseconds() const { |
| 501 return output_timestamp_base_in_microseconds_ + | 511 return output_timestamp_base_in_microseconds_ + |
| 502 base::Time::kMicrosecondsPerSecond * | 512 base::Time::kMicrosecondsPerSecond * |
| 503 total_samples_generated_ / samples_per_second_; | 513 total_samples_generated_ / samples_per_second_; |
| 504 } | 514 } |
| 505 | 515 |
| 506 int ClearKeyCdm::GenerateFakeAudioFramesFromDuration( | 516 int ClearKeyCdm::GenerateFakeAudioFramesFromDuration( |
| 507 int64 duration_in_microseconds, | 517 int64 duration_in_microseconds, |
| 508 cdm::AudioFrames* audio_frames) const { | 518 cdm::AudioFrames* audio_frames) const { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 int samples_generated = GenerateFakeAudioFramesFromDuration( | 559 int samples_generated = GenerateFakeAudioFramesFromDuration( |
| 550 timestamp_in_microseconds - CurrentTimeStampInMicroseconds(), | 560 timestamp_in_microseconds - CurrentTimeStampInMicroseconds(), |
| 551 audio_frames); | 561 audio_frames); |
| 552 total_samples_generated_ += samples_generated; | 562 total_samples_generated_ += samples_generated; |
| 553 | 563 |
| 554 return samples_generated == 0 ? cdm::kNeedMoreData : cdm::kSuccess; | 564 return samples_generated == 0 ? cdm::kNeedMoreData : cdm::kSuccess; |
| 555 } | 565 } |
| 556 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 566 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
| 557 | 567 |
| 558 } // namespace media | 568 } // namespace media |
| OLD | NEW |