The AudioTrimmer change is to properly implement a behaviour Gecko has about
the DiscardPadding WebM element. If it's invalid (negative, present more than
once, spanning multiple packets), the decoder is supposed to reject the file.
This is tested by the files:
invalid-discard_on_multi_blocks.webm
invalid-excess_discard.webm
invalid-excess_neg_discard.webm
invalid-neg_discard.webm
in test_invalid_reject.html.
Since the demuxer now handles those trimming concerns, we simply flag the packet
has needing to be rejected, by making it have an duration that's a
TimeUnit::Invalid(), and letting the AudioTrimmer reject it.
The rest is straightforward.
Differential Revision: https://phabricator.services.mozilla.com/D181523
The AudioTrimmer change is to properly implement a behaviour Gecko has about
the DiscardPadding WebM element. If it's invalid (negative, present more than
once, spanning multiple packets), the decoder is supposed to reject the file.
This is tested by the files:
invalid-discard_on_multi_blocks.webm
invalid-excess_discard.webm
invalid-excess_neg_discard.webm
invalid-neg_discard.webm
in test_invalid_reject.html.
Since the demuxer now handles those trimming concerns, we simply flag the packet
has needing to be rejected, by making it have an duration that's a
TimeUnit::Invalid(), and letting the AudioTrimmer reject it.
The rest is straightforward.
Differential Revision: https://phabricator.services.mozilla.com/D181523
This expands on existing checks when getting a webms buffered intervals. The
additional check ensures we don't end up with end < start due to our code that
clamps end at duration.
This patch moves those checks into their own helper function so as to reduce
clutter in GetBuffered.
Differential Revision: https://phabricator.services.mozilla.com/D111152
This makes Gecko build again. I'll squash this into the previous commit anyhow.
Differential Revision: https://phabricator.services.mozilla.com/D60324
--HG--
extra : moz-landing-system : lando
We should always append sample by using `AppendSample()` to assert whether a sample is valid, so making `mSamples` private can prevent a direct usage of the nsTarry's `AppendElement()`.
Also provide a method to return non-const mSamples which is only used for the move semantics.
Differential Revision: https://phabricator.services.mozilla.com/D38427
--HG--
extra : moz-landing-system : lando
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
Mostly-mechanical additions:
- Log constructions&destructions, usually by just inheriting from
DecoderDoctorLifeLogger, otherwise with explicit log commands (for internal
classes for which DecoderDoctorTraits can't be specialized),
- Log links between most objects, e.g.: Media element -> decoder -> state
machine -> reader -> demuxer -> resource, etc.
And logging some important properties and events (JS events, duration change,
frames being decoded, etc.)
More will be added later on, from just converting MOZ_LOGs, and as needed.
MozReview-Commit-ID: KgNhHSz35t0
--HG--
extra : rebase_source : dd7206e350e32671adc6f3b9e54ebf777251de2c
The only actual code use in MediaSourceDemuxer can trivially be folded into
its caller GetNumberTracks in the same class.
MozReview-Commit-ID: E6zh98zmJwJ
--HG--
extra : rebase_source : 9358dc37523d6cd7c1a4d5ec62a790db6a092063
The nsRect.h and nsSize.h headers typedef nsIntRect to gfx::IntRect etc, so the
rect/size objects we use will be the same, just under a different name.
However the old headers #include a bunch of things we don't use, so we if we
use the gfx objects directly we end up with a smaller include graph.
MozReview-Commit-ID: 7S4OSqBJK9m
--HG--
extra : rebase_source : 7cc48507356ce754e8395af957fa68a28711e00a
This was working because of our unified build, but having
the correct definitions for all types used by the header
helps editor navigation tools.
MozReview-Commit-ID: LuWEeTIikla
--HG--
extra : rebase_source : 0046ec17ac45270adc771bd0cf77c8381f99737b
This simplifies the comparison and update logic.
MozReview-Commit-ID: A6YII8tlEUn
--HG--
extra : rebase_source : e225b34f91e12591d5872121e024ef29c63a11e0
This simplifies the comparison and update logic.
MozReview-Commit-ID: A6YII8tlEUn
--HG--
extra : rebase_source : ddf4304298209e515eb44962e8bc9ccd38c9956f
into TrackInfoSharedPtr to better indicate what this class is about.
Adding cast operator to allow transparent conversion from TrackInfoSharedPtr to const TrackInfo*
MozReview-Commit-ID: 6RwXl5CG0fG
--HG--
extra : rebase_source : b5a7a0f06793c609e2eab60aacc4f76d96d6ec32
Fixed coding style of files encountered in P1 and P2.
MozReview-Commit-ID: LApVu9K2oto
--HG--
extra : rebase_source : e3bb296baaec9df2011ff312fec2eda19dd125e6
Thanks to the previous patch, MediaDataDemuxer::Seek and
SkipToNextRandomAccessPoint (and all overrides in derived demuxers) can now
take their TimeUnit parameter by const&.
MozReview-Commit-ID: 6CqfjAXZ7Yk
--HG--
extra : rebase_source : c3453e4432d9e0281cf5eba55217b0c1d6312f5b
Both the WebM and mp4 demuxers need to pack this value into
the the CodecSpecificConfig, so move the shared implementation
to the OpusDecoder, near where it is unpacked so the two can
be kept in sync.
MozReview-Commit-ID: 2pQaruJoAWr
- WebMDemuxer will read crypto information from WebM metadata.
- WebMDemumer adds crypto information to samples.
- WebMDemuxer can now return encryption info from GetCrypto().
- WebMDexmuer will not attempt to peek encrypted frames as it
will give back garbage data. This means resolution changes
internal to encrypted WebM files will not work.
- WebMDecoder now exposes a single string version of
CanHandleMediaType. This is done in the same way as the
Mp4Decoder, so that the future update to MediaKeySystemAccess
for WebM handling can maintain the same conventions.
MozReview-Commit-ID: CU3JVi3t7Vn
--HG--
extra : transplant_source : %87gn%5Bm%B5t%EA%9F%5Bh%B4%3B%9D%5E%AE%AB%AF%12%0A
Bug 1224973 added a new usage of the MediaDataDemuxer where we would seek only inside the video track. So we can't use a common nestegg context for demuxing both the audio and video.
So instead we now use two different nestegg context.
MozReview-Commit-ID: 4G86Na5abe2
--HG--
extra : rebase_source : 4f296a649f73ef2f37a770db2c8a0f7f0e5c54a2
We want to add MediaRawDataQueue aOther at the front, not at the back.
MozReview-Commit-ID: 9icTWzRqS4u
--HG--
extra : rebase_source : 2713cbe952461c520a420925040be2de257f0596
Same after a reset or the first frame ever returned by the demuxer.
MozReview-Commit-ID: 6b7XlIk5GE4
--HG--
extra : rebase_source : 7e7b92c2ed7ea6973ad3869477b3110925a64525
Update the WebMDemuxer to detect changes in resolution. When it does so it
changes the streamID so that we get a new decoder created to handle the
resolution change. The demuxer will also update media info in these cases, so
the new decoder has the correct information. The demuxer will only handle
resolution changes on key frames, files that attempt changes other times are not
considered valid at this stage. If a resolution change cannot be performed
because nest_egg cannot read track info, or because the new resolution is
invalid, a change will not take place.
MozReview-Commit-ID: 1JKz3mGbEvi
--HG--
extra : rebase_source : aebd609651dfbd48d2f6ea3e33986a7e12b1495e
MediaDecoder previously had 3 states within GetSeekable(), media is either
seekable, seekable but not supported by transport, or not seekable. Due to
changes to make cueless webms playable, a 4th option is needed: a file that is
not fully seekable, but may support seeking from the transport, such as these
webms, should only be seekable in the buffered range.
MozReview-Commit-ID: ISeFkngtrGU
In the one place we push a MediaRawDataQueue onto a MediaRawDataQueue,
we don't use the pushee aftewards. It's more efficient to indicate that
by using Move(), and we can then save on reference-counting things
needlessly.
Sometimes when we push onto the queue, we don't need to hold a reference
afterwards. In that case, we can pass the reference in and avoid
unnecessary reference counting.
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