Commit Graph

280 Commits

Author SHA1 Message Date
JW Wang
350f03bde7 Bug 1376227. P3 - move Load() down the class hierarchy. r=gerald
So we won't pass an unused |nsIStreamListener**| to MediaSourceDecoder::Load().

MozReview-Commit-ID: 2TCby8m8K5H

--HG--
extra : rebase_source : 349179aa4303c0abd8b86a695789770e158e5c28
extra : intermediate-source : d6f550bd6709a0ee7db6033286af42565a20cdb1
extra : source : ed524d855a1a78665c499152a9360ba961655641
2017-06-23 14:12:41 +08:00
JW Wang
1dbf0f77fa Bug 1376227. P2 - remove unused code following P1. r=gerald
MozReview-Commit-ID: JbwY1Owtk7H

--HG--
extra : rebase_source : 0f82ac16f56ce6ba27944b093b49c8ff6479e66c
extra : intermediate-source : 38c1c8a70fb0209f8c6a3ca596664db9af089763
extra : source : 7cfe394c4790ca7687db9004c96380f088c2bb59
2017-06-21 17:34:22 +08:00
JW Wang
6cd0d57b3c Bug 1374930. P4 - move ResourceCallback to ChannelMediaDecoder. r=cpearce
We also move some methods to protected so they are callable from ChannelMediaDecoder.

MozReview-Commit-ID: 6s9LKNkbJhX

--HG--
extra : rebase_source : 172ea88bc01552a90f5ef51db2b5af0ac5551c3b
extra : intermediate-source : a724333159c6b408e2fa68dba2d0a467f3c55940
extra : source : 03760e05ea8044b3404d29bb62205a2f62892d4b
2017-06-20 18:10:56 +08:00
JW Wang
61f7ca2479 Bug 1374930. P3 - move Clone() down to ChannelMediaDecoder for clone is possible only for those use channel-based resource. r=cpearce
MozReview-Commit-ID: Ci2kbts2pkQ

--HG--
extra : rebase_source : 3a2e70ca4bf56e1c73b7faff8e183211787a96bf
extra : source : 682cb949adae4683ae1cbbfbb4c457b83cb1fddc
2017-06-20 18:10:27 +08:00
Jean-Yves Avenard
10d2da1b08 Bug 1374596: P7. Fix includes as per coding style. r=padenot
MozReview-Commit-ID: 5WfOWcOoxg0

--HG--
extra : rebase_source : 988c09623e83a0d9188d9ff5d705314e2c43e756
2017-06-20 17:56:55 +02:00
JW Wang
95284c8279 Bug 1374184. P3 - rename NotifyDownloadProgressed to DownloadProgressed for it is used internally by MediaDecoder and fix the comment. r=gerald
MozReview-Commit-ID: 6nUEjvZ73ko

--HG--
extra : rebase_source : 55d6a5b385258aa080974574a2bfc2ef722d6e00
extra : source : 9a5d941f74815acf189bdb4f85578a2634a632ae
2017-06-19 14:27:58 +08:00
JW Wang
ca683c8fb9 Bug 1374184. P2 - merge NotifyDataArrived() and NotifyDownloadProgressed(). r=gerald
We also move NotifyDownloadProgressed() to private
since it won't be called outside MediaDecoder.

MozReview-Commit-ID: GISbJEW7wwx

--HG--
extra : rebase_source : a454e1477ad645e9e2ee9cab8b31332b38518836
extra : source : 8ca5e3e1fac96a150e5df8e4d06c11f85ee3257d
2017-06-19 14:24:40 +08:00
JW Wang
ec8226f548 Bug 1374184. P1 - add NotifyDataArrivedInternal() and let ResourceCallback call it. r=gerald
MozReview-Commit-ID: GTmNrRtxJ0U

--HG--
extra : rebase_source : 1b3a86cf1cf24f01876cb43ff65ca4543c6a4da0
extra : source : 69bbedecae3f216c7144886bd1cb67c4a2acb44d
2017-06-19 14:15:00 +08:00
JW Wang
f7b857d975 Bug 1373595. P3 - devirtualize NotifyDownloadProgressed which has no overrides at all. r=gerald
MozReview-Commit-ID: 7RoBvSc4fXP

