--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -10,20 +10,16 @@
#include "MediaPrefs.h"
#include "PDMFactory.h"
#include "WebMDemuxer.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/ContentChild.h"
-#ifndef MOZ_WIDGET_ANDROID
-#include "WebMSample.h"
-#endif
-
namespace mozilla {
// Update this version number to force re-running the benchmark. Such as when
// an improvement to FFVP9 or LIBVPX is deemed worthwhile.
const uint32_t VP9Benchmark::sBenchmarkVersionID = 2;
const char* VP9Benchmark::sBenchmarkFpsPref = "media.benchmark.vp9.fps";
const char* VP9Benchmark::sBenchmarkFpsVersionCheck = "media.benchmark.vp9.versioncheck";
@@ -39,19 +35,21 @@ VP9Benchmark::IsVP9DecodeFast()
return false;
#else
bool hasPref = Preferences::HasUserValue(sBenchmarkFpsPref);
uint32_t hadRecentUpdate = Preferences::GetUint(sBenchmarkFpsVersionCheck, 0U);
if (!sHasRunTest && (!hasPref || hadRecentUpdate != sBenchmarkVersionID)) {
sHasRunTest = true;
+#include "WebMSample.h"
+
RefPtr<WebMDemuxer> demuxer =
new WebMDemuxer(
- new BufferMediaResource(sWebMSample, sizeof(sWebMSample), nullptr,
+ new BufferMediaResource(webMSample, sizeof(webMSample), nullptr,
MediaContainerType(MEDIAMIMETYPE("video/webm"))));
RefPtr<Benchmark> estimiser =
new Benchmark(demuxer,
{
Preferences::GetInt("media.benchmark.frames", 300), // frames to measure
1, // start benchmarking after decoding this frame.
8, // loop after decoding that many frames.
TimeDuration::FromMilliseconds(
--- a/dom/media/WebMSample.h
+++ b/dom/media/WebMSample.h
@@ -1,9 +1,9 @@
-static const uint8_t sWebMSample[] = {
+uint8_t webMSample[] = {
0x1a, 0x45, 0xdf, 0xa3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
0x42, 0x86, 0x81, 0x01, 0x42, 0xf7, 0x81, 0x01, 0x42, 0xf2, 0x81, 0x04,
0x42, 0xf3, 0x81, 0x08, 0x42, 0x82, 0x84, 0x77, 0x65, 0x62, 0x6d, 0x42,
0x87, 0x81, 0x02, 0x42, 0x85, 0x81, 0x02, 0x18, 0x53, 0x80, 0x67, 0x01,
0x00, 0x00, 0x00, 0x00, 0x04, 0x2b, 0x9e, 0x11, 0x4d, 0x9b, 0x74, 0x40,
0x2d, 0x4d, 0xbb, 0x8b, 0x53, 0xab, 0x84, 0x15, 0x49, 0xa9, 0x66, 0x53,
0xac, 0x81, 0xdf, 0x4d, 0xbb, 0x8c, 0x53, 0xab, 0x84, 0x16, 0x54, 0xae,
0x6b, 0x53, 0xac, 0x82, 0x01, 0x54, 0x4d, 0xbb, 0x8d, 0x53, 0xab, 0x84,