| 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 "base/bind_to_current_loop.h" |
| 7 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| 10 #include "base/numerics/safe_conversions.h" | 11 #include "base/numerics/safe_conversions.h" |
| 11 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 12 #include "content/renderer/pepper/ppb_buffer_impl.h" | 13 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| 13 #include "media/base/audio_buffer.h" | 14 #include "media/base/audio_buffer.h" |
| 14 #include "media/base/audio_decoder_config.h" | 15 #include "media/base/audio_decoder_config.h" |
| 15 #include "media/base/bind_to_current_loop.h" | |
| 16 #include "media/base/cdm_key_information.h" | 16 #include "media/base/cdm_key_information.h" |
| 17 #include "media/base/channel_layout.h" | 17 #include "media/base/channel_layout.h" |
| 18 #include "media/base/data_buffer.h" | 18 #include "media/base/data_buffer.h" |
| 19 #include "media/base/decoder_buffer.h" | 19 #include "media/base/decoder_buffer.h" |
| 20 #include "media/base/decrypt_config.h" | 20 #include "media/base/decrypt_config.h" |
| 21 #include "media/base/key_systems.h" | 21 #include "media/base/key_systems.h" |
| 22 #include "media/base/limits.h" | 22 #include "media/base/limits.h" |
| 23 #include "media/base/video_decoder_config.h" | 23 #include "media/base/video_decoder_config.h" |
| 24 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
| 25 #include "media/base/video_util.h" | 25 #include "media/base/video_util.h" |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 gfx::Rect(frame_size), | 1035 gfx::Rect(frame_size), |
| 1036 natural_size_, | 1036 natural_size_, |
| 1037 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_Y], | 1037 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_Y], |
| 1038 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_U], | 1038 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_U], |
| 1039 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_V], | 1039 frame_info->strides[PP_DECRYPTEDFRAMEPLANES_V], |
| 1040 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_Y], | 1040 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_Y], |
| 1041 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_U], | 1041 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_U], |
| 1042 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_V], | 1042 frame_data + frame_info->plane_offsets[PP_DECRYPTEDFRAMEPLANES_V], |
| 1043 base::TimeDelta::FromMicroseconds( | 1043 base::TimeDelta::FromMicroseconds( |
| 1044 frame_info->tracking_info.timestamp), | 1044 frame_info->tracking_info.timestamp), |
| 1045 media::BindToCurrentLoop( | 1045 base::BindToCurrentLoop( |
| 1046 base::Bind(&BufferNoLongerNeeded, | 1046 base::Bind(&BufferNoLongerNeeded, |
| 1047 ppb_buffer, | 1047 ppb_buffer, |
| 1048 base::Bind(&ContentDecryptorDelegate::FreeBuffer, | 1048 base::Bind(&ContentDecryptorDelegate::FreeBuffer, |
| 1049 weak_this_, | 1049 weak_this_, |
| 1050 frame_info->tracking_info.buffer_id)))); | 1050 frame_info->tracking_info.buffer_id)))); |
| 1051 | 1051 |
| 1052 video_decode_cb.Run(Decryptor::kSuccess, decoded_frame); | 1052 video_decode_cb.Run(Decryptor::kSuccess, decoded_frame); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 void ContentDecryptorDelegate::DeliverSamples( | 1055 void ContentDecryptorDelegate::DeliverSamples( |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 empty_frames); | 1288 empty_frames); |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 if (!video_decode_cb_.is_null()) | 1291 if (!video_decode_cb_.is_null()) |
| 1292 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1292 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
| 1293 | 1293 |
| 1294 cdm_promise_adapter_.Clear(); | 1294 cdm_promise_adapter_.Clear(); |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 } // namespace content | 1297 } // namespace content |
| OLD | NEW |