--HG--
extra : rebase_source : cc95c56ab351165cf0069b970608df717843068d
2017-06-19 11:02:20 +08:00
JW Wang
becfe61ebe Bug 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does. r=gerald
MozReview-Commit-ID: IOBY3UKAy0G

--HG--
extra : rebase_source : be4b9a53fa676ec0a628a09edecce74528f1e66a
2017-06-19 11:01:13 +08:00
JW Wang
480e189f8c Bug 1373595. P1 - merge MediaResourceCallback::NotifyDataArrived and NotifyBytesDownloaded. r=gerald
We now call NotifyDataArrived() after data written to the cache to notify
download progresses and buffer ranges re-calculation.

MozReview-Commit-ID: 3IrDuEYJYWu

--HG--
extra : rebase_source : 165a199952be32c8c4cd8f1c578b87826a267f10
2017-06-16 18:35:12 +08:00
JW Wang
27d3284709 Bug 1373589 - Remove MediaResourceCallback::NotifyDecodeError which has no callers at all. r=kaku
MozReview-Commit-ID: D2xqWHIiRBv

--HG--
extra : rebase_source : cc933811af40af3bebdbb8f3f1ca030cc8c622ef
2017-06-16 17:36:30 +08:00
JW Wang
75e01f7b0a Bug 1371202. P1 - plumb the 'loop' attribute into MDSM. r=jya
MozReview-Commit-ID: DtsaXmtQw76

--HG--
extra : rebase_source : 34686d455670975a824dc803a16b8acff97c86ab
extra : intermediate-source : 0de95b1644a365dda9beff4b75d56251da2258c7
extra : source : ba5b2599c949766395bf5b0381023a752bc6e04d
2017-06-08 12:03:10 +08:00
JW Wang
a61afab096 Bug 1371514. P2 - remove MediaDecoder::mStateMachineIsShutdown. r=gerald
MozReview-Commit-ID: Dv2pdHW2tgI

--HG--
extra : rebase_source : aea740ced32fe31185127617102f026b1ad0349e
2017-06-09 11:27:42 +08:00
JW Wang
ba75abc972 Bug 1371514. P1 - remove AbstractMediaDecoder::IsOggDecoderShutdown() and its friends. r=gerald
MozReview-Commit-ID: 5HOqH6YtB8b

--HG--
extra : rebase_source : 49cc525c32d827584c856e815a1ff3e2df968cea
2017-06-09 11:24:45 +08:00
JW Wang
e4b22b962a Bug 1371200. P5 - devirtualize some functions that don't have overrides. r=cpearce
MozReview-Commit-ID: CtWPXF6MYIi

--HG--
extra : rebase_source : c0d147cb878ddf2147355c02419fd7d7b2044a40
extra : source : 6467bf865cdcefd5b41049045ac9d34b101d5673
2017-06-07 14:41:37 +08:00
JW Wang
7b50a4d6b2 Bug 1371200. P4 - constify some members. r=cpearce
MozReview-Commit-ID: B7rrXrTn7RD

--HG--
extra : rebase_source : cdca8a7a313d0c066aac58083e4b63e1be83603d
extra : source : 4d818f16afa3763b2515bdb9834880f11aa13989
2017-06-07 14:26:36 +08:00
JW Wang
eb1841ec23 Bug 1371200. P3 - remove unused code. r=cpearce
MozReview-Commit-ID: JVmmKSAQl3q

--HG--
extra : rebase_source : b4a727b9c631fc85d12abb84d2b91b31923093eb
extra : source : 79cbb22b4a53945dcff3046b27dac617c8dac51a
2017-06-07 14:21:47 +08:00
JW Wang
e8a94c0927 Bug 1371200. P2 - add more fields to MediaDecoderInit. r=cpearce
Now we can init some members in the constructor and remove the setters
that are called only once.

MozReview-Commit-ID: 2hkrIA6pFlh

--HG--
extra : rebase_source : 33c008ef1508597e64ef7f92b028867dbd4ffba6
extra : source : fa213ee733ea881f4f76dac06c9b4709aeba4b91
2017-06-07 14:10:26 +08:00
JW Wang
4031d18757 Bug 1371200. P1 - add MediaDecoderInit and fix MediaDecoder constructor and its friends. r=cpearce
We will add more fields to MediaDecoderInit and be able to remove some setters.

