| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ppapi/cdm_adapter.h" | 5 #include "media/cdm/ppapi/cdm_adapter.h" |
| 6 | 6 |
| 7 #include "media/cdm/ppapi/cdm_file_io_impl.h" | 7 #include "media/cdm/ppapi/cdm_file_io_impl.h" |
| 8 #include "media/cdm/ppapi/cdm_helpers.h" | 8 #include "media/cdm/ppapi/cdm_helpers.h" |
| 9 #include "media/cdm/ppapi/cdm_logging.h" | 9 #include "media/cdm/ppapi/cdm_logging.h" |
| 10 #include "media/cdm/ppapi/supported_cdm_versions.h" | 10 #include "media/cdm/ppapi/supported_cdm_versions.h" |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 CdmExceptionTypeToPpCdmExceptionType(error.error), | 831 CdmExceptionTypeToPpCdmExceptionType(error.error), |
| 832 error.system_code, | 832 error.system_code, |
| 833 error.error_description); | 833 error.error_description); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void CdmAdapter::DeliverBlock(int32_t result, | 836 void CdmAdapter::DeliverBlock(int32_t result, |
| 837 const cdm::Status& status, | 837 const cdm::Status& status, |
| 838 const LinkedDecryptedBlock& decrypted_block, | 838 const LinkedDecryptedBlock& decrypted_block, |
| 839 const PP_DecryptTrackingInfo& tracking_info) { | 839 const PP_DecryptTrackingInfo& tracking_info) { |
| 840 PP_DCHECK(result == PP_OK); | 840 PP_DCHECK(result == PP_OK); |
| 841 PP_DecryptedBlockInfo decrypted_block_info; | 841 PP_DecryptedBlockInfo decrypted_block_info = {}; |
| 842 decrypted_block_info.tracking_info = tracking_info; | 842 decrypted_block_info.tracking_info = tracking_info; |
| 843 decrypted_block_info.tracking_info.timestamp = decrypted_block->Timestamp(); | 843 decrypted_block_info.tracking_info.timestamp = decrypted_block->Timestamp(); |
| 844 decrypted_block_info.tracking_info.buffer_id = 0; | 844 decrypted_block_info.tracking_info.buffer_id = 0; |
| 845 decrypted_block_info.data_size = 0; | 845 decrypted_block_info.data_size = 0; |
| 846 decrypted_block_info.result = CdmStatusToPpDecryptResult(status); | 846 decrypted_block_info.result = CdmStatusToPpDecryptResult(status); |
| 847 | 847 |
| 848 pp::Buffer_Dev buffer; | 848 pp::Buffer_Dev buffer; |
| 849 | 849 |
| 850 if (decrypted_block_info.result == PP_DECRYPTRESULT_SUCCESS) { | 850 if (decrypted_block_info.result == PP_DECRYPTRESULT_SUCCESS) { |
| 851 PP_DCHECK(decrypted_block.get() && decrypted_block->DecryptedBuffer()); | 851 PP_DCHECK(decrypted_block.get() && decrypted_block->DecryptedBuffer()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 uint32_t request_id) { | 886 uint32_t request_id) { |
| 887 pp::ContentDecryptor_Private::DecoderResetDone(decoder_type, request_id); | 887 pp::ContentDecryptor_Private::DecoderResetDone(decoder_type, request_id); |
| 888 } | 888 } |
| 889 | 889 |
| 890 void CdmAdapter::DeliverFrame( | 890 void CdmAdapter::DeliverFrame( |
| 891 int32_t result, | 891 int32_t result, |
| 892 const cdm::Status& status, | 892 const cdm::Status& status, |
| 893 const LinkedVideoFrame& video_frame, | 893 const LinkedVideoFrame& video_frame, |
| 894 const PP_DecryptTrackingInfo& tracking_info) { | 894 const PP_DecryptTrackingInfo& tracking_info) { |
| 895 PP_DCHECK(result == PP_OK); | 895 PP_DCHECK(result == PP_OK); |
| 896 PP_DecryptedFrameInfo decrypted_frame_info; | 896 PP_DecryptedFrameInfo decrypted_frame_info = {}; |
| 897 decrypted_frame_info.tracking_info.request_id = tracking_info.request_id; | 897 decrypted_frame_info.tracking_info.request_id = tracking_info.request_id; |
| 898 decrypted_frame_info.tracking_info.buffer_id = 0; | 898 decrypted_frame_info.tracking_info.buffer_id = 0; |
| 899 decrypted_frame_info.result = CdmStatusToPpDecryptResult(status); | 899 decrypted_frame_info.result = CdmStatusToPpDecryptResult(status); |
| 900 | 900 |
| 901 pp::Buffer_Dev buffer; | 901 pp::Buffer_Dev buffer; |
| 902 | 902 |
| 903 if (decrypted_frame_info.result == PP_DECRYPTRESULT_SUCCESS) { | 903 if (decrypted_frame_info.result == PP_DECRYPTRESULT_SUCCESS) { |
| 904 if (!IsValidVideoFrame(video_frame)) { | 904 if (!IsValidVideoFrame(video_frame)) { |
| 905 PP_NOTREACHED(); | 905 PP_NOTREACHED(); |
| 906 decrypted_frame_info.result = PP_DECRYPTRESULT_DECODE_ERROR; | 906 decrypted_frame_info.result = PP_DECRYPTRESULT_DECODE_ERROR; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 932 } | 932 } |
| 933 pp::ContentDecryptor_Private::DeliverFrame(buffer, decrypted_frame_info); | 933 pp::ContentDecryptor_Private::DeliverFrame(buffer, decrypted_frame_info); |
| 934 } | 934 } |
| 935 | 935 |
| 936 void CdmAdapter::DeliverSamples(int32_t result, | 936 void CdmAdapter::DeliverSamples(int32_t result, |
| 937 const cdm::Status& status, | 937 const cdm::Status& status, |
| 938 const LinkedAudioFrames& audio_frames, | 938 const LinkedAudioFrames& audio_frames, |
| 939 const PP_DecryptTrackingInfo& tracking_info) { | 939 const PP_DecryptTrackingInfo& tracking_info) { |
| 940 PP_DCHECK(result == PP_OK); | 940 PP_DCHECK(result == PP_OK); |
| 941 | 941 |
| 942 PP_DecryptedSampleInfo decrypted_sample_info; | 942 PP_DecryptedSampleInfo decrypted_sample_info = {}; |
| 943 decrypted_sample_info.tracking_info = tracking_info; | 943 decrypted_sample_info.tracking_info = tracking_info; |
| 944 decrypted_sample_info.tracking_info.timestamp = 0; | 944 decrypted_sample_info.tracking_info.timestamp = 0; |
| 945 decrypted_sample_info.tracking_info.buffer_id = 0; | 945 decrypted_sample_info.tracking_info.buffer_id = 0; |
| 946 decrypted_sample_info.data_size = 0; | 946 decrypted_sample_info.data_size = 0; |
| 947 decrypted_sample_info.result = CdmStatusToPpDecryptResult(status); | 947 decrypted_sample_info.result = CdmStatusToPpDecryptResult(status); |
| 948 | 948 |
| 949 pp::Buffer_Dev buffer; | 949 pp::Buffer_Dev buffer; |
| 950 | 950 |
| 951 if (decrypted_sample_info.result == PP_DECRYPTRESULT_SUCCESS) { | 951 if (decrypted_sample_info.result == PP_DECRYPTRESULT_SUCCESS) { |
| 952 PP_DCHECK(audio_frames.get() && audio_frames->FrameBuffer()); | 952 PP_DCHECK(audio_frames.get() && audio_frames->FrameBuffer()); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 } // namespace media | 1268 } // namespace media |
| 1269 | 1269 |
| 1270 namespace pp { | 1270 namespace pp { |
| 1271 | 1271 |
| 1272 // Factory function for your specialization of the Module object. | 1272 // Factory function for your specialization of the Module object. |
| 1273 Module* CreateModule() { | 1273 Module* CreateModule() { |
| 1274 return new media::CdmAdapterModule(); | 1274 return new media::CdmAdapterModule(); |
| 1275 } | 1275 } |
| 1276 | 1276 |
| 1277 } // namespace pp | 1277 } // namespace pp |
| OLD | NEW |