| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 using blink::WebSize; | 77 using blink::WebSize; |
| 78 using blink::WebString; | 78 using blink::WebString; |
| 79 using blink::WebURL; | 79 using blink::WebURL; |
| 80 using gpu::gles2::GLES2Interface; | 80 using gpu::gles2::GLES2Interface; |
| 81 using media::LogHelper; | 81 using media::LogHelper; |
| 82 using media::MediaLog; | 82 using media::MediaLog; |
| 83 using media::MediaPlayerAndroid; | 83 using media::MediaPlayerAndroid; |
| 84 using media::VideoFrame; | 84 using media::VideoFrame; |
| 85 | 85 |
| 86 namespace { | 86 namespace { |
| 87 // Prefix for histograms related to Encrypted Media Extensions. | |
| 88 const char* kMediaEme = "Media.EME."; | |
| 89 | 87 |
| 90 // Values for Media.Android.IsHttpLiveStreamingMediaPredictionResult UMA. | 88 // Values for Media.Android.IsHttpLiveStreamingMediaPredictionResult UMA. |
| 91 // Never reuse values! | 89 // Never reuse values! |
| 92 enum MediaTypePredictionResult { | 90 enum MediaTypePredictionResult { |
| 93 PREDICTION_RESULT_ALL_CORRECT, | 91 PREDICTION_RESULT_ALL_CORRECT, |
| 94 PREDICTION_RESULT_ALL_INCORRECT, | 92 PREDICTION_RESULT_ALL_INCORRECT, |
| 95 PREDICTION_RESULT_PATH_BASED_WAS_BETTER, | 93 PREDICTION_RESULT_PATH_BASED_WAS_BETTER, |
| 96 PREDICTION_RESULT_URL_BASED_WAS_BETTER, | 94 PREDICTION_RESULT_URL_BASED_WAS_BETTER, |
| 97 // Must always be larger than the largest logged value. | 95 // Must always be larger than the largest logged value. |
| 98 PREDICTION_RESULT_MAX | 96 PREDICTION_RESULT_MAX |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 media::EmeInitDataType init_data_type, | 1481 media::EmeInitDataType init_data_type, |
| 1484 const std::vector<uint8_t>& init_data) { | 1482 const std::vector<uint8_t>& init_data) { |
| 1485 DCHECK(main_thread_checker_.CalledOnValidThread()); | 1483 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 1486 | 1484 |
| 1487 // Do not fire the "encrypted" event if Encrypted Media is not enabled. | 1485 // Do not fire the "encrypted" event if Encrypted Media is not enabled. |
| 1488 // EME may not be enabled on Android Jelly Bean. | 1486 // EME may not be enabled on Android Jelly Bean. |
| 1489 if (!blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) { | 1487 if (!blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) { |
| 1490 return; | 1488 return; |
| 1491 } | 1489 } |
| 1492 | 1490 |
| 1493 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); | 1491 // TODO(xhwang): Update this UMA name. https://crbug.com/589251 |
| 1492 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); |
| 1494 | 1493 |
| 1495 DCHECK(init_data_type != media::EmeInitDataType::UNKNOWN); | 1494 DCHECK(init_data_type != media::EmeInitDataType::UNKNOWN); |
| 1496 | 1495 |
| 1497 encrypted_client_->encrypted(ConvertToWebInitDataType(init_data_type), | 1496 encrypted_client_->encrypted(ConvertToWebInitDataType(init_data_type), |
| 1498 init_data.data(), init_data.size()); | 1497 init_data.data(), init_data.size()); |
| 1499 } | 1498 } |
| 1500 | 1499 |
| 1501 void WebMediaPlayerAndroid::OnWaitingForDecryptionKey() { | 1500 void WebMediaPlayerAndroid::OnWaitingForDecryptionKey() { |
| 1502 encrypted_client_->didBlockPlaybackWaitingForKey(); | 1501 encrypted_client_->didBlockPlaybackWaitingForKey(); |
| 1503 | 1502 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1656 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1658 } else if (is_hls_url == is_hls) { | 1657 } else if (is_hls_url == is_hls) { |
| 1659 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1658 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1660 } | 1659 } |
| 1661 UMA_HISTOGRAM_ENUMERATION( | 1660 UMA_HISTOGRAM_ENUMERATION( |
| 1662 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1661 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1663 result, PREDICTION_RESULT_MAX); | 1662 result, PREDICTION_RESULT_MAX); |
| 1664 } | 1663 } |
| 1665 | 1664 |
| 1666 } // namespace content | 1665 } // namespace content |
| OLD | NEW |