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 "content/renderer/pepper/content_decryptor_delegate.h" | 5 #include "content/renderer/pepper/content_decryptor_delegate.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 DVLOG(2) << "DeliverSamples() - request_id: " << request_id; | 1060 DVLOG(2) << "DeliverSamples() - request_id: " << request_id; |
1061 | 1061 |
1062 // If the request ID is not valid or does not match what's saved, do nothing. | 1062 // If the request ID is not valid or does not match what's saved, do nothing. |
1063 if (request_id == 0 || !audio_decode_cb_.Matches(request_id)) { | 1063 if (request_id == 0 || !audio_decode_cb_.Matches(request_id)) { |
1064 DVLOG(1) << "DeliverSamples() - request_id " << request_id << " not found"; | 1064 DVLOG(1) << "DeliverSamples() - request_id " << request_id << " not found"; |
1065 return; | 1065 return; |
1066 } | 1066 } |
1067 | 1067 |
1068 Decryptor::AudioDecodeCB audio_decode_cb = audio_decode_cb_.ResetAndReturn(); | 1068 Decryptor::AudioDecodeCB audio_decode_cb = audio_decode_cb_.ResetAndReturn(); |
1069 | 1069 |
1070 const Decryptor::AudioFrames empty_frames; | 1070 const Decryptor::AudioFrames empty_frames = Decryptor::AudioFrames(); |
1071 | 1071 |
1072 Decryptor::Status status = | 1072 Decryptor::Status status = |
1073 PpDecryptResultToMediaDecryptorStatus(sample_info->result); | 1073 PpDecryptResultToMediaDecryptorStatus(sample_info->result); |
1074 if (status != Decryptor::kSuccess) { | 1074 if (status != Decryptor::kSuccess) { |
1075 audio_decode_cb.Run(status, empty_frames); | 1075 audio_decode_cb.Run(status, empty_frames); |
1076 return; | 1076 return; |
1077 } | 1077 } |
1078 | 1078 |
1079 media::SampleFormat sample_format = | 1079 media::SampleFormat sample_format = |
1080 PpDecryptedSampleFormatToMediaSampleFormat(sample_info->format); | 1080 PpDecryptedSampleFormatToMediaSampleFormat(sample_info->format); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 audio_input_resource_ = NULL; | 1272 audio_input_resource_ = NULL; |
1273 video_input_resource_ = NULL; | 1273 video_input_resource_ = NULL; |
1274 | 1274 |
1275 if (!audio_decrypt_cb_.is_null()) | 1275 if (!audio_decrypt_cb_.is_null()) |
1276 audio_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1276 audio_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1277 | 1277 |
1278 if (!video_decrypt_cb_.is_null()) | 1278 if (!video_decrypt_cb_.is_null()) |
1279 video_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1279 video_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1280 | 1280 |
1281 if (!audio_decode_cb_.is_null()) { | 1281 if (!audio_decode_cb_.is_null()) { |
1282 const media::Decryptor::AudioFrames empty_frames; | 1282 const media::Decryptor::AudioFrames empty_frames = Decryptor::AudioFrames(); |
1283 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, | 1283 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, |
1284 empty_frames); | 1284 empty_frames); |
1285 } | 1285 } |
1286 | 1286 |
1287 if (!video_decode_cb_.is_null()) | 1287 if (!video_decode_cb_.is_null()) |
1288 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1288 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1289 | 1289 |
1290 cdm_promise_adapter_.Clear(); | 1290 cdm_promise_adapter_.Clear(); |
1291 } | 1291 } |
1292 | 1292 |
1293 } // namespace content | 1293 } // namespace content |
OLD | NEW |