| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cdm_adapter.h" | 5 #include "media/cdm/cdm_adapter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 return; | 651 return; |
| 652 } | 652 } |
| 653 | 653 |
| 654 audio_decode_cb.Run(Decryptor::kSuccess, audio_frame_list); | 654 audio_decode_cb.Run(Decryptor::kSuccess, audio_frame_list); |
| 655 } | 655 } |
| 656 | 656 |
| 657 void CdmAdapter::DecryptAndDecodeVideo( | 657 void CdmAdapter::DecryptAndDecodeVideo( |
| 658 const scoped_refptr<DecoderBuffer>& encrypted, | 658 const scoped_refptr<DecoderBuffer>& encrypted, |
| 659 const VideoDecodeCB& video_decode_cb) { | 659 const VideoDecodeCB& video_decode_cb) { |
| 660 DCHECK(task_runner_->BelongsToCurrentThread()); | 660 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 661 DVLOG(3) << __FUNCTION__ |
| 662 << " encrypted: " << encrypted->AsHumanReadableString(); |
| 661 | 663 |
| 662 cdm::InputBuffer input_buffer; | 664 cdm::InputBuffer input_buffer; |
| 663 std::vector<cdm::SubsampleEntry> subsamples; | 665 std::vector<cdm::SubsampleEntry> subsamples; |
| 664 scoped_ptr<VideoFrameImpl> video_frame(new VideoFrameImpl()); | 666 scoped_ptr<VideoFrameImpl> video_frame(new VideoFrameImpl()); |
| 665 | 667 |
| 666 ToCdmInputBuffer(encrypted, &subsamples, &input_buffer); | 668 ToCdmInputBuffer(encrypted, &subsamples, &input_buffer); |
| 667 cdm::Status status = | 669 cdm::Status status = |
| 668 cdm_->DecryptAndDecodeFrame(input_buffer, video_frame.get()); | 670 cdm_->DecryptAndDecodeFrame(input_buffer, video_frame.get()); |
| 669 | 671 |
| 670 if (status != cdm::kSuccess) { | 672 if (status != cdm::kSuccess) { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 result_frames->push_back(frame); | 951 result_frames->push_back(frame); |
| 950 | 952 |
| 951 data += frame_size; | 953 data += frame_size; |
| 952 bytes_left -= frame_size; | 954 bytes_left -= frame_size; |
| 953 } while (bytes_left > 0); | 955 } while (bytes_left > 0); |
| 954 | 956 |
| 955 return true; | 957 return true; |
| 956 } | 958 } |
| 957 | 959 |
| 958 } // namespace media | 960 } // namespace media |
| OLD | NEW |