| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return cdm::kSuccess; | 281 return cdm::kSuccess; |
| 282 #else | 282 #else |
| 283 NOTIMPLEMENTED(); | 283 NOTIMPLEMENTED(); |
| 284 return cdm::kSessionError; | 284 return cdm::kSessionError; |
| 285 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 285 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
| 286 | 286 |
| 287 } | 287 } |
| 288 | 288 |
| 289 void ClearKeyCdm::ResetDecoder(cdm::StreamType decoder_type) { | 289 void ClearKeyCdm::ResetDecoder(cdm::StreamType decoder_type) { |
| 290 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 290 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 291 DCHECK(decoder_type == cdm::kStreamTypeVideo); | 291 if (decoder_type == cdm::kStreamTypeVideo) |
| 292 video_decoder_->Reset(); | 292 video_decoder_->Reset(); |
| 293 #endif | 293 #endif |
| 294 } | 294 } |
| 295 | 295 |
| 296 void ClearKeyCdm::DeinitializeDecoder(cdm::StreamType decoder_type) { | 296 void ClearKeyCdm::DeinitializeDecoder(cdm::StreamType decoder_type) { |
| 297 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 297 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 298 DCHECK(decoder_type == cdm::kStreamTypeVideo); | 298 if (decoder_type == cdm::kStreamTypeVideo) |
| 299 video_decoder_->Deinitialize(); | 299 video_decoder_->Deinitialize(); |
| 300 #endif | 300 #endif |
| 301 } | 301 } |
| 302 | 302 |
| 303 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( | 303 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( |
| 304 const cdm::InputBuffer& encrypted_buffer, | 304 const cdm::InputBuffer& encrypted_buffer, |
| 305 cdm::VideoFrame* decoded_frame) { | 305 cdm::VideoFrame* decoded_frame) { |
| 306 DVLOG(1) << "DecryptAndDecodeFrame()"; | 306 DVLOG(1) << "DecryptAndDecodeFrame()"; |
| 307 | 307 |
| 308 scoped_refptr<media::DecoderBuffer> buffer; | 308 scoped_refptr<media::DecoderBuffer> buffer; |
| 309 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); | 309 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 static unsigned char color = 0; | 400 static unsigned char color = 0; |
| 401 color += 10; | 401 color += 10; |
| 402 | 402 |
| 403 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), | 403 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), |
| 404 color, frame_size); | 404 color, frame_size); |
| 405 } | 405 } |
| 406 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 406 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 407 | 407 |
| 408 cdm::Status ClearKeyCdm::DecryptAndDecodeSamples( | 408 cdm::Status ClearKeyCdm::DecryptAndDecodeSamples( |
| 409 const cdm::InputBuffer& encrypted_buffer, | 409 const cdm::InputBuffer& encrypted_buffer, |
| 410 cdm::Buffer* sample_buffer) { | 410 cdm::AudioFrames* audio_frames) { |
| 411 NOTIMPLEMENTED(); | 411 NOTIMPLEMENTED(); |
| 412 return cdm::kDecryptError; | 412 return cdm::kDecryptError; |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace webkit_media | 415 } // namespace webkit_media |
| OLD | NEW |