Note SharedInfo contains an array to store the original and cloned resources.
This allows us to iterate over resources on the main thread without taking the
cache monitor.
MozReview-Commit-ID: K3gcPYbf72Z
--HG--
extra : rebase_source : eaa070a889797c29d2599b4c3d2507f440d476e7
extra : source : 5dc420815d7a26771c176cdc7b6a87a1c2278da8
This adds a scaling factor of 0.5 even when normalization is
disabled, which is required for correct results.
MozReview-Commit-ID: J0VbMcaacGc
--HG--
extra : rebase_source : 1a8e2dd21a6a48a02fbafda994e42b59c5761ea4
To be consistent with other functions.
MozReview-Commit-ID: 1adZkXx2VkB
--HG--
extra : rebase_source : b7c420c717ffc95feb73749305fd25e3bba12ae1
extra : intermediate-source : a7a9f6ae0a0291c76f2eee0e89f57684df98a061
extra : source : 9055561c3203e06c0e2d6d0daaa76f3e85dc1b2c
GetOwner()->DownloadProgressed() will update readyState of the media element
which will need to read mCanPlayThrough.
MozReview-Commit-ID: EDHlLJjKDoL
--HG--
extra : rebase_source : df4ffabc02f9e6b4b20e5fa6c9be6988570a9974
extra : intermediate-source : 371a6509c04bf89edb07b3437a41a9b36dba25ff
extra : source : 227ffb87de637994baefab6b178afeae4673a2ef
Note we cache the result of GetStatistics().CanPlayThrough() which is needed
by CanPlayThroughImpl().
MozReview-Commit-ID: QYNqk1pUN5
--HG--
extra : rebase_source : e4ce549f1069fd3106da4f68dcb429afa291aa5d
extra : intermediate-source : 9d7c532bdad7733bc3f9e725feecd83bea1ab156
extra : source : b552dad39a644026eb0d62e7e975c4120e550447
This will be used by ChannelMediaDecoder to run some code off the main thread.
MozReview-Commit-ID: 7Ecej11GBvy
--HG--
extra : rebase_source : aeafd934cb76d426d3c4f49ebd0736b013cbe588
extra : intermediate-source : 5cb1e7b389daf48c77c2e0bf632cefaeff5a2b40
extra : source : 813e6593f8e9772895df7acb353dbf0137008bb0
When looping videos in a background tab, SeekingState::Enter() will switch off
blank decoder and then DecodingState::Enter() will switch it on again. It is a
waste of CPU cycles when the tab never goes to the foreground. The overhread is
even more significant when looping short files.
We should resume video decoding only when necessary that is we check in
DecodingState::Enter() to see if mVideoDecodeSuspended matches mVideoDecodeMode.
MozReview-Commit-ID: 54vq7mEjWQf
--HG--
extra : rebase_source : ce04310d06df2effd65d8c301e07c7fef01bdbd1
extra : intermediate-source : 83dff897174fb440e5da24843186ff9fd39d15c9
extra : source : d0834777c96255e15dc44d1865bd354ab67ec8fe
Usually mDecoderPosition and mPlaybackPosition are in the same cached range so
GetCachedDataEnd(mDecoderPosition) and GetCachedDataEnd(mPlaybackPosition) will
give the same result.
It also makes more sense to pass the playback position instead of decoder
position since 'canplaythrough' is about playback instead of decoding.
MozReview-Commit-ID: Kk1uUeSFTCI
--HG--
extra : rebase_source : 1f40adce4b93dbcf55cb3de9f5c16fdd6d0b6bee
extra : source : 9c77dddb2faca84bd8cf09fc2007e18986e62f64
The reason explained in patch Part1 of Bug 1214018 and I just copy the reason below.
GetRawMachineId was returning its generated data through a 'string16', which on
Windows was conveniently equivalent to a std::wstring.
However on Mac, wstring uses 32-bit characters, so in order to comply with the
string16 interface, a lot of non-trivial code would have to be imported and
vetted.
Also, in the end GMPLoader::Load passes this string16 to SHA256_Update() as a
sequence of bytes, the actual type of the data is lost!
So to simplify this work, GetRawMachineId will now return its data through a
vector of bytes, and the platform-dependent implementations may use whatever
data type they want internally.
The Windows GetRawMachineId actually returns the same data in this vector, so
it stays compatible with the previous code.
MozReview-Commit-ID: 7xYgjndXWDX
--HG--
extra : rebase_source : 6a46bd7f06d6e4bc10bb98b600e7e5bc14c136ce
Chromium uses rlz_lib::GetMachineId as a factor when calculating storage id.
MozReview-Commit-ID: AJbcnRXzi3m
--HG--
extra : rebase_source : 4e6a0eebaeec01fc7a78caeb8406d1e2ed09f1d4
Sync with the upstream(Chromium src/rlz/) and try to revert the functionality of Bug 1332530.
rlz is linked into xul.
MozReview-Commit-ID: HsjnBRPnifh
--HG--
extra : rebase_source : 2867fe353d0c8c67535d29943f3536ef59d1d75e
We need to feed deinterleaved data, not interleaved data.
MozReview-Commit-ID: 99z8HA7tJgT
--HG--
extra : rebase_source : eb61b602630008683c6afdd2aad1dca0d663db86
extra : intermediate-source : 2d718ca90e07d9dfc71e86434cb04c5580405f9f
extra : source : 3ba7fe1cddec0a3dcaaf526a85b7f34072c3e199
This brings in a lot of noise and makes the test fail.
MozReview-Commit-ID: 70EGM1q1J24
--HG--
extra : rebase_source : cab81fdfd53c537c04f1d2360a9340a3740b66a0
extra : source : c02fd9acc634860ef540a0cddb1591f294fc1f61
This also is long, but simple.
First, we switch to floats everywhere. This allows to work with any rate, is
more flexible with channel layout, and is a stable API (see audio_processing.h
in webrtc.org).
Then, 10ms worth of audio (already at the graph rate) are poped from the
lock-free queue (fed on the other end by the MSG mixer), and does the following:
- Down mixing to stereo (if needed)
- De-interleaving into planar buffer
- Prepare input and output config
- Actually make the API call
- Free the data
Now, first, we should use a ring buffer, and not have to free any data. Then we
also should not use a lock-free queue, and synchronously process the
reverse-stream, but this is enough code already.
Then, the actual mic data processing:
- Pop a packet from the packetizer (that gives us 10ms worth of audio, note that
we switch from int16_t to float, i.e. we don't do this conversion anymore).
- We convert to planar buffers, deinterleaving
- Prepare input and output config
- Allocate a SharedBuffer of the right size
- Process the data with the processing algorithm selected in UpdateSingleSource
- Append to the a MediaSegment, and append to the right MediaStreamTrack for the
correct SourceMediaStream (the data is already planar and all well).
MozReview-Commit-ID: 2IjgHP0GAmw
--HG--
extra : rebase_source : 1e08c4a781db8778e0532f9ef1a8e369513a2c66
extra : source : 0107b3feb84bbe0e643f505ec58e303dfd94e1a7
This part is about setting on/off audio processing feature. It's long, but
it's mostly mechanichal changes, from the old API to the new one.
This also covers reseting the processing in case of device changes (with
macros).
MozReview-Commit-ID: EI2TxHRicEr
--HG--
extra : rebase_source : 5c389e00019633d371d74cdd2d881dab4d353848
extra : source : 2c7a56648de9125ae1893d54ec011b6cbb181d86
This needs the next patches to build fine, but is split out for the review.
A side effect of this patch is to break non-duplex, making the whole
init/cleanup phase much simpler.
MozReview-Commit-ID: Caqc8v7CWwZ
--HG--
extra : rebase_source : 604551cc937ee60064a263ebb5fb1550fa9a9e9f
extra : source : a781b123b252b464f805674144cc01d9dd69c391
This is "just" for testing, but is cleaner, and skips some resampling, and is in
line with the other patches, to converge with always using MSG rate when we can.
MozReview-Commit-ID: CBQHEDQWJE3
--HG--
extra : rebase_source : 9cc113efbaa982c20d62c2863ce231dda4735257
extra : source : bf8977e0f440c0280da32a7052214834dc6701ca
mDecodedAudioDuration should only save unadjusted timestamp, or it would
cause next adjustment to be incorrect.
MozReview-Commit-ID: 7grtYs075p0
--HG--
extra : rebase_source : ad146e7c34b6154629c1ff98992d5c0209d3ef80
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.
--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
We need to feed deinterleaved data, not interleaved data.
MozReview-Commit-ID: 99z8HA7tJgT
--HG--
extra : rebase_source : 686295cead6632688d7dc130b7904bf771b10bc3
This brings in a lot of noise and makes the test fail.
MozReview-Commit-ID: 70EGM1q1J24
--HG--
extra : rebase_source : f19c191747f2e63303406a43a79454e4ea1ed428
extra : histedit_source : f27d34204de924ab30b5718b240ac3d23677991c
This also is long, but simple.
First, we switch to floats everywhere. This allows to work with any rate, is
more flexible with channel layout, and is a stable API (see audio_processing.h
in webrtc.org).
Then, 10ms worth of audio (already at the graph rate) are poped from the
lock-free queue (fed on the other end by the MSG mixer), and does the following:
- Down mixing to stereo (if needed)
- De-interleaving into planar buffer
- Prepare input and output config
- Actually make the API call
- Free the data
Now, first, we should use a ring buffer, and not have to free any data. Then we
also should not use a lock-free queue, and synchronously process the
reverse-stream, but this is enough code already.
Then, the actual mic data processing:
- Pop a packet from the packetizer (that gives us 10ms worth of audio, note that
we switch from int16_t to float, i.e. we don't do this conversion anymore).
- We convert to planar buffers, deinterleaving
- Prepare input and output config
- Allocate a SharedBuffer of the right size
- Process the data with the processing algorithm selected in UpdateSingleSource
- Append to the a MediaSegment, and append to the right MediaStreamTrack for the
correct SourceMediaStream (the data is already planar and all well).
MozReview-Commit-ID: 2IjgHP0GAmw
--HG--
extra : rebase_source : d2245037e8ee7145af7eef528dcee50817b69d83
extra : histedit_source : 79443c35b82d3bc8833d140dd5afc882b85b4c12
This part is about setting on/off audio processing feature. It's long, but
it's mostly mechanichal changes, from the old API to the new one.
This also covers reseting the processing in case of device changes (with
macros).
MozReview-Commit-ID: EI2TxHRicEr
--HG--
extra : rebase_source : 7044c2d1695cdf0d6a69b4faa19349e3261ef204
extra : histedit_source : f5ac61e7b90ab4d5280623095c443529fb36cde5%2C5c969f1833bdc425842f945a5a8a4702ca13cd56
This needs the next patches to build fine, but is split out for the review.
A side effect of this patch is to break non-duplex, making the whole
init/cleanup phase much simpler.
MozReview-Commit-ID: Caqc8v7CWwZ
--HG--
extra : rebase_source : 6e7d501ef99f3ea5d755a610238b8f260194bba0
extra : histedit_source : 298c7e95a2bd40e8f9ce014e06faad159fca513e
This is "just" for testing, but is cleaner, and skips some resampling, and is in
line with the other patches, to converge with always using MSG rate when we can.
MozReview-Commit-ID: CBQHEDQWJE3
--HG--
extra : rebase_source : a65c4df357a6f56306b63b92416697f01699358f
extra : histedit_source : ae589d7cf7bc3895a0f4b5b496b60846bddf7d1a
Mostly-mechanical replacement of MOZ_LOG with DDMOZ_LOG, usually just removing
the class name and `this` pointer (as they are already implicitly recorded).
Some files needed a bit more work when logging was done from helper classes or
static functions.
MozReview-Commit-ID: IeJJmzYqWMQ
--HG--
extra : rebase_source : 94200838dcdaf6c3bda9de30042ce2d307237eef
This macro may be used to replace MOZ_LOG in most files, where it is used in
non-static member functions of classes that are registered with
DDLoggedTypeTraits.
MozReview-Commit-ID: A8DYmGoMv7f
--HG--
extra : rebase_source : 51d24f53a19fcbcbe42faea668256f1804f0abc9
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
It's no longer used, and won't be able to work with the removal of speech synth direct audio support.
MozReview-Commit-ID: BMdeRJHes0R
--HG--
extra : rebase_source : 9f45b360d27f8013ef229eba79e9d9921d0fdb26
This allows logging from the command line without using a webextension.
MozReview-Commit-ID: 6pkDbLXzz3X
--HG--
extra : rebase_source : 92a840d47054e5bef4cd7adf0aadb16f093f7639
This queue may be used heavily when multiple threads are running media code
that logs thousands of messages per second, so using less strict memory
ordering can help with speed.
Benchmarks show an improvement of up to twice the queueing speed in some
situations.
MozReview-Commit-ID: 70UOL8XAZGp
--HG--
extra : rebase_source : 38de1f6ce8a404e2ccc1591392176151edc8d078
sLogState is accessed at least once for every DDLog call, even when logging is
disabled, so we want it to be as quick as possible for minimal impact on most
users.
MozReview-Commit-ID: AMstgXmixrv
--HG--
extra : rebase_source : 475b32f76d9660d03333047eb7e7add62b717a79
This class contains a bunch of Gecko DOM specific stuff, and it would make
keeping the copy of MediaDecoder in Servo up to date easier if the Gecko
DOM stuff wasn't in MediaDecoder (and the other classes we import).
MozReview-Commit-ID: 3dP1nrQ7sT3
--HG--
extra : rebase_source : 79040a8d3cff6ac946b20a99d68e57630ec60848
1. The default value of position is "auto".
2. follow the spec to parse the position value.
MozReview-Commit-ID: HO7sQ0go5A6
--HG--
extra : rebase_source : ab6066f260abac25d71a1c35511c5389444e000a
It should be called explicitly for anyone that wants its side effect.
MozReview-Commit-ID: EHiPjklV6oZ
--HG--
extra : rebase_source : bb7b0138698448f1064e90b0318637db969b1527
So it won't have to call GetStatistics() again.
MozReview-Commit-ID: 1tRnRHAiX4L
--HG--
extra : rebase_source : 4e2d3c4eb6f149fded9c9ba05872a72c55fad05b
We calculate 'canplaythrough' in ChannelMediaDecoder::DownloadProgressed() and
send updates to MDSM.
MozReview-Commit-ID: KAeDciPAUKs
--HG--
extra : rebase_source : 64d7705fb5ca6b1003664ac313ad1ae0ab1bbea6
We want to remove the side effect of ComputePlaybackRate(). Anyone who wants
the side effect (updating mPlaybackBytesPerSecond/mPlaybackRateReliable)
should call it explicitly.
MozReview-Commit-ID: 8oHvCl5pewz
--HG--
extra : rebase_source : 3ee54ea32d2d2d7185d9a65c6658a3e700f1fb71
For the project to export Gecko's media stack and import it into Servo,
I need a way to shutdown an abstract MediaResource. So I'd like to move
BaseMediaResource::Close() up into MediaResource class.
MozReview-Commit-ID: 9JmxJPs02PN
--HG--
extra : rebase_source : e61cc1a3a79b3e4ca7e9fa86a602e6e26044e247
For the project to export Gecko's media stack and import it into Servo,
I need a way to shutdown an abstract MediaResource. So I'd like to move
BaseMediaResource::Close() up into MediaResource class.
MozReview-Commit-ID: 9JmxJPs02PN
--HG--
extra : rebase_source : 77128d1f78bea516dda92cdae6975d010a4b303c
Usually mDecoderPosition and mPlaybackPosition are in the same cached range so
GetCachedDataEnd(mDecoderPosition) and GetCachedDataEnd(mPlaybackPosition) will
give the same result.
It also makes more sense to pass the playback position instead of decoder
position since 'canplaythrough' is about playback instead of decoding.
MozReview-Commit-ID: Kk1uUeSFTCI
--HG--
extra : rebase_source : 354fe5b4a6fb73a477ded40bf5fb91979a2c2a8a
Also devirtualize ChannelMediaDecoder::DownloadProgressed() and move it to private.
MozReview-Commit-ID: ITv3ISRbN5t
--HG--
extra : rebase_source : aa75bc11fc1a4af8df15db9224928b1f02267b80
So it is callable from non-main thread.
MozReview-Commit-ID: atYmz4u2c9
--HG--
extra : rebase_source : 2e10064730b3e7e1ecb1a4fd65cf2e2da0390290
extra : source : 5680a6942f6985f9c6bbf284a9768ab910b37804
Per UX spec, we would allow non-audible media (volume 0, muted, video without audio track)
to autoplay.
MozReview-Commit-ID: HKUyt5Jt4sH
--HG--
extra : rebase_source : 83e53a0035d72984494948f131a5d6e516baa577
We always read metadata when decoding starts. This allows us to remove the call
to mResource->SetReadMode(MediaCacheStream::MODE_METADATA) in ChannelMediaDecoder::Load().
MozReview-Commit-ID: AQMq4HxDZdT
--HG--
extra : rebase_source : 141c43bb93f274d8320a270b5c7289bd1eab134d
extra : source : 7de3d88ddb5c99352f4b5bd0b5e648a52a4a67a5
If the media has started playing before, bless it and it would always be allowed
to autoplay.
MozReview-Commit-ID: 4GqMARLXULU
--HG--
extra : rebase_source : 2fdb3937156147755f8e387b1d84311ae1d37ce4
There's little advantage over using NV12 and using YUV420 allows for easier and faster frame copy. We assume of course that Apple's VideoToolbox have more optimized code than we do.
MozReview-Commit-ID: IjvepxW3OZI
--HG--
extra : rebase_source : 089f5a63c4871366aed8f0c0ef3ef6bd3c2d0a0f
If the media has started playing before, bless it and it would always be allowed
to autoplay.
MozReview-Commit-ID: 28X4TmG25aJ
--HG--
extra : rebase_source : 3fd7cb16da9e7f925ad7020fb74c48537e08a996
Insert space character when we concatenate the string in HEADER. Then split them by ASCII whitespace.
MozReview-Commit-ID: 12jov2hKK2E
--HG--
extra : rebase_source : ed9dd2c9f0fd64083311166424b47b10e6c9cbdc
High resolution, high framerate was disabled by default on old AMD cards on the provisio that it was bad. But this assumes that the CPU decoder could do it better.
This assumption appears fragile at best, as CPU with those old adapter are likely to be old and underpower to start with.
Chrome doesn't appear to restrict use of those cards to a given resolution.
So we disable this restriction, while making it user configurable.
MozReview-Commit-ID: HhADHNR0FdJ
--HG--
extra : rebase_source : ece39cd9b84c6e372d1002ee12e72523cee3d04d