Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1247)

Unified Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 505233002: Add UMA to study the video types for mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reuse desktop UMAs Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/browser_media_player_manager.cc
diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc
index c847a275b8f37d484775164dd90079ab69a135e7..bafbfee3a96c334c37dd2e4008584bd6effec02f 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -6,6 +6,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/command_line.h"
+#include "base/metrics/histogram.h"
#include "content/browser/android/content_view_core_impl.h"
#include "content/browser/media/android/browser_demuxer_android.h"
#include "content/browser/media/android/media_resource_getter_impl.h"
@@ -40,6 +41,12 @@ namespace content {
// attempting to release inactive media players.
const int kMediaPlayerThreshold = 1;
+enum MediaType {
+ NON_HTTP_LIVE_STREAM_TYPE = 0,
+ // Match the value in histograms.xml
+ HTTP_LIVE_STREAM_TYPE = 22,
+};
+
static BrowserMediaPlayerManager::Factory g_factory = NULL;
static media::MediaUrlInterceptor* media_url_interceptor_ = NULL;
@@ -71,6 +78,9 @@ MediaPlayerAndroid* BrowserMediaPlayerManager::CreateMediaPlayer(
bool hide_url_log,
MediaPlayerManager* manager,
BrowserDemuxerAndroid* demuxer) {
+ UMA_HISTOGRAM_BOOLEAN(
scherkus (not reviewing) 2014/08/28 19:07:28 any reason why we don't log these UMAs when WebMed
qinmin 2014/08/28 20:43:40 Done. Moved it to WMPA.
+ "Media.MSE.Playback",
+ media_player_params.type == MEDIA_PLAYER_TYPE_MEDIA_SOURCE);
switch (media_player_params.type) {
case MEDIA_PLAYER_TYPE_URL: {
const std::string user_agent = GetContentClient()->GetUserAgent();
@@ -103,6 +113,13 @@ MediaPlayerAndroid* BrowserMediaPlayerManager::CreateMediaPlayer(
media_player_params.url)) {
media_player_bridge->Initialize();
}
+ std::string path = media_player_params.url.path();
+ bool is_hls_media = EndsWith(path, ".m3u8", true) ||
+ EndsWith(path, ".m3u", true);
+ MediaType media_type = is_hls_media ? HTTP_LIVE_STREAM_TYPE :
+ NON_HTTP_LIVE_STREAM_TYPE;
+ UMA_HISTOGRAM_ENUMERATION(
+ "Media.DetectedContainer", media_type, HTTP_LIVE_STREAM_TYPE + 1);
scherkus (not reviewing) 2014/08/28 19:07:28 to be honest I don't think it's worth reusing this
qinmin 2014/08/28 20:43:40 Done.
return media_player_bridge;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698