| 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 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 return; | 1768 return; |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); | 1771 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); |
| 1772 | 1772 |
| 1773 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_); | 1773 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_); |
| 1774 if (init_data_type_.empty()) | 1774 if (init_data_type_.empty()) |
| 1775 init_data_type_ = type; | 1775 init_data_type_ = type; |
| 1776 | 1776 |
| 1777 const uint8* init_data_ptr = init_data.empty() ? NULL : &init_data[0]; | 1777 const uint8* init_data_ptr = init_data.empty() ? NULL : &init_data[0]; |
| 1778 client_->keyNeeded( | 1778 client_->encrypted( |
| 1779 WebString::fromUTF8(type), init_data_ptr, init_data.size()); | 1779 WebString::fromUTF8(type), init_data_ptr, init_data.size()); |
| 1780 } | 1780 } |
| 1781 | 1781 |
| 1782 void WebMediaPlayerAndroid::SetDecryptorReadyCB( | 1782 void WebMediaPlayerAndroid::SetDecryptorReadyCB( |
| 1783 const media::DecryptorReadyCB& decryptor_ready_cb) { | 1783 const media::DecryptorReadyCB& decryptor_ready_cb) { |
| 1784 DCHECK(main_thread_checker_.CalledOnValidThread()); | 1784 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 1785 | 1785 |
| 1786 // Cancels the previous decryptor request. | 1786 // Cancels the previous decryptor request. |
| 1787 if (decryptor_ready_cb.is_null()) { | 1787 if (decryptor_ready_cb.is_null()) { |
| 1788 if (!decryptor_ready_cb_.is_null()) { | 1788 if (!decryptor_ready_cb_.is_null()) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 | 1829 |
| 1830 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1830 bool WebMediaPlayerAndroid::IsHLSStream() const { |
| 1831 std::string mime; | 1831 std::string mime; |
| 1832 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1832 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
| 1833 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1833 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
| 1834 return false; | 1834 return false; |
| 1835 return !mime.compare("application/x-mpegurl"); | 1835 return !mime.compare("application/x-mpegurl"); |
| 1836 } | 1836 } |
| 1837 | 1837 |
| 1838 } // namespace content | 1838 } // namespace content |
| OLD | NEW |