Bug 1322739: P3. Add low-latency option to FFmpeg. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 21 Feb 2017 17:03:42 +0100
changeset 373312 cdff3a6b58716c5377b2b32dd968e9f8bf727d2b
parent 373311 b0c1d3189bb228c68d320cb1bf54b3e85d6b6640
child 373313 323f69eeab41fbe7c485f7b9eca1dd7be07e48e9
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1322739
milestone54.0a1
Bug 1322739: P3. Add low-latency option to FFmpeg. r=gerald ContentPrefs.cpp line ending was incorrectly set to CRLF. MozReview-Commit-ID: LIcZNnNzFd8
dom/ipc/ContentPrefs.cpp
dom/media/MediaPrefs.h
dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
dom/media/platforms/ffmpeg/FFmpegLibs.h
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
dom/media/platforms/wrappers/H264Converter.cpp
dom/media/platforms/wrappers/H264Converter.h
modules/libpref/init/all.js
--- a/dom/ipc/ContentPrefs.cpp
+++ b/dom/ipc/ContentPrefs.cpp
@@ -1,278 +1,279 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ContentPrefs.h"
-
-const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
-  "accessibility.monoaudio.enable",
-  "accessibility.mouse_focuses_formcontrol",
-  "accessibility.tabfocus_applies_to_xul",
-  "app.update.channel",
-  "browser.dom.window.dump.enabled",
-  "browser.sessionhistory.max_entries",
-  "browser.sessionhistory.max_total_viewers",
-  "content.cors.disable",
-  "content.cors.no_private_data",
-  "content.notify.backoffcount",
-  "content.notify.interval",
-  "content.notify.ontimer",
-  "content.sink.enable_perf_mode",
-  "content.sink.event_probe_rate",
-  "content.sink.initial_perf_time",
-  "content.sink.interactive_deflect_count",
-  "content.sink.interactive_parse_time",
-  "content.sink.interactive_time",
-  "content.sink.pending_event_mode",
-  "content.sink.perf_deflect_count",
-  "content.sink.perf_parse_time",
-  "device.storage.prompt.testing",
-  "device.storage.writable.name",
-  "dom.allow_XUL_XBL_for_file",
-  "dom.allow_cut_copy",
-  "dom.enable_frame_timing",
-  "dom.enable_performance",
-  "dom.enable_resource_timing",
-  "dom.event.handling-user-input-time-limit",
-  "dom.event.touch.coalescing.enabled",
-  "dom.forms.autocomplete.experimental",
-  "dom.ipc.processPriorityManager.backgroundGracePeriodMS",
-  "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
-  "dom.max_chrome_script_run_time",
-  "dom.max_script_run_time",
-  "dom.mozBrowserFramesEnabled",
-  "dom.performance.enable_notify_performance_timing",
-  "dom.performance.enable_user_timing_logging",
-  "dom.storage.testing",
-  "dom.url.encode_decode_hash",
-  "dom.url.getters_decode_hash",
-  "dom.use_watchdog",
-  "dom.vibrator.enabled",
-  "dom.vibrator.max_vibrate_list_len",
-  "dom.vibrator.max_vibrate_ms",
-  "focusmanager.testmode",
-  "font.size.inflation.disabledInMasterProcess",
-  "font.size.inflation.emPerLine",
-  "font.size.inflation.forceEnabled",
-  "font.size.inflation.lineThreshold",
-  "font.size.inflation.mappingIntercept",
-  "font.size.inflation.maxRatio",
-  "font.size.inflation.minTwips",
-  "full-screen-api.allow-trusted-requests-only",
-  "full-screen-api.enabled",
-  "full-screen-api.unprefix.enabled",
-  "gfx.font_rendering.opentype_svg.enabled",
-  "hangmonitor.timeout",
-  "html5.flushtimer.initialdelay",
-  "html5.flushtimer.subsequentdelay",
-  "html5.offmainthread",
-  "intl.charset.fallback.tld",
-  "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition",
-  "javascript.enabled",
-  "javascript.options.asmjs",
-  "javascript.options.asyncstack",
-  "javascript.options.baselinejit",
-  "javascript.options.baselinejit.threshold",
-  "javascript.options.baselinejit.unsafe_eager_compilation",
-  "javascript.options.discardSystemSource",
-  "javascript.options.dump_stack_on_debuggee_would_run",
-  "javascript.options.gczeal",
-  "javascript.options.gczeal.frequency",
-  "javascript.options.ion",
-  "javascript.options.ion.offthread_compilation",
-  "javascript.options.ion.threshold",
-  "javascript.options.ion.unsafe_eager_compilation",
-  "javascript.options.jit.full_debug_checks",
-  "javascript.options.native_regexp",
-  "javascript.options.parallel_parsing",
-  "javascript.options.shared_memory",
-  "javascript.options.strict",
-  "javascript.options.strict.debug",
-  "javascript.options.throw_on_asmjs_validation_failure",
-  "javascript.options.throw_on_debuggee_would_run",
-  "javascript.options.wasm",
-  "javascript.options.wasm_baselinejit",
-  "javascript.options.werror",
-  "javascript.use_us_english_locale",
-  "jsloader.reuseGlobal",
-  "layout.css.all-shorthand.enabled",
-  "layout.css.background-blend-mode.enabled",
-  "layout.css.background-clip-text.enabled",
-  "layout.css.box-decoration-break.enabled",
-  "layout.css.color-adjust.enabled",
-  "layout.css.contain.enabled",
-  "layout.css.control-characters.visible",
-  "layout.css.display-flow-root.enabled",
-  "layout.css.expensive-style-struct-assertions.enabled",
-  "layout.css.float-logical-values.enabled",
-  "layout.css.font-variations.enabled",
-  "layout.css.grid.enabled",
-  "layout.css.image-orientation.enabled",
-  "layout.css.initial-letter.enabled",
-  "layout.css.isolation.enabled",
-  "layout.css.mix-blend-mode.enabled",
-  "layout.css.object-fit-and-position.enabled",
-  "layout.css.osx-font-smoothing.enabled",
-  "layout.css.overflow-clip-box.enabled",
-  "layout.css.prefixes.animations",
-  "layout.css.prefixes.border-image",
-  "layout.css.prefixes.box-sizing",
-  "layout.css.prefixes.device-pixel-ratio-webkit",
-  "layout.css.prefixes.font-features",
-  "layout.css.prefixes.gradients",
-  "layout.css.prefixes.transforms",
-  "layout.css.prefixes.transitions",
-  "layout.css.prefixes.webkit",
-  "layout.css.scope-pseudo.enabled",
-  "layout.css.scroll-behavior.property-enabled",
-  "layout.css.scroll-snap.enabled",
-  "layout.css.servo.enabled",
-  "layout.css.shape-outside.enabled",
-  "layout.css.text-align-unsafe-value.enabled",
-  "layout.css.text-combine-upright-digits.enabled",
-  "layout.css.text-combine-upright.enabled",
-  "layout.css.touch_action.enabled",
-  "layout.css.unprefixing-service.enabled",
-  "layout.css.unprefixing-service.globally-whitelisted",
-  "layout.css.unprefixing-service.include-test-domains",
-  "layout.css.variables.enabled",
-  "layout.css.visited_links_enabled",
-  "layout.idle_period.required_quiescent_frames",
-  "layout.idle_period.time_limit",
-  "layout.interruptible-reflow.enabled",
-  "mathml.disabled",
-  "media.apple.forcevda",
-  "media.clearkey.persistent-license.enabled",
-  "media.cubeb_latency_msg_frames",
-  "media.cubeb_latency_playback_ms",
-  "media.decoder-doctor.wmf-disabled-is-failure",
-  "media.decoder.fuzzing.dont-delay-inputexhausted",
-  "media.decoder.fuzzing.enabled",
-  "media.decoder.fuzzing.video-output-minimum-interval-ms",
-  "media.decoder.limit",
-  "media.decoder.recycle.enabled",
-  "media.dormant-on-pause-timeout-ms",
-  "media.eme.audio.blank",
-  "media.eme.enabled",
-  "media.eme.video.blank",
-  "media.ffmpeg.enabled",
-  "media.ffvpx.enabled",
-  "media.flac.enabled",
-  "media.forcestereo.enabled",
-  "media.gmp.async-shutdown-timeout",
-  "media.gmp.decoder.aac",
-  "media.gmp.decoder.enabled",
-  "media.gmp.decoder.h264",
-  "media.gmp.insecure.allow",
-  "media.gpu-process-decoder",
-  "media.libavcodec.allow-obsolete",
-  "media.num-decode-threads",
-  "media.ogg.enabled",
-  "media.ogg.flac.enabled",
-  "media.resampling.enabled",
-  "media.resampling.rate",
-  "media.ruin-av-sync.enabled",
-  "media.rust.test_mode",
-  "media.suspend-bkgnd-video.delay-ms",
-  "media.suspend-bkgnd-video.enabled",
-  "media.use-blank-decoder",
-  "media.video_stats.enabled",
-  "media.volume_scale",
-  "media.webspeech.recognition.enable",
-  "media.webspeech.recognition.force_enable",
-  "media.webspeech.synth.force_global_queue",
-  "media.webspeech.test.enable",
-  "media.webspeech.test.fake_fsm_events",
-  "media.webspeech.test.fake_recognition_service",
-  "media.wmf.allow-unsupported-resolutions",
-  "media.wmf.decoder.thread-count",
-  "media.wmf.enabled",
-  "media.wmf.skip-blacklist",
-  "media.wmf.vp9.enabled",
-  "memory.free_dirty_pages",
-  "memory.low_commit_space_threshold_mb",
-  "memory.low_memory_notification_interval_ms",
-  "memory.low_physical_memory_threshold_mb",
-  "memory.low_virtual_mem_threshold_mb",
-  "network.IDN.blacklist_chars",
-  "network.IDN.restriction_profile",
-  "network.IDN.use_whitelist",
-  "network.IDN_show_punycode",
-  "network.buffer.cache.count",
-  "network.buffer.cache.size",
-  "network.captive-portal-service.enabled",
-  "network.cookie.cookieBehavior",
-  "network.cookie.lifetimePolicy",
-  "network.dns.disablePrefetch",
-  "network.dns.disablePrefetchFromHTTPS",
-  "network.jar.block-remote-files",
-  "network.loadinfo.skip_type_assertion",
-  "network.notify.changed",
-  "network.offline-mirrors-connectivity",
-  "network.protocol-handler.external.jar",
-  "network.proxy.type",
-  "network.security.ports.banned",
-  "network.security.ports.banned.override",
-  "network.standard-url.enable-rust",
-  "network.standard-url.max-length",
-  "network.sts.max_time_for_events_between_two_polls",
-  "network.sts.max_time_for_pr_close_during_shutdown",
-  "network.tcp.keepalive.enabled",
-  "network.tcp.keepalive.idle_time",
-  "network.tcp.keepalive.probe_count",
-  "network.tcp.keepalive.retry_interval",
-  "network.tcp.sendbuffer",
-  "nglayout.debug.invalidation",
-  "privacy.donottrackheader.enabled",
-  "privacy.firstparty.isolate",
-  "privacy.firstparty.isolate.restrict_opener_access",
-  "privacy.resistFingerprinting",
-  "security.data_uri.inherit_security_context",
-  "security.fileuri.strict_origin_policy",
-  "security.sandbox.content.level",
-  "security.sandbox.content.tempDirSuffix",
-  "security.sandbox.logging.enabled",
-  "security.sandbox.mac.track.violations",
-  "security.sandbox.windows.log",
-  "security.sandbox.windows.log.stackTraceDepth",
-  "shutdown.watchdog.timeoutSecs",
-  "signed.applets.codebase_principal_support",
-  "svg.disabled",
-  "svg.display-lists.hit-testing.enabled",
-  "svg.display-lists.painting.enabled",
-  "svg.new-getBBox.enabled",
-  "svg.paint-order.enabled",
-  "svg.path-caching.enabled",
-  "svg.transform-box.enabled",
-  "toolkit.asyncshutdown.crash_timeout",
-  "toolkit.asyncshutdown.log",
-  "toolkit.osfile.log",
-  "toolkit.osfile.log.redirect",
-  "toolkit.telemetry.enabled",
-  "toolkit.telemetry.idleTimeout",
-  "toolkit.telemetry.initDelay",
-  "toolkit.telemetry.log.dump",
-  "toolkit.telemetry.log.level",
-  "toolkit.telemetry.minSubsessionLength",
-  "toolkit.telemetry.scheduler.idleTickInterval",
-  "toolkit.telemetry.scheduler.tickInterval",
-  "toolkit.telemetry.unified",
-  "ui.key.menuAccessKeyFocuses",
-  "ui.popup.disable_autohide",
-  "ui.use_activity_cursor",
-  "view_source.editor.external"};
-
-const char** mozilla::dom::ContentPrefs::GetContentPrefs(size_t* aCount)
-{
-  *aCount = ArrayLength(ContentPrefs::gInitPrefs);
-  return gInitPrefs;
-}
-
-const char*  mozilla::dom::ContentPrefs::GetContentPref(size_t aIndex)
-{
-  MOZ_ASSERT(aIndex < ArrayLength(ContentPrefs::gInitPrefs));
-  return gInitPrefs[aIndex];
-}
-
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "ContentPrefs.h"
+
+const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
+  "accessibility.monoaudio.enable",
+  "accessibility.mouse_focuses_formcontrol",
+  "accessibility.tabfocus_applies_to_xul",
+  "app.update.channel",
+  "browser.dom.window.dump.enabled",
+  "browser.sessionhistory.max_entries",
+  "browser.sessionhistory.max_total_viewers",
+  "content.cors.disable",
+  "content.cors.no_private_data",
+  "content.notify.backoffcount",
+  "content.notify.interval",
+  "content.notify.ontimer",
+  "content.sink.enable_perf_mode",
+  "content.sink.event_probe_rate",
+  "content.sink.initial_perf_time",
+  "content.sink.interactive_deflect_count",
+  "content.sink.interactive_parse_time",
+  "content.sink.interactive_time",
+  "content.sink.pending_event_mode",
+  "content.sink.perf_deflect_count",
+  "content.sink.perf_parse_time",
+  "device.storage.prompt.testing",
+  "device.storage.writable.name",
+  "dom.allow_XUL_XBL_for_file",
+  "dom.allow_cut_copy",
+  "dom.enable_frame_timing",
+  "dom.enable_performance",
+  "dom.enable_resource_timing",
+  "dom.event.handling-user-input-time-limit",
+  "dom.event.touch.coalescing.enabled",
+  "dom.forms.autocomplete.experimental",
+  "dom.ipc.processPriorityManager.backgroundGracePeriodMS",
+  "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
+  "dom.max_chrome_script_run_time",
+  "dom.max_script_run_time",
+  "dom.mozBrowserFramesEnabled",
+  "dom.performance.enable_notify_performance_timing",
+  "dom.performance.enable_user_timing_logging",
+  "dom.storage.testing",
+  "dom.url.encode_decode_hash",
+  "dom.url.getters_decode_hash",
+  "dom.use_watchdog",
+  "dom.vibrator.enabled",
+  "dom.vibrator.max_vibrate_list_len",
+  "dom.vibrator.max_vibrate_ms",
+  "focusmanager.testmode",
+  "font.size.inflation.disabledInMasterProcess",
+  "font.size.inflation.emPerLine",
+  "font.size.inflation.forceEnabled",
+  "font.size.inflation.lineThreshold",
+  "font.size.inflation.mappingIntercept",
+  "font.size.inflation.maxRatio",
+  "font.size.inflation.minTwips",
+  "full-screen-api.allow-trusted-requests-only",
+  "full-screen-api.enabled",
+  "full-screen-api.unprefix.enabled",
+  "gfx.font_rendering.opentype_svg.enabled",
+  "hangmonitor.timeout",
+  "html5.flushtimer.initialdelay",
+  "html5.flushtimer.subsequentdelay",
+  "html5.offmainthread",
+  "intl.charset.fallback.tld",
+  "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition",
+  "javascript.enabled",
+  "javascript.options.asmjs",
+  "javascript.options.asyncstack",
+  "javascript.options.baselinejit",
+  "javascript.options.baselinejit.threshold",
+  "javascript.options.baselinejit.unsafe_eager_compilation",
+  "javascript.options.discardSystemSource",
+  "javascript.options.dump_stack_on_debuggee_would_run",
+  "javascript.options.gczeal",
+  "javascript.options.gczeal.frequency",
+  "javascript.options.ion",
+  "javascript.options.ion.offthread_compilation",
+  "javascript.options.ion.threshold",
+  "javascript.options.ion.unsafe_eager_compilation",
+  "javascript.options.jit.full_debug_checks",
+  "javascript.options.native_regexp",
+  "javascript.options.parallel_parsing",
+  "javascript.options.shared_memory",
+  "javascript.options.strict",
+  "javascript.options.strict.debug",
+  "javascript.options.throw_on_asmjs_validation_failure",
+  "javascript.options.throw_on_debuggee_would_run",
+  "javascript.options.wasm",
+  "javascript.options.wasm_baselinejit",
+  "javascript.options.werror",
+  "javascript.use_us_english_locale",
+  "jsloader.reuseGlobal",
+  "layout.css.all-shorthand.enabled",
+  "layout.css.background-blend-mode.enabled",
+  "layout.css.background-clip-text.enabled",
+  "layout.css.box-decoration-break.enabled",
+  "layout.css.color-adjust.enabled",
+  "layout.css.contain.enabled",
+  "layout.css.control-characters.visible",
+  "layout.css.display-flow-root.enabled",
+  "layout.css.expensive-style-struct-assertions.enabled",
+  "layout.css.float-logical-values.enabled",
+  "layout.css.font-variations.enabled",
+  "layout.css.grid.enabled",
+  "layout.css.image-orientation.enabled",
+  "layout.css.initial-letter.enabled",
+  "layout.css.isolation.enabled",
+  "layout.css.mix-blend-mode.enabled",
+  "layout.css.object-fit-and-position.enabled",
+  "layout.css.osx-font-smoothing.enabled",
+  "layout.css.overflow-clip-box.enabled",
+  "layout.css.prefixes.animations",
+  "layout.css.prefixes.border-image",
+  "layout.css.prefixes.box-sizing",
+  "layout.css.prefixes.device-pixel-ratio-webkit",
+  "layout.css.prefixes.font-features",
+  "layout.css.prefixes.gradients",
+  "layout.css.prefixes.transforms",
+  "layout.css.prefixes.transitions",
+  "layout.css.prefixes.webkit",
+  "layout.css.scope-pseudo.enabled",
+  "layout.css.scroll-behavior.property-enabled",
+  "layout.css.scroll-snap.enabled",
+  "layout.css.servo.enabled",
+  "layout.css.shape-outside.enabled",
+  "layout.css.text-align-unsafe-value.enabled",
+  "layout.css.text-combine-upright-digits.enabled",
+  "layout.css.text-combine-upright.enabled",
+  "layout.css.touch_action.enabled",
+  "layout.css.unprefixing-service.enabled",
+  "layout.css.unprefixing-service.globally-whitelisted",
+  "layout.css.unprefixing-service.include-test-domains",
+  "layout.css.variables.enabled",
+  "layout.css.visited_links_enabled",
+  "layout.idle_period.required_quiescent_frames",
+  "layout.idle_period.time_limit",
+  "layout.interruptible-reflow.enabled",
+  "mathml.disabled",
+  "media.apple.forcevda",
+  "media.clearkey.persistent-license.enabled",
+  "media.cubeb_latency_msg_frames",
+  "media.cubeb_latency_playback_ms",
+  "media.decoder-doctor.wmf-disabled-is-failure",
+  "media.decoder.fuzzing.dont-delay-inputexhausted",
+  "media.decoder.fuzzing.enabled",
+  "media.decoder.fuzzing.video-output-minimum-interval-ms",
+  "media.decoder.limit",
+  "media.decoder.recycle.enabled",
+  "media.dormant-on-pause-timeout-ms",
+  "media.eme.audio.blank",
+  "media.eme.enabled",
+  "media.eme.video.blank",
+  "media.ffmpeg.enabled",
+  "media.ffvpx.enabled",
+  "media.ffvpx.low-latency.enabled",
+  "media.flac.enabled",
+  "media.forcestereo.enabled",
+  "media.gmp.async-shutdown-timeout",
+  "media.gmp.decoder.aac",
+  "media.gmp.decoder.enabled",
+  "media.gmp.decoder.h264",
+  "media.gmp.insecure.allow",
+  "media.gpu-process-decoder",
+  "media.libavcodec.allow-obsolete",
+  "media.num-decode-threads",
+  "media.ogg.enabled",
+  "media.ogg.flac.enabled",
+  "media.resampling.enabled",
+  "media.resampling.rate",
+  "media.ruin-av-sync.enabled",
+  "media.rust.test_mode",
+  "media.suspend-bkgnd-video.delay-ms",
+  "media.suspend-bkgnd-video.enabled",
+  "media.use-blank-decoder",
+  "media.video_stats.enabled",
+  "media.volume_scale",
+  "media.webspeech.recognition.enable",
+  "media.webspeech.recognition.force_enable",
+  "media.webspeech.synth.force_global_queue",
+  "media.webspeech.test.enable",
+  "media.webspeech.test.fake_fsm_events",
+  "media.webspeech.test.fake_recognition_service",
+  "media.wmf.allow-unsupported-resolutions",
+  "media.wmf.decoder.thread-count",
+  "media.wmf.enabled",
+  "media.wmf.skip-blacklist",
+  "media.wmf.vp9.enabled",
+  "memory.free_dirty_pages",
+  "memory.low_commit_space_threshold_mb",
+  "memory.low_memory_notification_interval_ms",
+  "memory.low_physical_memory_threshold_mb",
+  "memory.low_virtual_mem_threshold_mb",
+  "network.IDN.blacklist_chars",
+  "network.IDN.restriction_profile",
+  "network.IDN.use_whitelist",
+  "network.IDN_show_punycode",
+  "network.buffer.cache.count",
+  "network.buffer.cache.size",
+  "network.captive-portal-service.enabled",
+  "network.cookie.cookieBehavior",
+  "network.cookie.lifetimePolicy",
+  "network.dns.disablePrefetch",
+  "network.dns.disablePrefetchFromHTTPS",
+  "network.jar.block-remote-files",
+  "network.loadinfo.skip_type_assertion",
+  "network.notify.changed",
+  "network.offline-mirrors-connectivity",
+  "network.protocol-handler.external.jar",
+  "network.proxy.type",
+  "network.security.ports.banned",
+  "network.security.ports.banned.override",
+  "network.standard-url.enable-rust",
+  "network.standard-url.max-length",
+  "network.sts.max_time_for_events_between_two_polls",
+  "network.sts.max_time_for_pr_close_during_shutdown",
+  "network.tcp.keepalive.enabled",
+  "network.tcp.keepalive.idle_time",
+  "network.tcp.keepalive.probe_count",
+  "network.tcp.keepalive.retry_interval",
+  "network.tcp.sendbuffer",
+  "nglayout.debug.invalidation",
+  "privacy.donottrackheader.enabled",
+  "privacy.firstparty.isolate",
+  "privacy.firstparty.isolate.restrict_opener_access",
+  "privacy.resistFingerprinting",
+  "security.data_uri.inherit_security_context",
+  "security.fileuri.strict_origin_policy",
+  "security.sandbox.content.level",
+  "security.sandbox.content.tempDirSuffix",
+  "security.sandbox.logging.enabled",
+  "security.sandbox.mac.track.violations",
+  "security.sandbox.windows.log",
+  "security.sandbox.windows.log.stackTraceDepth",
+  "shutdown.watchdog.timeoutSecs",
+  "signed.applets.codebase_principal_support",
+  "svg.disabled",
+  "svg.display-lists.hit-testing.enabled",
+  "svg.display-lists.painting.enabled",
+  "svg.new-getBBox.enabled",
+  "svg.paint-order.enabled",
+  "svg.path-caching.enabled",
+  "svg.transform-box.enabled",
+  "toolkit.asyncshutdown.crash_timeout",
+  "toolkit.asyncshutdown.log",
+  "toolkit.osfile.log",
+  "toolkit.osfile.log.redirect",
+  "toolkit.telemetry.enabled",
+  "toolkit.telemetry.idleTimeout",
+  "toolkit.telemetry.initDelay",
+  "toolkit.telemetry.log.dump",
+  "toolkit.telemetry.log.level",
+  "toolkit.telemetry.minSubsessionLength",
+  "toolkit.telemetry.scheduler.idleTickInterval",
+  "toolkit.telemetry.scheduler.tickInterval",
+  "toolkit.telemetry.unified",
+  "ui.key.menuAccessKeyFocuses",
+  "ui.popup.disable_autohide",
+  "ui.use_activity_cursor",
+  "view_source.editor.external"};
+
+const char** mozilla::dom::ContentPrefs::GetContentPrefs(size_t* aCount)
+{
+  *aCount = ArrayLength(ContentPrefs::gInitPrefs);
+  return gInitPrefs;
+}
+
+const char*  mozilla::dom::ContentPrefs::GetContentPref(size_t aIndex)
+{
+  MOZ_ASSERT(aIndex < ArrayLength(ContentPrefs::gInitPrefs));
+  return gInitPrefs[aIndex];
+}
+
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -115,16 +115,17 @@ private:
   DECL_MEDIA_PREF("media.android-media-codec.preferred",      PDMAndroidMediaCodecPreferred, bool, false);
 #endif
 #ifdef MOZ_FFMPEG
   DECL_MEDIA_PREF("media.ffmpeg.enabled",                     PDMFFmpegEnabled, bool, true);
   DECL_MEDIA_PREF("media.libavcodec.allow-obsolete",          LibavcodecAllowObsolete, bool, false);
 #endif
 #ifdef MOZ_FFVPX
   DECL_MEDIA_PREF("media.ffvpx.enabled",                      PDMFFVPXEnabled, bool, true);