MozReview-Commit-ID: BVx935IHQHf

--HG--
extra : rebase_source : 6d167265e478ce39881ceada1303e9ca18189bbf
extra : source : 0c26f909568f673591ad6720458dfc912c01daad
2017-06-07 12:14:11 +08:00
JW Wang
49a7bff27a Bug 1367705. P3 - fix MediaChannelStatistics which no longer needs to be sharable. r=cpearce
MozReview-Commit-ID: 8guyyGquFnV

--HG--
extra : rebase_source : d4dcc146d3f7b36648cb06e3dc052ff648633821
extra : intermediate-source : ea621690a60d7b4208fddff7423747ea00ebeb4d
extra : source : a11e521f7f36cf8c8d31d7e6d52e0ea296306788
2017-06-02 12:44:43 +08:00
Chris Pearce
d7d3abb576 Bug 1367950 - Only throttle download of src=url video if the download is 'fast' on desktop. r=jwwang
Our canplaythrough logic is opaque to the users, so I expect that our recent
change to throttle when we hit the readahead limit would be confusing to users;
those on a slow connection would want their media to prebuffer, and not expect
the download to stop part way through.  They would think that Firefox had
stalled at an arbitrary point for some unknown reason, i.e., they'd think
Firefox was broken. So I think we're better to instead only throttle if the
network is good enough that the user probably doesn't worry about the download
not keeping up with playback.

We should restore the previous behaviour on mobile of throttling when the
download reached the readaheadd limit regardless of canplaythrough or network
speed, as the calculus is different on mobile; the user may also be concerned
about battery life, or hitting their data cap. And often the faster the
cellular network is, the more expensive data on it is.

So this patch changes us to throttle when we reach the readahead limit only if
the network is fast, where fast is defined as being able to stream at twice the
rate estimated to be required to playback without stalling.

It also adds a pref to revert to the old behaviour of not considering the
network speed, which we enable on mobile to restore it to its previous
behaviour.

MozReview-Commit-ID: KLIGaQZV6dX

--HG--
extra : rebase_source : c2e0c6be3158fa661be49d1267d976af43aff6d7
2017-05-26 13:55:48 +12:00
JW Wang
a80b2eab10 Bug 1365524. P2 - replace use of nsAutoPtr with UniquePtr. r=jya
MozReview-Commit-ID: 8zR7ZRXl1ON

--HG--
extra : rebase_source : 24053b1be0149ffb6e0dc2c1276c487a64787f32
2017-05-18 16:35:49 +08:00
Kaku Kuo
dab014bd99 Bug 1360123 P2 - move ConstructMediaTracks/RemoveMediaTracks to HTMLMediaElemnt; r=jwwang
MozReview-Commit-ID: 3S63JeXAX2w

--HG--
extra : rebase_source : ef807247a5042fa23ba6b6f5c907035bd8d64199
2017-04-18 15:43:55 +08:00
JW Wang
54ae314fcc Bug 1358972. P2 - remove MediaDecoder::mEstimatedDuration and its friends which is never modified. r=kaku
MozReview-Commit-ID: 7W331tookXV

--HG--
extra : rebase_source : 2555fbdb4c5480e6880a67e71827ca06d6857992
extra : intermediate-source : c035bdc6f8e47cc92fa5d6b66421d319d9cd2e92
extra : source : 49ec1fd9914624f5aa4ea87bf4deb8b47017e288
2017-04-17 17:20:06 +08:00
JW Wang
381be5ed72 Bug 1358972. P1 - remove unused code. r=kaku
We can remove AbstractMediaDecoder::UpdateEstimatedMediaDuration() which
has no callers at all.

MozReview-Commit-ID: Eub12jQ25KK

