Bug 1136877 - Collect telemetry on constraint_set flags from canPlayType. r=jya, a=lsblakk
authorMike Taylor <miket@mozilla.com>
Tue, 03 Mar 2015 08:54:00 -0500
changeset 250383 3aa618647813
parent 250382 1604edfb5a6c
child 250384 027a0ac06377
push id4570
push userryanvm@gmail.com
push date2015-03-16 16:03 +0000
treeherdermozilla-beta@ad1f181d8593 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, lsblakk
bugs1136877
milestone37.0
Bug 1136877 - Collect telemetry on constraint_set flags from canPlayType. r=jya, a=lsblakk
dom/media/VideoUtils.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/media/VideoUtils.cpp
+++ b/dom/media/VideoUtils.cpp
@@ -228,16 +228,23 @@ ExtractH264CodecDetails(const nsAString&
   // Extract the profile_idc and level_idc.
   nsresult rv = NS_OK;
   aProfile = PromiseFlatString(Substring(aCodec, 5, 2)).ToInteger(&rv, 16);
   NS_ENSURE_SUCCESS(rv, false);
 
   aLevel = PromiseFlatString(Substring(aCodec, 9, 2)).ToInteger(&rv, 16);
   NS_ENSURE_SUCCESS(rv, false);
 
+  // Capture the constraint_set flag value for the purpose of Telemetry.
+  // We don't NS_ENSURE_SUCCESS here because ExtractH264CodecDetails doesn't
+  // care about this, but we make sure constraints is above 4 (constraint_set5_flag)
+  // otherwise collect 0 for unknown.
+  uint8_t constraints = PromiseFlatString(Substring(aCodec, 7, 2)).ToInteger(&rv, 16);
+  Telemetry::Accumulate(Telemetry::VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG,
+                        constraints >= 4 ? constraints : 0);
 
   // 244 is the highest meaningful profile value (High 4:4:4 Intra Profile)
   // that can be represented as single hex byte, otherwise collect 0 for unknown.
   Telemetry::Accumulate(Telemetry::VIDEO_CANPLAYTYPE_H264_PROFILE,
                         aProfile <= 244 ? aProfile : 0);
 
   // Make sure aLevel represents a value between levels 1 and 5.2,
   // otherwise collect 0 for unknown.
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -5417,16 +5417,22 @@
   },
   "DEVTOOLS_DEBUGGER_RDP_REMOTE_RECONFIGURETHREAD_MS": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": "1000",
     "description": "The time (in milliseconds) that it took a 'reconfigure thread' request to go round trip."
   },
+  "VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG": {
+    "expires_in_version": "40",
+    "kind": "enumerated",
+    "n_values": 128,
+    "description": "The H.264 constraint set flag as extracted from the codecs parameter passed to HTMLMediaElement.canPlayType, with the addition of 0 for unknown values."
+  },
   "VIDEO_CANPLAYTYPE_H264_LEVEL": {
     "expires_in_version": "40",
     "kind": "enumerated",
     "n_values": 51,
     "description": "The H.264 level (level_idc) as extracted from the codecs parameter passed to HTMLMediaElement.canPlayType, from levels 1 (10) to 5.2 (51), with the addition of 0 for unknown values."
   },
   "VIDEO_CANPLAYTYPE_H264_PROFILE": {
     "expires_in_version": "40",