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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 WebMediaPlayerAndroid::GenerateKeyRequestInternal( | 1535 WebMediaPlayerAndroid::GenerateKeyRequestInternal( |
1536 const std::string& key_system, | 1536 const std::string& key_system, |
1537 const unsigned char* init_data, | 1537 const unsigned char* init_data, |
1538 unsigned init_data_length) { | 1538 unsigned init_data_length) { |
1539 if (!IsKeySystemSupported(key_system)) | 1539 if (!IsKeySystemSupported(key_system)) |
1540 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 1540 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
1541 | 1541 |
1542 if (!proxy_decryptor_) { | 1542 if (!proxy_decryptor_) { |
1543 DCHECK(current_key_system_.empty()); | 1543 DCHECK(current_key_system_.empty()); |
1544 proxy_decryptor_.reset(new media::ProxyDecryptor( | 1544 proxy_decryptor_.reset(new media::ProxyDecryptor( |
1545 media_permission_, base::Bind(&WebMediaPlayerAndroid::OnKeyAdded, | 1545 media_permission_, |
1546 weak_factory_.GetWeakPtr()), | 1546 player_manager_->ShouldUseVideoOverlayForEmbeddedEncryptedVideo(), |
| 1547 base::Bind(&WebMediaPlayerAndroid::OnKeyAdded, |
| 1548 weak_factory_.GetWeakPtr()), |
1547 base::Bind(&WebMediaPlayerAndroid::OnKeyError, | 1549 base::Bind(&WebMediaPlayerAndroid::OnKeyError, |
1548 weak_factory_.GetWeakPtr()), | 1550 weak_factory_.GetWeakPtr()), |
1549 base::Bind(&WebMediaPlayerAndroid::OnKeyMessage, | 1551 base::Bind(&WebMediaPlayerAndroid::OnKeyMessage, |
1550 weak_factory_.GetWeakPtr()))); | 1552 weak_factory_.GetWeakPtr()))); |
1551 | 1553 |
1552 GURL security_origin(frame_->document().securityOrigin().toString()); | 1554 GURL security_origin(frame_->document().securityOrigin().toString()); |
1553 proxy_decryptor_->CreateCdm( | 1555 proxy_decryptor_->CreateCdm( |
1554 cdm_factory_, key_system, security_origin, | 1556 cdm_factory_, key_system, security_origin, |
1555 base::Bind(&WebMediaPlayerAndroid::OnCdmContextReady, | 1557 base::Bind(&WebMediaPlayerAndroid::OnCdmContextReady, |
1556 weak_factory_.GetWeakPtr())); | 1558 weak_factory_.GetWeakPtr())); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 | 1864 |
1863 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1865 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1864 std::string mime; | 1866 std::string mime; |
1865 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1867 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1866 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1868 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1867 return false; | 1869 return false; |
1868 return !mime.compare("application/x-mpegurl"); | 1870 return !mime.compare("application/x-mpegurl"); |
1869 } | 1871 } |
1870 | 1872 |
1871 } // namespace content | 1873 } // namespace content |
OLD | NEW |