--HG--
extra : rebase_source : f564b84a147252bd98c13fe475af971808880c8c
extra : intermediate-source : 4c0870a71b2091c39f5fc67c5cf21dea0a4cc459
extra : source : 1bfe40324a3801f8d60384b247d85f04b8971bbe
2017-04-17 17:10:09 +08:00
JW Wang
f6a893a644 Bug 1358969 - let MediaDecoder::CurrentPosition() return a TimeUnit. r=kikuo
We want to replace the use of int64_t for microseconds by TimeUnit
whenever possible since int64_t is ambiguous which could be microseconds
or milliseconds.

MozReview-Commit-ID: K3Bz3uEXLDK

--HG--
extra : rebase_source : ade3cbd61c764b73a22c360572a525127dbadbc5
extra : intermediate-source : 013227a4aa645fc34a82c44130db6c847d74960b
extra : source : 1ab7ce426b557e4ce9979e023f9e84b4690eeaaa
2017-04-17 17:04:39 +08:00
JW Wang
02369ea1a2 Bug 1357987 - make MediaDecoder::DEFAULT_NEXT_FRAME_AVAILABLE_BUFFERED a TimeUnit to avoid ambiguous int64_t for microseconds. r=kaku
MozReview-Commit-ID: 9JC4zPEc6or

--HG--
extra : rebase_source : 8001ba3924f4bdb2ffb4143f1a22e2c4bf697ce3
extra : intermediate-source : 02bc62f83a7af3059b819c2bbb9fd887e2593043
extra : source : 5af753b1192f36ebf84279ff011617587ede613b
2017-04-17 16:58:44 +08:00
Kaku Kuo
36ef069505 Bug 1344357 P3 - dont' pass dom::Promise into MediaDecoder anymore; r=jwwang
MozReview-Commit-ID: 5RUNauRRajP

--HG--
extra : rebase_source : 4c12d5cd730657da37b2c94987e84518c2c67ae5
2017-04-17 18:49:55 +08:00
Kaku Kuo
b06e8a5370 Bug 1344357 P1 - move the MediaDecoder::mSeekDOMPromise to HTMLMediaElement; r=jwwang
There was a cycle amoung a window object -> a HTMLMediaElement -> a MediaDecoder -> a Promise (-> back to the window object).
And we have no way to break the cycle since the MediaDecoder does not participate into the collection.

By moving the Promise form MediaDecoder to HTMLMediaElement, we will be able to break the cycle since the HTMLMediaElement is in the collection.

We'll implement the cycle collection in the next patch.

MozReview-Commit-ID: CyVXBl6IMI3

--HG--
extra : rebase_source : 195a322ce3e6fe933e72be4aec5d2ebfa1f54865
2017-04-17 18:25:26 +08:00
JW Wang
519fb03dfd Bug 1353607. P9 - change the underlying type of mCurrentPosition to TimeUnit. r=kikuo
MozReview-Commit-ID: ffquOIFlp3

--HG--
extra : rebase_source : 2f6e383a1995e91f395efb4d037e151a5a656248
extra : intermediate-source : 12403091f9cee42331e12eb13945b40d02dc842f
extra : source : 1149d57835c33231411692e74836fff37b3e74de
2017-03-28 18:13:22 +08:00
Kaku Kuo
a2b8741937 Bug 1348432 - move the mMediaTracksConstructed flag back to MediaDecoder; r=jwwang
This mMediaTracksConstructed flag should belong to a MediaDecoder,
every time a HTMLMediaElement switches its MediaDecoder, the flag should be reset to false again.

So, we move the mMediaTracksConstructed flag back to MediaDecoder, by this way,
HTMLMediaElement provides only the mechanism to construct and remove media tracks,
and MediaDecoder uses the flag, mMediaTracksConstructed, to provide policy.

MozReview-Commit-ID: L7mMAmLjQCy

--HG--
extra : rebase_source : 1625d604afb34bffe79eda06a46c9feb780a14d9
2017-03-18 22:34:01 +08:00
Kaku Kuo
0696209786 Bug 1347892 part 2 - pass the visibility state of media element to media decoder as a Visibility variable; r=jwwang
MozReview-Commit-ID: AbkJeIpYZlN

--HG--
extra : rebase_source : 3ace472786b9b9900b125164996819b6d6e3627f
2017-03-17 12:51:11 +08:00
Kaku Kuo
b7fee84e84 Bug 1347402 part 4 - move ConstructMediaTracks/RemoveMediaTracks to HTMLMediaElemnt; r=jwwang
ConstructMediaTracks and RemoveMediaTracks are actually HTMLMediaElement's responsibilities.

