This adds support for HTMLMediaElement.mozCaptureStream() and
mozCaptureStreamUntilEnded() for a HTMLMediaElement playing a MediaStream.
This is up to spec, while capturing a HTMLMediaElement playing a file is not.
This incompatibility means we cannot mix sources for the returned MediaStream.
As such, a MediaStream returned while the HTMLMediaElement was playing a file
will only have content while the element is playing files. If the src changes
to a MediaStream, the stream will be empty.
It works the same way if a MediaStream was captured while the HTMLMediaElement
was playing another MediaStream.
This is due to TrackID management - MediaDecoder doesn't care, and creates new
tracks when you seek, so users are unable to keep track, while for MediaStream
we control everything from main thread and keep track of the TrackIDs used
previously.
This also adds a separate path from MediaElementAudioSourceNode so that we don't
forward video tracks when the returned MediaStream is only used internally for
WebAudio. We should in that case not require a DOMMediaStream but just forwarding
tracks to a TrackUnionStream should be enough, and will save us some cpu cycles.
This is however fine for now as it's simpler.
MozReview-Commit-ID: Bg8hESDISDU
--HG--
extra : rebase_source : 83885a73ec8cfc5fbe3c30a9330a52cd6b6dff12
extra : source : f1aec79078869c0a6435a1c06957c649d7a40dd9
Sometimes a track is added to a stream synchronously (before the stream is
exposed to script), and sometimes asynchronously (see the mediacapture-main spec
on the "addtrack" event).
In the latter case we might still need to create the MediaStreamTrack object
synchronously for tracking purposes. CaptureStream of Media element playing a
MediaStream wants this.
MozReview-Commit-ID: 7me8xzN7rwj
--HG--
extra : rebase_source : 4f129b127b855e47aad2ae9ab3981ffde057412d
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.
The patch also does some associated clean-up.
- Replaces some uses of nsIMemoryReporterCallback with the preferred
nsIHandleReportCallback typedef.
- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
parameter names, for consistency.
- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.
- Uses the MOZ_COLLECT_REPORT macro in all suitable places.
Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.
--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
This updates mLastComputedValue when removing events during the call to
CleanupEventsOlderThan.
MozReview-Commit-ID: 1Veyv8kLIna
--HG--
extra : rebase_source : 9ee9aeb458b60316f93616e3310ad26f9e85e79c
This patch makes the following changes on many in-class methods.
- NS_IMETHODIMP F() override; --> NS_IMETHOD F() override;
- NS_IMETHODIMP F() override {...} --> NS_IMETHOD F() override {...}
- NS_IMETHODIMP F() final; --> NS_IMETHOD F() final;
- NS_IMETHODIMP F() final {...} --> NS_IMETHOD F() final {...}
Using NS_IMETHOD is the preferred way of marking in-class virtual methods.
Although these transformations add an explicit |virtual|, they are safe --
there's an implicit |virtual| anyway because |override| and |final| only work
with virtual methods.
--HG--
extra : rebase_source : 386ee4e4ea2ecd8d5001efabc3ac87b4d6c0659f
We need to update mLastComputedValue while processing events that occur at the
same time rather than just skipping over them.
MozReview-Commit-ID: LuxSK6PHFHv
--HG--
extra : rebase_source : be323da2a50ea32838aef322267115d153a14c3d
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
Decoders now use FrameStatisticsData to gather data for their frame-related
notifications. This will ease introducing new members later on.
MozReview-Commit-ID: DWdOSPX3JM
--HG--
extra : rebase_source : a3e05f34353a397d1c82b3f4d935c0864f90556e
This will permit allowing the main thread to run while collecting
reports from graph thread objects.
MozReview-Commit-ID: 7xChGz7xJ8M
--HG--
extra : rebase_source : a69dd197bfd3173c9a46979bac35e654d7d0771e
removing some off-main-thread usage of AudioNodeEngine::mNode.
MozReview-Commit-ID: GYgFzPJQjjm
--HG--
extra : rebase_source : 9c4697b27bdfee971d9502c4b0573cdb7c740774
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
Passing infinite values into an AudioParam will trigger an assert in debug
builds. Returning early here mimics the non-debug behaviour of refusing to
insert an event with an infinite value.
MozReview-Commit-ID: BaAtiAnh1s
--HG--
extra : rebase_source : 29b0e9a1f889c96725afb3abb71541e485330433
extra : histedit_source : 9281990becd2fbc934e121675d3075a40158049d
Running the test-case in the bug, and profiling under OSX using Instruments'
time profiler, the time spent in `AudioEventTimeline::ValidateEvent` was the
highest Web Audio API-related function. This patch makes it disappear from the
profile. We already use the same technique on the MSG thread to keep the number
of events low.
MozReview-Commit-ID: GJLPRWBh7nQ
This can reduce the include header dependency. MediaStreamVideoSink will inherit from DirectMediaStreamTrackListener. But we can't use forward declaration on MediaStreamListener because the usage of nsTArray<RefPtr<MediaStreamVideoSink>>.
MozReview-Commit-ID: 328s4Kw9NvW
--HG--
extra : transplant_source : %D2%18%E3%3B%0C%D8%F04%F3%EB%EB%A0%A7%8B%B1%A9%AB%97rY
This means if WebAudio is using the Adobe GMP for decoding and it crashes,
we'll get a crash report for the GMP.
MozReview-Commit-ID: FOZoPxvUwq5
--HG--
extra : rebase_source : 0641e4c46619693b2983a7d7297af525f1ac5bea
with the new variable matching the loop exit status of interest.
MozReview-Commit-ID: 8xy5ipo4trp
--HG--
extra : rebase_source : e951177af0699a550a4fb56a6192720207e74cb2
|bailout| is reset for each aTime, so that the appropriate events for that
time can be found.
The |eventIndex| loop is adjusted so that, when it is re-entered, it keeps
the current set of events if they are appropriate (instead of advancing
every time it is entered).
|previous| and |next| are now advanced even when passing the last event,
removing the special case when past all events.
MozReview-Commit-ID: 8ZSIzKKGQbd
--HG--
extra : rebase_source : bfc899287abaf12d5cdbfbc1b22d6626ab2299dd
This is not necessarily related to the last event and it is not the
previous event.
MozReview-Commit-ID: 6hhv184BHfg
--HG--
extra : rebase_source : 8013606e27a159bb2598217db40df926539227c6
This limits recompilation required when modifying the methods, and
makes the public interface easier to read.
MozReview-Commit-ID: Lo2f7xmIdGu
--HG--
rename : dom/media/webaudio/AudioEventTimeline.h => dom/media/webaudio/AudioEventTimeline.cpp
extra : rebase_source : 75586bb320dd2e5606e691919b1c6a7c48c2065f
The comment was not necessarily true where it was previously positioned.
MozReview-Commit-ID: FMYkGkmuvVS
--HG--
extra : rebase_source : a6ae6958b9486c92c7830fcc334dac66c643dc29
If run against the version of the test using the old equations, 8 of the
26460 values would be larger than the maximum difference threshold, so I
updated the test code to use the new equations as well.
MozReview-Commit-ID: 7gJb8rFQPq1
--HG--
extra : rebase_source : 53e13932e05053355e5f3fe69d06aa007c9314ac
If run against the version of the test using the old equations, 18 of the
26460 values would be larger than the maximum difference threshold, so I
updated the test code to use the new equations as well.
I also had to make a small increase to the maximum allowable glitch for
the tail test.
MozReview-Commit-ID: LrB3HufFWpJ
--HG--
extra : rebase_source : 5b011653b3c0d8a00c2a96185c703b5457058936
Using the division operator on std::complex values fails on our linux64
AWS test machines, yielding infinities and NaNs for valid inputs. Presumably
this could affect machines in the wild as well. This patch removes the use
of the division operator and replaces it with real operations.
MozReview-Commit-ID: 4s7xUf9ja0F
--HG--
extra : rebase_source : 9c1946c812be78aa25845402866795655bfc9af1
extra : source : 4dd3a54d766d9960319f6356064ccdd9d3feda88
Using the division operator on std::complex values fails on our linux64
AWS test machines, yielding infinities and NaNs for valid inputs. Presumably
this could affect machines in the wild as well. This patch removes the use
of the division operator and replaces it with real operations.
MozReview-Commit-ID: 4s7xUf9ja0F
--HG--
extra : rebase_source : cdfee7070a50eefbf8e50aee3993cf8993cd32b4
This is how it was meant to work when the refactor landed in Bug 1208371.
We have no test coverage of seeking apparently.
MozReview-Commit-ID: IhyGbjctO7E
--HG--
extra : rebase_source : 70f1ab777d8f7d6632d24f7134415ad13f73d166
ReverbAccumulationBuffer often produces unaligned buffers due to the way
it wraps around results. This modifies AudioBufferAddWithScale on SSE2
platforms to handle unaligned buffers by performing scalar operations
until both the input and output buffers are aligned to 16 bytes. It then
does as many vector operations as possible and switches back to scalar
operations for anything that is left over.
This could also be done within the ReverbAccumulationBuffer code but doing
it directly within the AudioNodeEngine code makes it available to other
callers in the future, at the cost of a few extra branches in the case
where everything was aligned anyway.
MozReview-Commit-ID: Ky0uIe5LMVq
--HG--
extra : rebase_source : 0c9970807262c8a13be5ad866e470d78ff6c1bb9
Assuming that Bug 1266405 fixed the underlying cause for the unaligned
buffers we were seeing, the checks in AudioBufferAddWithScale and
AudioBlockCopyWithScale shoudl no longer be necessary.
MozReview-Commit-ID: 4OQ4qQVjEP3
--HG--
extra : rebase_source : fda9b1f7604a2732c9dea4985bfd47ce9293bc0f
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.
MozReview-Commit-ID: 1VS4Dney4WX
--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
This fixes some division by zero errors introduced by Bug 1222405 when the
fundamental frequency is zero.
MozReview-Commit-ID: A7qfJjJOJ3H
--HG--
extra : rebase_source : 02506b547c5f78495c449bba9f476d3f42cf7ed0
Rename StreamBuffer to StreamTracks. We still need a place to keep the track information in every MediaStream, even the StreamBuffer::Track::mSegment is empty.
--HG--
rename : dom/media/StreamBuffer.cpp => StreamTracks.cpp
rename : dom/media/StreamBuffer.h => StreamTracks.h
This adds alignment checks to fallback to scalar operations if the
received buffers are not properly aligned. Bug 1266112 is the follow on
to either fix the alignment problem or add a vector path for the aligned
portion of the buffers.
MozReview-Commit-ID: 5HCXzipXlqD
--HG--
extra : rebase_source : 0dff8258c4cc0d468c18267680f053ff1a240ad5
This updates the original SSE2 implementations to match the current
AudioNodeEngine API and adds them to the build.
MozReview-Commit-ID: KULBD7KTr3n
--HG--
extra : rebase_source : 05adf8a26cb33a4b9d9c9d200d3ed8b1831f6995
To be able to use SSE2 routines, we need to audio buffers to be allocated
on 16 byte boundaries.
MozReview-Commit-ID: 2mjxMWqysFd
--HG--
extra : rebase_source : 8bd7d48b767b7bcfa5874061586b9b41c26a18ae
Otherwise we don't get an accurate nr-of-nonzero-samples measurement as
the sources now lock on to a track (main thread) before attaching a
listener.
MozReview-Commit-ID: Jhsr6kgkdcM
--HG--
extra : rebase_source : d94804a601936f456b6bf1b5abc927e9a0bd0329
This lets us know the track's TrackID in the destination stream before
the input port has been processed.
For sanity we only allow mapping to a destination TrackID if the
destination stream does not have any TRACK_ANY input ports already
assigned to it as that can cause intermittent TrackID collisions.
MozReview-Commit-ID: ClFyQl0nYFC
--HG--
extra : rebase_source : 25fa0f34cb4fa9293a572bff03fe005c33be0195
This lets a MediaStreamTrack communicate with its source/producer on the
main thread. It's for now used for stopping a track at the source and
retrieving some metadata, but it could also be a link between actual
sinks of a track and the source, to for instance let the source optimize
by scaling down the resolution when all sinks want lowres-video.
MozReview-Commit-ID: D4SJLr0aqhJ
--HG--
extra : rebase_source : ea511b5c86ca4836bfa980825f04617fef498261
mDestination is cleared during unlink, which means that after that point the
window can't do much with the AudioContext, nor should need to do so.
MozReview-Commit-ID: E45aCpEfJEu
--HG--
extra : rebase_source : cafd502552b7126bcdddc2544c4c28c1b62a701f
The new routine actually multiplies by two for consistency with the other FFT
routines in use.
MozReview-Commit-ID: Hk2Dg3fR2cQ
--HG--
extra : rebase_source : 08bdbbd65d372a3d0eb69568313cec33ccea6af3
We currently rebuild the BandLimitedTables whenever we encounter a lower
fundamental frequency but it is only necessary to rebuild the tables if we
can fit more partials below the Nyquist frequency. Rebuilding the tables
unnecessarily can cause performance problems, particularly in the case where
the frequency is continually lowered.
--HG--
extra : rebase_source : e53c773d53f723d5b34270d6214a5812ec1eb7f0