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/external_clear_key/clear_key_cdm.h" | 5 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 case cdm::kKeyIds: | 169 case cdm::kKeyIds: |
170 return media::EmeInitDataType::KEYIDS; | 170 return media::EmeInitDataType::KEYIDS; |
171 case cdm::kWebM: | 171 case cdm::kWebM: |
172 return media::EmeInitDataType::WEBM; | 172 return media::EmeInitDataType::WEBM; |
173 } | 173 } |
174 NOTREACHED(); | 174 NOTREACHED(); |
175 return media::EmeInitDataType::UNKNOWN; | 175 return media::EmeInitDataType::UNKNOWN; |
176 } | 176 } |
177 | 177 |
178 cdm::KeyStatus ConvertKeyStatus(media::CdmKeyInformation::KeyStatus status) { | 178 cdm::KeyStatus ConvertKeyStatus(media::CdmKeyInformation::KeyStatus status) { |
179 // TODO(jrummell): Remove kOutputNotAllowed, add kOutputRestricted to CDM | |
180 // interface. http://crbug.com/507791. | |
181 switch (status) { | 179 switch (status) { |
182 case media::CdmKeyInformation::KeyStatus::USABLE: | 180 case media::CdmKeyInformation::KeyStatus::USABLE: |
183 return cdm::kUsable; | 181 return cdm::kUsable; |
184 case media::CdmKeyInformation::KeyStatus::INTERNAL_ERROR: | 182 case media::CdmKeyInformation::KeyStatus::INTERNAL_ERROR: |
185 return cdm::kInternalError; | 183 return cdm::kInternalError; |
186 case media::CdmKeyInformation::KeyStatus::EXPIRED: | 184 case media::CdmKeyInformation::KeyStatus::EXPIRED: |
187 return cdm::kExpired; | 185 return cdm::kExpired; |
188 case media::CdmKeyInformation::KeyStatus::OUTPUT_RESTRICTED: | 186 case media::CdmKeyInformation::KeyStatus::OUTPUT_RESTRICTED: |
189 return cdm::kOutputNotAllowed; | 187 return cdm::kOutputRestricted; |
190 case media::CdmKeyInformation::KeyStatus::OUTPUT_DOWNSCALED: | 188 case media::CdmKeyInformation::KeyStatus::OUTPUT_DOWNSCALED: |
191 return cdm::kOutputDownscaled; | 189 return cdm::kOutputDownscaled; |
192 case media::CdmKeyInformation::KeyStatus::KEY_STATUS_PENDING: | 190 case media::CdmKeyInformation::KeyStatus::KEY_STATUS_PENDING: |
193 return cdm::kStatusPending; | 191 return cdm::kStatusPending; |
| 192 case media::CdmKeyInformation::KeyStatus::RELEASED: |
| 193 return cdm::kReleased; |
194 } | 194 } |
195 NOTREACHED(); | 195 NOTREACHED(); |
196 return cdm::kInternalError; | 196 return cdm::kInternalError; |
197 } | 197 } |
198 | 198 |
199 // Shallow copy all the key information from |keys_info| into |keys_vector|. | 199 // Shallow copy all the key information from |keys_info| into |keys_vector|. |
200 // |keys_vector| is only valid for the lifetime of |keys_info| because it | 200 // |keys_vector| is only valid for the lifetime of |keys_info| because it |
201 // contains pointers into the latter. | 201 // contains pointers into the latter. |
202 void ConvertCdmKeysInfo(const std::vector<media::CdmKeyInformation*>& keys_info, | 202 void ConvertCdmKeysInfo(const std::vector<media::CdmKeyInformation*>& keys_info, |
203 std::vector<cdm::KeyInformation>* keys_vector) { | 203 std::vector<cdm::KeyInformation>* keys_vector) { |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 void ClearKeyCdm::OnFileIOTestComplete(bool success) { | 910 void ClearKeyCdm::OnFileIOTestComplete(bool success) { |
911 DVLOG(1) << __FUNCTION__ << ": " << success; | 911 DVLOG(1) << __FUNCTION__ << ": " << success; |
912 std::string message = GetFileIOTestResultMessage(success); | 912 std::string message = GetFileIOTestResultMessage(success); |
913 host_->OnSessionMessage(last_session_id_.data(), last_session_id_.length(), | 913 host_->OnSessionMessage(last_session_id_.data(), last_session_id_.length(), |
914 cdm::kLicenseRequest, message.data(), | 914 cdm::kLicenseRequest, message.data(), |
915 message.length(), NULL, 0); | 915 message.length(), NULL, 0); |
916 file_io_test_runner_.reset(); | 916 file_io_test_runner_.reset(); |
917 } | 917 } |
918 | 918 |
919 } // namespace media | 919 } // namespace media |
OLD | NEW |