+  DECL_MEDIA_PREF("media.ffvpx.low-latency.enabled",          PDMFFVPXLowLatencyEnabled, bool, false);
 #endif
 #ifdef XP_WIN
   DECL_MEDIA_PREF("media.wmf.enabled",                        PDMWMFEnabled, bool, true);
   DECL_MEDIA_PREF("media.wmf.skip-blacklist",                 PDMWMFSkipBlacklist, bool, false);
   DECL_MEDIA_PREF("media.decoder-doctor.wmf-disabled-is-failure", DecoderDoctorWMFDisabledIsFailure, bool, false);
   DECL_MEDIA_PREF("media.wmf.vp9.enabled",                    PDMWMFVP9DecoderEnabled, bool, true);
   DECL_MEDIA_PREF("media.wmf.decoder.thread-count",           PDMWMFThreadCount, int32_t, -1);
   DECL_MEDIA_PREF("media.wmf.allow-unsupported-resolutions",  PDMWMFAllowUnsupportedResolutions, bool, false);
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -6,16 +6,17 @@
 
 #ifndef __FFmpegDecoderModule_h__
 #define __FFmpegDecoderModule_h__
 
 #include "PlatformDecoderModule.h"
 #include "FFmpegLibWrapper.h"
 #include "FFmpegAudioDecoder.h"
 #include "FFmpegVideoDecoder.h"
