| 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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1715 if (system_code > std::numeric_limits<unsigned short>::max()) { | 1715 if (system_code > std::numeric_limits<unsigned short>::max()) { |
| 1716 LOG(WARNING) << "system_code exceeds unsigned short limit."; | 1716 LOG(WARNING) << "system_code exceeds unsigned short limit."; |
| 1717 short_system_code = std::numeric_limits<unsigned short>::max(); | 1717 short_system_code = std::numeric_limits<unsigned short>::max(); |
| 1718 } else { | 1718 } else { |
| 1719 short_system_code = static_cast<unsigned short>(system_code); | 1719 short_system_code = static_cast<unsigned short>(system_code); |
| 1720 } | 1720 } |
| 1721 | 1721 |
| 1722 encrypted_client_->keyError( | 1722 encrypted_client_->keyError( |
| 1723 WebString::fromUTF8(media::GetPrefixedKeySystemName(current_key_system_)), | 1723 WebString::fromUTF8(media::GetPrefixedKeySystemName(current_key_system_)), |
| 1724 WebString::fromUTF8(session_id), | 1724 WebString::fromUTF8(session_id), |
| 1725 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 1725 static_cast<blink::WebMediaPlayerEncryptedMediaClient::MediaKeyErrorCode>( |
| 1726 error_code), |
| 1726 short_system_code); | 1727 short_system_code); |
| 1727 } | 1728 } |
| 1728 | 1729 |
| 1729 void WebMediaPlayerAndroid::OnKeyMessage(const std::string& session_id, | 1730 void WebMediaPlayerAndroid::OnKeyMessage(const std::string& session_id, |
| 1730 const std::vector<uint8>& message, | 1731 const std::vector<uint8>& message, |
| 1731 const GURL& destination_url) { | 1732 const GURL& destination_url) { |
| 1732 DCHECK(destination_url.is_empty() || destination_url.is_valid()); | 1733 DCHECK(destination_url.is_empty() || destination_url.is_valid()); |
| 1733 | 1734 |
| 1734 encrypted_client_->keyMessage( | 1735 encrypted_client_->keyMessage( |
| 1735 WebString::fromUTF8(media::GetPrefixedKeySystemName(current_key_system_)), | 1736 WebString::fromUTF8(media::GetPrefixedKeySystemName(current_key_system_)), |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 | 1867 |
| 1867 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1868 bool WebMediaPlayerAndroid::IsHLSStream() const { |
| 1868 std::string mime; | 1869 std::string mime; |
| 1869 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1870 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
| 1870 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1871 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
| 1871 return false; | 1872 return false; |
| 1872 return !mime.compare("application/x-mpegurl"); | 1873 return !mime.compare("application/x-mpegurl"); |
| 1873 } | 1874 } |
| 1874 | 1875 |
| 1875 } // namespace content | 1876 } // namespace content |
| OLD | NEW |