mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
8a998d9134
In websites such as Facebook Live, timeout chains are used to drive the playback of a video or something similar in JavaScript. Throttling the minimum timeout values a tab playing a video from such websites in the background could make the timeout based scheduling of video playback to not work correctly, and cause audio buffer under-runs that are audible. In order to address this, other major browsers don't throttle timeouts in tabs that are playing audio. This brings us to parity to other browsers (even though we already do this for websites that use Web Audio since we've had similar bug reports using the Web Audio API.) The current audio agent setup that drives the tab audio notification icons is currently tracking whether a Window is playing audio. We use this setup to decide whether to throttle timeouts when a window goes into background.
139 lines
3.5 KiB
Python
139 lines
3.5 KiB
Python
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
# vim: set filetype=python:
|
|
# 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/.
|
|
|
|
with Files('*'):
|
|
BUG_COMPONENT = ('Core', 'Web Audio')
|
|
|
|
DIRS += ['blink']
|
|
|
|
TEST_DIRS += ['gtest']
|
|
|
|
MOCHITEST_MANIFESTS += [
|
|
'test/blink/mochitest.ini',
|
|
'test/mochitest.ini',
|
|
]
|
|
|
|
TEST_HARNESS_FILES.testing.mochitest.tests.dom.media.webaudio.test.blink += [
|
|
'test/blink/audio-testing.js',
|
|
'test/blink/convolution-testing.js',
|
|
'test/blink/panner-model-testing.js',
|
|
]
|
|
|
|
EXPORTS += [
|
|
'AlignedTArray.h',
|
|
'AudioBlock.h',
|
|
'AudioEventTimeline.h',
|
|
'AudioNodeEngine.h',
|
|
'AudioNodeExternalInputStream.h',
|
|
'AudioNodeStream.h',
|
|
'AudioParamTimeline.h',
|
|
'MediaBufferDecoder.h',
|
|
'ThreeDPoint.h',
|
|
'WebAudioUtils.h',
|
|
]
|
|
|
|
EXPORTS.mozilla += [
|
|
'FFTBlock.h',
|
|
'MediaStreamAudioDestinationNode.h',
|
|
]
|
|
|
|
EXPORTS.mozilla.dom += [
|
|
'AnalyserNode.h',
|
|
'AudioBuffer.h',
|
|
'AudioBufferSourceNode.h',
|
|
'AudioContext.h',
|
|
'AudioDestinationNode.h',
|
|
'AudioListener.h',
|
|
'AudioNode.h',
|
|
'AudioParam.h',
|
|
'AudioProcessingEvent.h',
|
|
'AudioScheduledSourceNode.h',
|
|
'BiquadFilterNode.h',
|
|
'ChannelMergerNode.h',
|
|
'ChannelSplitterNode.h',
|
|
'ConstantSourceNode.h',
|
|
'ConvolverNode.h',
|
|
'DelayNode.h',
|
|
'DynamicsCompressorNode.h',
|
|
'GainNode.h',
|
|
'IIRFilterNode.h',
|
|
'MediaElementAudioSourceNode.h',
|
|
'MediaStreamAudioDestinationNode.h',
|
|
'MediaStreamAudioSourceNode.h',
|
|
'OscillatorNode.h',
|
|
'PannerNode.h',
|
|
'PeriodicWave.h',
|
|
'ScriptProcessorNode.h',
|
|
'StereoPannerNode.h',
|
|
'WaveShaperNode.h',
|
|
]
|
|
|
|
UNIFIED_SOURCES += [
|
|
'AnalyserNode.cpp',
|
|
'AudioBlock.cpp',
|
|
'AudioBuffer.cpp',
|
|
'AudioBufferSourceNode.cpp',
|
|
'AudioContext.cpp',
|
|
'AudioDestinationNode.cpp',
|
|
'AudioEventTimeline.cpp',
|
|
'AudioListener.cpp',
|
|
'AudioNode.cpp',
|
|
'AudioNodeEngine.cpp',
|
|
'AudioNodeExternalInputStream.cpp',
|
|
'AudioNodeStream.cpp',
|
|
'AudioParam.cpp',
|
|
'AudioProcessingEvent.cpp',
|
|
'AudioScheduledSourceNode.cpp',
|
|
'BiquadFilterNode.cpp',
|
|
'BufferDecoder.cpp',
|
|
'ChannelMergerNode.cpp',
|
|
'ChannelSplitterNode.cpp',
|
|
'ConstantSourceNode.cpp',
|
|
'ConvolverNode.cpp',
|
|
'DelayBuffer.cpp',
|
|
'DelayNode.cpp',
|
|
'DynamicsCompressorNode.cpp',
|
|
'FFTBlock.cpp',
|
|
'GainNode.cpp',
|
|
'IIRFilterNode.cpp',
|
|
'MediaBufferDecoder.cpp',
|
|
'MediaElementAudioSourceNode.cpp',
|
|
'MediaStreamAudioDestinationNode.cpp',
|
|
'MediaStreamAudioSourceNode.cpp',
|
|
'OscillatorNode.cpp',
|
|
'PannerNode.cpp',
|
|
'PeriodicWave.cpp',
|
|
'ScriptProcessorNode.cpp',
|
|
'StereoPannerNode.cpp',
|
|
'ThreeDPoint.cpp',
|
|
'WaveShaperNode.cpp',
|
|
'WebAudioUtils.cpp',
|
|
]
|
|
|
|
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
|
|
SOURCES += ['AudioNodeEngineNEON.cpp']
|
|
SOURCES['AudioNodeEngineNEON.cpp'].flags += CONFIG['NEON_FLAGS']
|
|
LOCAL_INCLUDES += [
|
|
'/media/openmax_dl/dl/api/'
|
|
]
|
|
|
|
# Are we targeting x86 or x64? If so, build SSE2 files.
|
|
if CONFIG['INTEL_ARCHITECTURE']:
|
|
SOURCES += ['AudioNodeEngineSSE2.cpp']
|
|
DEFINES['USE_SSE2'] = True
|
|
SOURCES['AudioNodeEngineSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
|
|
|
|
|
|
include('/ipc/chromium/chromium-config.mozbuild')
|
|
|
|
FINAL_LIBRARY = 'xul'
|
|
LOCAL_INCLUDES += [
|
|
'..'
|
|
]
|
|
|
|
if CONFIG['GNU_CXX']:
|
|
CXXFLAGS += ['-Wno-error=shadow']
|