Skip to content
Snippets Groups Projects
Commit db47b39e authored by Michael Vines's avatar Michael Vines
Browse files

Remove patch, upstreamed.

Change-Id: I6ec8df134980adc8e568705a9e0e170dfe294b58
From 9ac874041a6273385e7b1ba01e631835fa320424 Mon Sep 17 00:00:00 2001
From: Diego Wilson <dwilson@codeaurora.org>
Date: Thu, 5 Dec 2013 14:39:20 -0800
Subject: [PATCH] Output video statistics when playback stops
These stats are useful for simple performance analysis.
---
apps/video/js/video.js | 39 +++++++++++++++++++++++++++++++++++++++
build/preferences.js | 2 ++
2 files changed, 41 insertions(+)
diff --git a/apps/video/js/video.js b/apps/video/js/video.js
index 2ce6a23..40b4a1d 100644
--- a/apps/video/js/video.js
+++ b/apps/video/js/video.js
@@ -30,16 +30,22 @@ var playing = false;
// if this is true then the video tag is showing
// if false, then the gallery is showing
var playerShowing = false;
// keep the screen on when playing
var endedTimer;
+// video quality stats the last time playback started
+var startPlayQuality;
+
+// play time when playback started
+var startPlayTime;
+
// same thing for the controls
var controlShowing = false;
var controlFadeTimeout = null;
// In thumbnailSelectView, we allow the user to select thumbnails.
// These variables hold the names of the selected files, and map those
// names to the corresponding File objects
var selectedFileNames = [];
@@ -847,25 +853,58 @@ function playerEnded() {
function play() {
// Switch the button icon
dom.play.classList.remove('paused');
// Start playing
dom.player.play();
playing = true;
+
+ if (!dom.player.getVideoPlaybackQuality) {
+ dump('Warning: VideoPlaybackQuality not supported');
+ return;
+ }
+
+ startPlayQuality = dom.player.getVideoPlaybackQuality();
+ startPlayTime = dom.player.currentTime;
}
function pause() {
// Switch the button icon
dom.play.classList.add('paused');
// Stop playing the video
dom.player.pause();
playing = false;
+
+ if (!dom.player.getVideoPlaybackQuality) {
+ dump('Warning: VideoPlaybackQuality not supported');
+ return;
+ }
+ var quality = dom.player.getVideoPlaybackQuality();
+ // Playback segment duration in seconds
+ var segmentDuration = (quality.creationTime - startPlayQuality.creationTime) / 1000;
+ var startRendered = startPlayQuality.totalVideoFrames - startPlayQuality.droppedVideoFrames;
+ var endRendered = quality.totalVideoFrames - quality.droppedVideoFrames;
+ var segmentRendered = endRendered - startRendered;
+ var fps = segmentRendered / segmentDuration;
+
+ dump('Video statistics start');
+ dump('Dimensions: ' + dom.player.videoWidth + 'x' + dom.player.videoHeight);
+ dump('Complete duration: ' + MediaUtils.formatDuration(dom.player.duration));
+ dump('Start time: ' + MediaUtils.formatDuration(startPlayTime));
+ dump('End time: ' + MediaUtils.formatDuration(dom.player.currentTime));
+ dump('Total frames: ' + quality.totalVideoFrames);
+ dump('Decoded frames: ' + (quality.totalVideoFrames - quality.corruptedVideoFrames));
+ dump('Corrupted frames: ' + quality.corruptedVideoFrames);
+ dump('Rendered frames: ' + (quality.totalVideoFrames - quality.droppedVideoFrames));
+ dump('Dropped frames: ' + quality.droppedVideoFrames);
+ dump('Average rendered FPS: ' + fps.toFixed(2) );
+ dump('Video statistics end');
}
// Update the progress bar and play head as the video plays
function timeUpdated() {
if (controlShowing) {
// We can't update a progress bar if we don't know how long
// the video is. It is kind of a bug that the <video> element
// can't figure this out for ogv videos.
diff --git a/build/preferences.js b/build/preferences.js
index dea16a6..5f562ff 100644
--- a/build/preferences.js
+++ b/build/preferences.js
@@ -26,16 +26,18 @@ function execute(options) {
gaia.webapps.forEach(function(webapp) {
domains.push(webapp.domain);
});
prefs.push(['network.http.max-connections-per-server', 15]);
prefs.push(['dom.mozInputMethod.enabled', true]);
+ prefs.push(['media.mediasource.enabled', true]);
+
// for https://bugzilla.mozilla.org/show_bug.cgi?id=811605 to let user know
//what prefs is for ril debugging
prefs.push(['ril.debugging.enabled', false]);
// Gaia has no vCard/vCalendar for now. Override MMS version to v1.1:
// TODO: remove this override after having vCard/vCalendar implemented in Gaia.
// @see bug 885683 - [Messages] MMS doesn't support sending and receiving vCard attachments.
// @see bug 905548 - [Messages] MMS doesn't support sending and receiving vCalendar attachments.
prefs.push(['dom.mms.version', 0x11]);
--
1.8.2.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment