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_helpers.h" | 8 #include "media/cdm/ppapi/cdm_helpers.h" |
8 #include "media/cdm/ppapi/cdm_logging.h" | 9 #include "media/cdm/ppapi/cdm_logging.h" |
9 #include "media/cdm/ppapi/supported_cdm_versions.h" | 10 #include "media/cdm/ppapi/supported_cdm_versions.h" |
10 #include "ppapi/c/ppb_console.h" | 11 #include "ppapi/c/ppb_console.h" |
11 | 12 |
12 #if defined(CHECK_DOCUMENT_URL) | 13 #if defined(CHECK_DOCUMENT_URL) |
13 #include "ppapi/cpp/dev/url_util_dev.h" | 14 #include "ppapi/cpp/dev/url_util_dev.h" |
14 #include "ppapi/cpp/instance_handle.h" | 15 #include "ppapi/cpp/instance_handle.h" |
15 #endif // defined(CHECK_DOCUMENT_URL) | 16 #endif // defined(CHECK_DOCUMENT_URL) |
16 | 17 |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 callback_factory_.NewCallback(&CdmAdapter::DecoderInitializeDone, | 915 callback_factory_.NewCallback(&CdmAdapter::DecoderInitializeDone, |
915 PP_DECRYPTORSTREAMTYPE_VIDEO, | 916 PP_DECRYPTORSTREAMTYPE_VIDEO, |
916 deferred_video_decoder_config_id_, | 917 deferred_video_decoder_config_id_, |
917 decoder_status == cdm::kSuccess)); | 918 decoder_status == cdm::kSuccess)); |
918 deferred_initialize_video_decoder_ = false; | 919 deferred_initialize_video_decoder_ = false; |
919 deferred_video_decoder_config_id_ = 0; | 920 deferred_video_decoder_config_id_ = 0; |
920 break; | 921 break; |
921 } | 922 } |
922 } | 923 } |
923 | 924 |
| 925 // The CDM owns the returned object and must call FileIO::Close() to release it. |
| 926 cdm::FileIO* CdmAdapter::CreateFileIO(cdm::FileIOClient* client) { |
| 927 return new CdmFileIOImpl(client, pp_instance()); |
| 928 } |
| 929 |
924 #if defined(OS_CHROMEOS) | 930 #if defined(OS_CHROMEOS) |
925 void CdmAdapter::SendPlatformChallengeDone(int32_t result) { | 931 void CdmAdapter::SendPlatformChallengeDone(int32_t result) { |
926 challenge_in_progress_ = false; | 932 challenge_in_progress_ = false; |
927 | 933 |
928 if (result != PP_OK) { | 934 if (result != PP_OK) { |
929 CDM_DLOG() << __FUNCTION__ << ": Platform challenge failed!"; | 935 CDM_DLOG() << __FUNCTION__ << ": Platform challenge failed!"; |
930 cdm::PlatformChallengeResponse response = {}; | 936 cdm::PlatformChallengeResponse response = {}; |
931 cdm_->OnPlatformChallengeResponse(response); | 937 cdm_->OnPlatformChallengeResponse(response); |
932 return; | 938 return; |
933 } | 939 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 } // namespace media | 1038 } // namespace media |
1033 | 1039 |
1034 namespace pp { | 1040 namespace pp { |
1035 | 1041 |
1036 // Factory function for your specialization of the Module object. | 1042 // Factory function for your specialization of the Module object. |
1037 Module* CreateModule() { | 1043 Module* CreateModule() { |
1038 return new media::CdmAdapterModule(); | 1044 return new media::CdmAdapterModule(); |
1039 } | 1045 } |
1040 | 1046 |
1041 } // namespace pp | 1047 } // namespace pp |
OLD | NEW |