| 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/debug/trace_event.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "base/time.h" | 12 #include "base/time.h" |
| 12 #include "media/base/decoder_buffer.h" | 13 #include "media/base/decoder_buffer.h" |
| 13 | 14 |
| 14 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) | 15 #if defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER) |
| 15 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 16 static const int64 kNoTimestamp = kint64min; | 17 static const int64 kNoTimestamp = kint64min; |
| 17 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 18 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
| 18 | 19 |
| 19 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 20 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 output_timestamp_base_in_microseconds_ = kNoTimestamp; | 375 output_timestamp_base_in_microseconds_ = kNoTimestamp; |
| 375 total_samples_generated_ = 0; | 376 total_samples_generated_ = 0; |
| 376 } | 377 } |
| 377 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 378 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
| 378 } | 379 } |
| 379 | 380 |
| 380 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( | 381 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( |
| 381 const cdm::InputBuffer& encrypted_buffer, | 382 const cdm::InputBuffer& encrypted_buffer, |
| 382 cdm::VideoFrame* decoded_frame) { | 383 cdm::VideoFrame* decoded_frame) { |
| 383 DVLOG(1) << "DecryptAndDecodeFrame()"; | 384 DVLOG(1) << "DecryptAndDecodeFrame()"; |
| 385 TRACE_EVENT0("eme", "ClearKeyCdm::DecryptAndDecodeFrame"); |
| 384 | 386 |
| 385 scoped_refptr<media::DecoderBuffer> buffer; | 387 scoped_refptr<media::DecoderBuffer> buffer; |
| 386 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); | 388 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); |
| 387 | 389 |
| 388 if (status != cdm::kSuccess) | 390 if (status != cdm::kSuccess) |
| 389 return status; | 391 return status; |
| 390 | 392 |
| 391 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 393 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 392 DCHECK(status == cdm::kSuccess); | 394 DCHECK(status == cdm::kSuccess); |
| 393 DCHECK(buffer); | 395 DCHECK(buffer); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 563 |
| 562 static unsigned char color = 0; | 564 static unsigned char color = 0; |
| 563 color += 10; | 565 color += 10; |
| 564 | 566 |
| 565 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), | 567 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), |
| 566 color, frame_size); | 568 color, frame_size); |
| 567 } | 569 } |
| 568 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 570 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 569 | 571 |
| 570 } // namespace webkit_media | 572 } // namespace webkit_media |
| OLD | NEW |