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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 MediaKeyException result_id = MediaKeyExceptionForUMA(e); | 1459 MediaKeyException result_id = MediaKeyExceptionForUMA(e); |
1460 DCHECK_NE(result_id, kUnknownResultId) << e; | 1460 DCHECK_NE(result_id, kUnknownResultId) << e; |
1461 EmeUMAHistogramEnumeration( | 1461 EmeUMAHistogramEnumeration( |
1462 key_system, method, result_id, kMaxMediaKeyException); | 1462 key_system, method, result_id, kMaxMediaKeyException); |
1463 } | 1463 } |
1464 | 1464 |
1465 bool WebMediaPlayerAndroid::IsKeySystemSupported( | 1465 bool WebMediaPlayerAndroid::IsKeySystemSupported( |
1466 const std::string& key_system) { | 1466 const std::string& key_system) { |
1467 // On Android, EME only works with MSE. | 1467 // On Android, EME only works with MSE. |
1468 return player_type_ == MEDIA_PLAYER_TYPE_MEDIA_SOURCE && | 1468 return player_type_ == MEDIA_PLAYER_TYPE_MEDIA_SOURCE && |
1469 media::IsConcreteSupportedKeySystem(key_system); | 1469 media::PrefixedIsSupportedConcreteKeySystem(key_system); |
1470 } | 1470 } |
1471 | 1471 |
1472 WebMediaPlayer::MediaKeyException WebMediaPlayerAndroid::generateKeyRequest( | 1472 WebMediaPlayer::MediaKeyException WebMediaPlayerAndroid::generateKeyRequest( |
1473 const WebString& key_system, | 1473 const WebString& key_system, |
1474 const unsigned char* init_data, | 1474 const unsigned char* init_data, |
1475 unsigned init_data_length) { | 1475 unsigned init_data_length) { |
1476 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " | 1476 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " |
1477 << std::string(reinterpret_cast<const char*>(init_data), | 1477 << std::string(reinterpret_cast<const char*>(init_data), |
1478 static_cast<size_t>(init_data_length)); | 1478 static_cast<size_t>(init_data_length)); |
1479 | 1479 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 | 1822 |
1823 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1823 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1824 std::string mime; | 1824 std::string mime; |
1825 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1825 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1826 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1826 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1827 return false; | 1827 return false; |
1828 return !mime.compare("application/x-mpegurl"); | 1828 return !mime.compare("application/x-mpegurl"); |
1829 } | 1829 } |
1830 | 1830 |
1831 } // namespace content | 1831 } // namespace content |
OLD | NEW |