+#include "MediaPrefs.h"
 
 namespace mozilla {
 
 template <int V>
 class FFmpegDecoderModule : public PlatformDecoderModule
 {
 public:
   static already_AddRefed<PlatformDecoderModule>
@@ -34,21 +35,27 @@ public:
   {
     // Temporary - forces use of VPXDecoder when alpha is present.
     // Bug 1263836 will handle alpha scenario once implemented. It will shift
     // the check for alpha to PDMFactory but not itself remove the need for a
     // check.
     if (aParams.VideoConfig().HasAlpha()) {
       return nullptr;
     }
-    RefPtr<MediaDataDecoder> decoder =
-      new FFmpegVideoDecoder<V>(mLib,
-                                aParams.mTaskQueue,
-                                aParams.VideoConfig(),
-                                aParams.mImageContainer);
+    if (aParams.mOptions.contains(
+          CreateDecoderParams::Option::LowLatency) &&
+        !MediaPrefs::PDMFFVPXLowLatencyEnabled()) {
+      return nullptr;
+    }
+    RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
+      mLib,
+      aParams.mTaskQueue,
+      aParams.VideoConfig(),
+      aParams.mImageContainer,
+      aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency));
     return decoder.forget();
   }
 
   already_AddRefed<MediaDataDecoder>
   CreateAudioDecoder(const CreateDecoderParams& aParams) override
   {
     RefPtr<MediaDataDecoder> decoder =
       new FFmpegAudioDecoder<V>(mLib,
--- a/dom/media/platforms/ffmpeg/FFmpegLibs.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibs.h
@@ -22,16 +22,17 @@ extern "C" {
 #if LIBAVCODEC_VERSION_MAJOR < 55
 #define AV_CODEC_ID_VP6F CODEC_ID_VP6F
 #define AV_CODEC_ID_H264 CODEC_ID_H264
 #define AV_CODEC_ID_AAC CODEC_ID_AAC
 #define AV_CODEC_ID_MP3 CODEC_ID_MP3
 #define AV_CODEC_ID_VP8 CODEC_ID_VP8
 #define AV_CODEC_ID_NONE CODEC_ID_NONE
 #define AV_CODEC_ID_FLAC CODEC_ID_FLAC
+#define AV_CODEC_FLAG_LOW_DELAY CODEC_FLAG_LOW_DELAY
 typedef CodecID AVCodecID;
 #endif
 
 #ifdef FFVPX_VERSION
 enum { LIBAV_VER = FFVPX_VERSION };
 #else
 enum { LIBAV_VER = LIBAVCODEC_VERSION_MAJOR };
 #endif
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -96,22 +96,23 @@ FFmpegVideoDecoder<LIBAV_VER>::PtsCorrec
   mNumFaultyPts = 0;
   mNumFaultyDts = 0;
   mLastPts = INT64_MIN;
   mLastDts = INT64_MIN;
 }
 
 FFmpegVideoDecoder<LIBAV_VER>::FFmpegVideoDecoder(
   FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue, const VideoInfo& aConfig,
-  ImageContainer* aImageContainer)
+  ImageContainer* aImageContainer, bool aLowLatency)
   : FFmpegDataDecoder(aLib, aTaskQueue, GetCodecId(aConfig.mMimeType))
   , mImageContainer(aImageContainer)
   , mInfo(aConfig)
   , mCodecParser(nullptr)
   , mLastInputDts(INT64_MIN)
+  , mLowLatency(aLowLatency)
 {
   MOZ_COUNT_CTOR(FFmpegVideoDecoder);
   // Use a new MediaByteBuffer as the object will be modified during
   // initialization.
   mExtraData = new MediaByteBuffer;
   mExtraData->AppendElements(*aConfig.mExtraData);
 }
 
@@ -138,21 +139,28 @@ FFmpegVideoDecoder<LIBAV_VER>::InitCodec
   if (mInfo.mDisplay.width >= 2048) {
     decode_threads = 8;
   } else if (mInfo.mDisplay.width >= 1024) {
     decode_threads = 4;
   } else if (mInfo.mDisplay.width >= 320) {
     decode_threads = 2;
   }
 
-  decode_threads = std::min(decode_threads, PR_GetNumberOfProcessors() - 1);
-  decode_threads = std::max(decode_threads, 1);
-  mCodecContext->thread_count = decode_threads;
-  if (decode_threads > 1) {
-    mCodecContext->thread_type = FF_THREAD_SLICE | FF_THREAD_FRAME;
+  if (mLowLatency) {
+    mCodecContext->flags |= CODEC_FLAG_LOW_DELAY;
+    // ffvp9 and ffvp8 at this stage do not support slice threading, but it may
+    // help with the h264 decoder if there's ever one.
+    mCodecContext->thread_type = FF_THREAD_SLICE;
+  } else {
+    decode_threads = std::min(decode_threads, PR_GetNumberOfProcessors() - 1);
+    decode_threads = std::max(decode_threads, 1);
+    mCodecContext->thread_count = decode_threads;
+    if (decode_threads > 1) {
+      mCodecContext->thread_type = FF_THREAD_SLICE | FF_THREAD_FRAME;
+    }
   }
 
   // FFmpeg will call back to this to negotiate a video pixel format.
   mCodecContext->get_format = ChoosePixelFormat;
 
   mCodecParser = mLib->av_parser_init(mCodecID);
   if (mCodecParser) {
     mCodecParser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -23,17 +23,18 @@ template <>
 class FFmpegVideoDecoder<LIBAV_VER> : public FFmpegDataDecoder<LIBAV_VER>
 {
   typedef mozilla::layers::Image Image;
   typedef mozilla::layers::ImageContainer ImageContainer;
 
 public:
   FFmpegVideoDecoder(FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue,
                      const VideoInfo& aConfig,
-                     ImageContainer* aImageContainer);
+                     ImageContainer* aImageContainer,
+                     bool aLowLatency);
   virtual ~FFmpegVideoDecoder();
 
   RefPtr<InitPromise> Init() override;
   void InitCodecContext() override;
   const char* GetDescriptionName() const override
   {
 #ifdef USING_MOZFFVPX
     return "ffvpx video decoder";
@@ -87,13 +88,14 @@ private:
     int64_t mLastPts;      /// PTS of the last frame
     int64_t mLastDts;      /// DTS of the last frame
   };
 
   PtsCorrectionContext mPtsContext;
   int64_t mLastInputDts;
 
   DurationMap mDurationMap;
+  const bool mLowLatency;
 };
 
 } // namespace mozilla
 
 #endif // __FFmpegVideoDecoder_h__
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -24,16 +24,17 @@ H264Converter::H264Converter(PlatformDec
   , mKnowsCompositor(aParams.mKnowsCompositor)
   , mImageContainer(aParams.mImageContainer)
   , mTaskQueue(aParams.mTaskQueue)
   , mDecoder(nullptr)
   , mGMPCrashHelper(aParams.mCrashHelper)
   , mLastError(NS_OK)
   , mType(aParams.mType)
   , mOnWaitingForKeyEvent(aParams.mOnWaitingForKeyEvent)
+  , mDecoderOptions(aParams.mOptions)
 {
   CreateDecoder(aParams.mDiagnostics);
 }
 
 H264Converter::~H264Converter()
 {
 }
 
@@ -205,17 +206,18 @@ H264Converter::CreateDecoder(DecoderDoct
   mDecoder = mPDM->CreateVideoDecoder({
     mUseOriginalConfig ? mOriginalConfig : mCurrentConfig,
     mTaskQueue,
     aDiagnostics,
     mImageContainer,
     mKnowsCompositor,
     mGMPCrashHelper,
     mType,
-    mOnWaitingForKeyEvent
+    mOnWaitingForKeyEvent,
+    mDecoderOptions
   });
 
   if (!mDecoder) {
     mLastError = NS_ERROR_FAILURE;
     return NS_ERROR_FAILURE;
   }
 
   mUseOriginalConfig = false;
--- a/dom/media/platforms/wrappers/H264Converter.h
+++ b/dom/media/platforms/wrappers/H264Converter.h
@@ -103,13 +103,14 @@ private:
   RefPtr<GMPCrashHelper> mGMPCrashHelper;
   Maybe<bool> mNeedAVCC;
   nsresult mLastError;
   bool mNeedKeyframe = true;
   // Set to true once a decoder has been created.
   bool mUseOriginalConfig = true;
   const TrackInfo::TrackType mType;
   MediaEventProducer<TrackInfo::TrackType>* const mOnWaitingForKeyEvent;
+  const CreateDecoderParams::OptionSet mDecoderOptions;
 };
 
 } // namespace mozilla
 
 #endif // mozilla_H264Converter_h
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -356,16 +356,17 @@ pref("media.wmf.disable-d3d9-for-dlls", 
 pref("media.ffmpeg.enabled", false);
 #else
 pref("media.ffmpeg.enabled", true);
 #endif
 pref("media.libavcodec.allow-obsolete", false);
 #endif
 #if defined(MOZ_FFVPX)
 pref("media.ffvpx.enabled", true);
+pref("media.ffvpx.low-latency.enabled", false);
 #endif
 pref("media.gmp.decoder.enabled", false);
 pref("media.gmp.decoder.aac", 0);
 pref("media.gmp.decoder.h264", 0);
 #ifdef MOZ_RAW
 pref("media.raw.enabled", true);
 #endif
 pref("media.ogg.enabled", true);