Performing all audio processing operations in the same place, allows to simplify the code.
Additionally, if accessibility.monoaudio.enable is not set, we always upmix mono to stereo so that if the first audio stream seen was mono, we aren't stuck playing all future streams in mono.
MozReview-Commit-ID: 5yANN6PLFhX
--HG--
extra : rebase_source : f40dfacc9fc323794325de0431c4958854012180
We attempt to avoid unnecessary resampling of 44.1kHz and 48kHz content, for all others we use cubeb's preferred sampling rate as final sampling rate.
MozReview-Commit-ID: 413qnsDFHzY
--HG--
extra : rebase_source : a469cb7269be48bfbca82fbbd90c3e2caf21b9a7
The audio is automatically converted to always match the format of the first processed sample.
This is a temporary approach, as it would be preferred to use a final sampling rate not causing too much quality loss.
MozReview-Commit-ID: Lo3827aon43
--HG--
extra : rebase_source : 51322d12415995bd5ba7d8a25500860f333c9c3e
This will allow to easily detect audio configuration change prior immediate playback.
MozReview-Commit-ID: IwDUGOd17ND
--HG--
extra : rebase_source : 3af32634eb431661436bf1d3aaeb80124b229716
Performing all audio processing operations in the same place, allows to simplify the code.
Additionally, if accessibility.monoaudio.enable is not set, we always upmix mono to stereo so that if the first audio stream seen was mono, we aren't stuck playing all future streams in mono.
MozReview-Commit-ID: 5yANN6PLFhX
We attempt to avoid unnecessary resampling of 44.1kHz and 48kHz content, for all others we use cubeb's preferred sampling rate as final sampling rate.
MozReview-Commit-ID: 413qnsDFHzY
The audio is automatically converted to always match the format of the first processed sample.
This is a temporary approach, as it would be preferred to use a final sampling rate not causing too much quality loss.
MozReview-Commit-ID: Lo3827aon43
Performing all audio processing operations in the same place, allows to simplify the code.
Additionally, if accessibility.monoaudio.enable is not set, we always upmix mono to stereo so that if the first audio stream seen was mono, we aren't stuck playing all future streams in mono.
MozReview-Commit-ID: 5yANN6PLFhX
--HG--
extra : rebase_source : c789ba66fa168bc11064b2a329311d90b046c7fc
We attempt to avoid unnecessary resampling of 44.1kHz and 48kHz content, for all others we use cubeb's preferred sampling rate as final sampling rate.
MozReview-Commit-ID: 413qnsDFHzY
--HG--
extra : rebase_source : 2c783be7f6d2ccaab88cee70372905ea92b690f4
The audio is automatically converted to always match the format of the first processed sample.
This is a temporary approach, as it would be preferred to use a final sampling rate not causing too much quality loss.
MozReview-Commit-ID: Lo3827aon43
--HG--
extra : rebase_source : d8de2c85de5a78c2d1a17201a9d0c418ce3312e4
This will allow to easily detect audio configuration change prior immediate playback.
MozReview-Commit-ID: IwDUGOd17ND
--HG--
extra : rebase_source : 37e9e19a58d2e90b107eaf63a2ac19233c521033
Using the gfxprefs for the time being, in order to access the preferences outside of the main thread.
It will allow to easily test future cubeb changes to support change of sampling rate / multichannels.
MozReview-Commit-ID: 2Qvq4zAtzCL
--HG--
extra : rebase_source : 46e272ca46ceb35b8e97b62cd1d2be949ba054f2
Rather than performing the audio processing a few frames at a time, we perform the operation when popping the audio data block.
The only downmixing task left to AudioStream is to handle the force mono preference.
Resampling is currently disabled.
MozReview-Commit-ID: GNQA1h0xcp7
--HG--
extra : rebase_source : c58aa4514a0dc4de06be6dc1da6a598742caa262
PrincipalHandle is a thread safe pointer to a holder of (the main-thread-only
nsIPrincipal) that can be passed around the MSG.
A MediaStreamTrack whose source has just updated its principal, sets the new
principal aside (as its "pending principal"), and combines the new principal
into its current principal.
Then the source starts passing the new principal to the MediaStreamGraph as
a PrincipalHandle.
Changes to a track's PrincipalHandle on the MSG will be surfaced through the
MediaStreamTrackListener API. These changes are dispatched to main thread
and compared to a MediaStreamTrack's pending principal. In case of a match
the track knows the correct principal is flowing and can move the pending
principal to be the current principal and update any main thread principal
observers.
MozReview-Commit-ID: D0JXGWhQFFU
--HG--
extra : rebase_source : 296e269bb46fc5a85a9c3f90dfc0dc40e53572bc
This is a partial reversal of bug 1230338. We can't distinguish frames that are never composited because the media element is hidden from the frames genuinely dropped due to machine slowness. So until we can distinguish them, let's not report them as dropped.
MozReview-Commit-ID: ERV8Luaxp3F
The way we pass in AudioDataValue arrays into AudioData is non-uniform:
sometimes we have nsAutoArrayPtrs, sometimes we don't, and it's not
immediately obvious from the function signature of the constructor that
we're actually taking ownership of this array. Let's fix that by using
UniquePtr<AudioDataValue[]> smart pointers to hold the data prior to
creating AudioData values, and for passing in to AudioData's
constructor. Using standard-er C++ things instead of our homegrown ones
is a good thing.
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
This commit was generated using the following script, executed at the
top level of a typical source code checkout.
# Don't modify select files in mfbt/ because it's not worth trying to
# tease out the dependencies currently.
#
# Don't modify anything in media/gmp-clearkey/0.1/ because those files
# use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
grep -v 'mfbt/RefPtr.h' | \
grep -v 'mfbt/nsRefPtr.h' | \
grep -v 'mfbt/RefCounted.h' | \
grep -v 'media/gmp-clearkey/0.1/' | \
xargs perl -p -i -e '
s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#; # handle strange #includes
'
# |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'
# RefPtr.h used |byRef| for dealing with COM-style outparams.
# nsRefPtr.h uses |getter_AddRefs|.
# Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
They should just run in realtime since we're getting rid of blocking.
--HG--
extra : commitid : K0MeENZ5JAa
extra : rebase_source : ed3cd908faa96fd4dab2f178836449774f085d27
We don't want to block stream decoding on the output MediaStream, or vice
versa.
--HG--
extra : commitid : 7YVsark1y97
extra : rebase_source : 81ab806d4ab93a2b4077fff27587014d5d04fa0f
Note AudioSinkWrapper can now report correct playback position when the media is video-only or audio-only.
We will handle the case where audio ends before video in next patch where it needs to switch to system clock when audio reaches the end.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973