MozReview-Commit-ID: 8lOdzD4pN7N

--HG--
extra : rebase_source : 7159d2c62b77429e5b2305b9e3eb7a0020a3b52c
extra : source : 0467c059be3cd8f066da5fc912b7738a5b9c4dd9
2017-03-15 17:33:21 +08:00
Kaku Kuo
a1edb1f6ed Bug 1346116 part 2 - consider a video is in-tree or not in the suspend-video-decoding policy; r=jwwang
We never suspend videos that is NOT in-tree because we found that, according to the Telemetry data, most (>70%) videos
which are used as the argument of drawImage() are not in-tree. So, by preventing suspending not-in-tree videos, we should
be able to alleviate the pain of not able to resume video decoders synchronously.

MozReview-Commit-ID: 8eqs0pHZLIt

--HG--
extra : rebase_source : 964c0047753696cad2e40bcf74c2b8ee9faccdea
extra : source : 93c38caa15b1a29f8f1e8e6d3a5e859f97bc1aae
2017-03-12 14:02:04 +08:00
Kaku Kuo
7e43b9cace Bug 1346498 part 9 - move all policy codes into MediaDecoder::UpdateVideoDecodeMode(); r=jwwang
Make HTMLMediaElement no longer has logic of deciding visibility, it just passes all information into MediaDecoder.

MozReview-Commit-ID: ApVcEQfboO

--HG--
extra : rebase_source : 88c70b0cf1933d9cf814359909463a811be2ab9f
extra : source : 669d1340d3c93d3e0eab55ce87693f842cf40247
2017-03-11 19:56:17 +08:00
Kaku Kuo
062129aebf Bug 1346498 part 6 - remove mHasSuspendTaint cannonical-mirror pair; r=jwwang
MozReview-Commit-ID: BqAfv9CSsv3

--HG--
extra : rebase_source : 61d8ab0494986b780b79ea9350c9d0b52f70a382
extra : source : 6d92d52bdc7688c76fc5f55853a9fa07b3875b44
2017-03-11 15:12:38 +08:00
Kaku Kuo
68c95368f5 Bug 1346498 part 4 - remove mIsVisible cannonical-mirror pair; r=jwwang
The role of MDSM::mIsVisible and MDSM::VisibilityChanged() have been replaced by
the MDSM::mVideoDecodeMode and MDSM::VideoDecodeModeChanged() completely.

MozReview-Commit-ID: 8sW0s8ilF1E

--HG--
extra : rebase_source : 20f4b0c2e5a34018b3189b4d10dd55e68881c0e7
extra : source : 2eba9a76da70749583125176e8b7c6c959b74d38
2017-03-11 14:06:09 +08:00
Kaku Kuo
c2f38bd02d Bug 1346498 part 3 - implement the UpdateVideoDecodeMode() policy in MediaDecoder; r=jwwang
So, the MediaDecoder is the one who rules out the policy of suspending video decoder.
We also extract all the policy rules into one single method, MediaDecoder::UpdateVideoDecodeMode().

MozReview-Commit-ID: IOQq6kFfkIs

--HG--
extra : rebase_source : 3d92c63aed2545391c45cdd7c1236d5df0b8d2f8
extra : source : 9c6c5f22d25171a206e828faa2c7c91d47f748f1
2017-03-10 16:52:03 +08:00
Kaku Kuo
64305205ed Bug 1346498 part 1 - extract the MediaDecoder::NotifyCompositor() method; r=jwwang
MozReview-Commit-ID: Hfw3FJUSVVe

--HG--
extra : rebase_source : 738cb2e341ab03d0dc189facc950314c29a3721b
extra : source : 63f67483e45c8a73eda772f264d2424a1049320f
2017-03-10 16:29:59 +08:00
Kaku Kuo
3c60cdbdf5 Bug 1345403 part 1 - Track decoder tainting; r=jwwang
Some uses of media elements should 'taint' the element so that the video doesn't participate in video decode suspending.
Add the infrastructure to track the taint status on MediaDecoder and mirror the status to MediaDecoderStateMachine.

MozReview-Commit-ID: Ik6aDIzrZaO

--HG--
extra : rebase_source : 31fdddabdc62cb8c59db19c1f466f674ef503ee8
extra : intermediate-source : 906cb039bea3e5ac6c1ec852209db28be60ba201
extra : source : 1ac0f1b9264706f65e04528757bd60028331d31f
2017-03-08 19:28:13 +08:00
Iris Hsiao
bdff9504ef Backed out 5 changesets (bug 1345403) for permanent failure in autophone Mdm tests
Backed out changeset f6415ae0ba89 (bug 1345403)
Backed out changeset ac12e246a808 (bug 1345403)
Backed out changeset a3e4ce12194f (bug 1345403)
Backed out changeset ba072186c917 (bug 1345403)
Backed out changeset 7a7d6e9b8329 (bug 1345403)
2017-03-13 15:28:14 +08:00
Kaku Kuo
af6e44d1d0 Bug 1345403 part 1 - Track decoder tainting; r=jwwang
Some uses of media elements should 'taint' the element so that the video doesn't participate in video decode suspending.
Add the infrastructure to track the taint status on MediaDecoder and mirror the status to MediaDecoderStateMachine.

MozReview-Commit-ID: Ik6aDIzrZaO

--HG--
extra : rebase_source : 1dfdedea63d18918ef7b529a87f3afeb1592b149
extra : source : 1ac0f1b9264706f65e04528757bd60028331d31f
2017-03-08 19:28:13 +08:00
JW Wang
553e846993 Bug 1331070 - delay seek request until decoding first frames for non-MSE media. r=kaku
See see bug 1321198 comment 17. This is a workaround to alleviate the issue
which seems to happen on win8 x64 opt only.

MozReview-Commit-ID: Lr4viEjuFkC

--HG--
extra : rebase_source : 99895cf6f6f13d5f4d698f76db7acda15d8cee77
2017-02-08 18:15:28 +08:00
JW Wang
f40aaeaffc Bug 1336356 - Ensure MediaDecode::Shutdown() is called by MediaShutdownManager::BlockShutdown(). r=gerald
MozReview-Commit-ID: 80AFMafXoeB

--HG--
extra : rebase_source : 8b51b6c9fe4b83b4639c7ae081854307c4308391
extra : source : 7ca33be035c12485e0d6529c529b0cda914fd405
2017-02-03 17:12:38 +08:00
Jean-Yves Avenard
b7844bd5c3 Bug 1319987: P9. More coding style fixes. r=gerald
MozReview-Commit-ID: DhFRqkWQZny

--HG--
extra : rebase_source : 03ed44efc83fe9cab7fc975229ac4e5746aff96b
2017-01-27 13:20:37 +01:00
Carsten "Tomcat" Book
f040eda61d Merge mozilla-central to autoland 2017-01-23 11:42:26 +01:00
JW Wang
e13e207c12 Bug 1332544 - replace use of mOwner with GetOwner() which provides more checks. r=gerald
MozReview-Commit-ID: DUTO4vR2kjU

--HG--
extra : rebase_source : 5edfabb169efdc0be938ed85d68d42f8694280d1
2017-01-20 11:47:53 +08:00
JW Wang
4963f39de0 Bug 1331862. Part 2 - add functions to collect debugging info asynchronously. r=kaku
MozReview-Commit-ID: 4btaZqUqyLn

--HG--
extra : rebase_source : 80289bb88f7359062575e2b7f7da06e00f78cd51
extra : source : 7e011787cb911799f47b55aeba986bf05c30ed27
2017-01-19 14:18:41 +08:00
JW Wang
da6c0492b0 Bug 1331862. Part 1 - extract code to functions for reuse. r=kaku
MozReview-Commit-ID: 9QNTaBxGUFq

--HG--
extra : rebase_source : 98e95c60cbd66a5df4571644e4a6415f5bdbc371
extra : intermediate-source : 9dcd71ff0f89beda838f09865dfaa7f96983e430
extra : source : b0cf54f37556f520e45a001dcfa681e4a612a927
2017-01-18 17:55:59 +08:00