Commit Graph

202 Commits

Author SHA1 Message Date
Jean-Yves Avenard
55676c3d5a Bug 1342913: P2. Terminate draining operations when possible. r=gerald
An interesting intermittent condition not previously handled.
We were incorrectly assuming that we always had a decode promise pending when a drain was requested.
If a change of content occurred when resuming from a waiting for data condition: we would have stalled forever as the waiting promise would never have been resolved even after new data was appended.

MozReview-Commit-ID: BQSRSHYqTSe

--HG--
extra : rebase_source : e091969ce35728cd3ded40161eaaa117df2c6886
2017-03-07 20:13:39 +11:00
JW Wang
f7aad5be2a Bug 1344772 - set a dirty flag so we can process the notification later. r=jya
https://hg.mozilla.org/mozilla-central/file/34c6c2f302e7b48e3ad2cec575cbd34d423a9d32/dom/media/MediaFormatReader.cpp#l2835
NotifyDataArrived() is dispatched again if |mNotifyDataArrivedPromise.Exists()| which will then be dispatched again
recursively until mNotifyDataArrivedPromise is completed. This is a waste of CPU cycles.

We can use a dirty flag to note we should update buffer ranges again when the current update is done.

MozReview-Commit-ID: 6hInhGKnXJE

--HG--
extra : rebase_source : 71aa2c16112428c34def094515e37aa1f028a3fc
2017-03-15 15:20:45 +08:00
Kaku Kuo
7c985e041c Bug 1346120 part 3 - Use NullDecoderModule while suspending a video element's decoder; r=jwwang
MozReview-Commit-ID: L1CsDV5TW5R

--HG--
extra : rebase_source : c7aa851ebdbda6abbf7acb09849b237023d653fe
extra : intermediate-source : 91c5986bef4c236e29deeeca6b14f33405da56a3
extra : source : 2d3146d70fb65da3379dd6a5f126c4caff65e139
2017-03-09 17:12:02 +08:00
Iris Hsiao
7f4987cc26 Backed out 6 changesets (bug 1346120) for autophone Mdm tests failure in test_background_video_drawimage_with_suspended_video.html
Backed out changeset a30c73fc8d69 (bug 1346120)
Backed out changeset f16556658fd9 (bug 1346120)
Backed out changeset 98d212462786 (bug 1346120)
Backed out changeset ba579adbed21 (bug 1346120)
Backed out changeset c0758b9bf7b5 (bug 1346120)
Backed out changeset 94a483ef784e (bug 1346120)
2017-03-13 16:53:14 +08:00
Kaku Kuo
707ca65566 Bug 1346120 part 3 - Use NullDecoderModule while suspending a video element's decoder; r=jwwang
MozReview-Commit-ID: L1CsDV5TW5R

--HG--
extra : rebase_source : e8a47fc99d775c591f6830b042c21717a3e8bced
extra : source : 2d3146d70fb65da3379dd6a5f126c4caff65e139
2017-03-09 17:12:02 +08:00
Wes Kocher
a237e462ec Backed out 2 changesets (bug 1342913) for failures in test_ChangeWhileWaitingOnMissingData_mp4.html a=backout
Backed out changeset f770cf70a30e (bug 1342913)
Backed out changeset 7fc8016ace00 (bug 1342913)

MozReview-Commit-ID: GfZmkx9mvoZ
2017-03-09 11:07:18 -08:00
Jean-Yves Avenard
21ed3b5fbd Bug 1342913: P2. Terminate draining operations when possible. r=gerald
An interesting intermittent condition not previously handled.
We were incorrectly assuming that we always had a decode promise pending when a drain was requested.
If a change of content occurred when resuming from a waiting for data condition: we would have stalled forever as the waiting promise would never have been resolved even after new data was appended.

MozReview-Commit-ID: BQSRSHYqTSe

--HG--
extra : rebase_source : a608377b935427faa7cd8042d0226e64e86e17b9
2017-03-07 20:13:39 +11:00
JW Wang
6b008ac4cf Bug 1341200. Part 10 - streamline DecoderData::ShutdownDecoder() so it feels like a sync function and MFR doesn't need to explicitly wait for flush/shutdown to complete before creating new decoders. r=jya
MozReview-Commit-ID: F4tf1f7O89U

--HG--
extra : rebase_source : ecd394c118812ee0419fc5307a63dfa62b82cddc
extra : intermediate-source : 7868b87098521a9e843ec4a154681391acf389ca
extra : source : 1cf5946fbd3a309d152ee8e785cafd1e3a96f1b6
2017-02-27 09:56:36 +08:00
JW Wang
8420ad6d55 Bug 1341200. Part 9 - remove unused mShuttingDown. r=jya
MozReview-Commit-ID: 8OWgOB07rEP

--HG--
extra : rebase_source : edc89b4ba3809409ddf3aa71d1c027f6bdbdb6c7
extra : intermediate-source : 71377f45a8ae845332f31761553dad1f3d2d7f85
extra : source : 5d1b66fb3a4b02aa4bd0405e03d199bbafaafb1e
2017-02-27 00:17:16 +08:00
JW Wang
8f139e4859 Bug 1341200. Part 7 - merge ShutdownDecoderWithPromise() and ShutdownDecoder(). r=jya
MozReview-Commit-ID: 9YRwPJGqrhq

--HG--
extra : rebase_source : 01bc1131ae5443b794369d35c524d7a84aa6ab59
extra : intermediate-source : b46551e3810b5695e9ffd9f13858047ae77b0373
extra : source : d76c075fc8c0a3fa9d1e24aecfdb226b9ef232c8
2017-02-25 07:59:53 +08:00
JW Wang
9b1586e228 Bug 1341200. Part 6 - let ShutdownDecoderWithPromise() return void by tracking the shutdown promise. r=jya
MozReview-Commit-ID: GIYdLXZYEyk

--HG--
extra : rebase_source : 1e3f48b3bdc351e64b8a9820c8bed4734f7de912
extra : intermediate-source : e2807e0c4457e703161418113efbcce67ca89511
extra : source : 90a3f8649308d65e5da6e931f914c024fa92e66e
2017-02-25 07:49:29 +08:00
JW Wang
f0f62f9c3c Bug 1341200. Part 5 - move the definition to .cpp as they will access ShutdownPromisePool in next patches. r=jya
MozReview-Commit-ID: 5Tvh1t4KyoV

--HG--
extra : rebase_source : e497b47e7d7497726b7d385e459ba5b2d982078b
extra : intermediate-source : 8f7c36f8638865781ff523d1c18c34f51bb96d9d
extra : source : f71a8765260b668c6580cd0e58af4c11a1a2918b
2017-02-24 17:27:42 +08:00
JW Wang
f581bfb525 Bug 1341200. Part 4 - remove the check that is unnecessary. r=jya
MozReview-Commit-ID: FC0IkPE4EcR

--HG--
extra : rebase_source : 571a0da04f8687260ef311f79d2d6aff07620e2a
extra : intermediate-source : 8152a19672b5023d279ccdb509c3cf731e97fe7c
extra : source : a54c526d54569dabbd326e44c0930fa66e30ad6c
2017-02-24 17:24:41 +08:00
JW Wang
e2351feb40 Bug 1341200. Part 3 - replace mShutdownRequest with a bool as P2. r=jya
MozReview-Commit-ID: ERERt0ZyvkC

--HG--
extra : rebase_source : a90adf0959c1458fd1ce8dd9c6a4ab52a45ec616
extra : intermediate-source : 0a68fd48e448382dcc4648ca30dd684e108eaf39
extra : source : 09844aff616c3b7ccd73fa01bcdc14d3529e35af
2017-02-24 17:19:12 +08:00
JW Wang
f903aff319 Bug 1341200. Part 2 - replace mFlushRequest with a bool for mFlushRequest.Disconnect() is never used and a bool is sufficient to do the job. r=jya
MozReview-Commit-ID: GFnSvunqtGq

--HG--
extra : rebase_source : 81b168157e04c455d8876c8e2504fad79b889cb8
extra : intermediate-source : aa57748660c8b5858c64ae07e77a60a5114a33fc
extra : source : 20371ccdf3c1f19ae2836e693a8b669a40f9e7a4
2017-02-24 17:04:32 +08:00
Jean-Yves Avenard
88913538dd Bug 1313548: P3. Return early of we're not longer waiting for a key. r=gerald
The next run of Update would have cleared the mWaitingForKey flag, may as well do it early.

MozReview-Commit-ID: DXiqSDAxnnz

--HG--
extra : rebase_source : ecdaaab1560d3e4637bbc05689cb9ab91294ae7c
2017-02-24 15:00:39 +01:00
Jean-Yves Avenard
2a41ec036c Bug 1313548: P1. Always resolve waiting promise, when clearing waitforkey. r=gerald
MozReview-Commit-ID: 6xu8Rcn9WMO

--HG--
extra : rebase_source : 54f99f2d4fc6370ee64a6e3dc0bec69f5edc9085
2017-02-23 14:10:12 +01:00
JW Wang
92c225d322 Bug 1340969. Part 2 - remove MFR::mShutdownPromise by using promise chaining. r=jya
MozReview-Commit-ID: 6Oa1yar80aH

--HG--
extra : rebase_source : e5fba9cea0ea6c2263d676e8328da50ab335a8d9
extra : intermediate-source : af2cfe6e4c5bb36d5016a2de1c1193aa2ddee0b0
extra : source : 0f94c4404ea9dce4904fb40b215314932f5211aa
2017-02-17 19:34:03 +08:00
JW Wang
8f2e3bc3e5 Bug 1340969. Part 1 - add ShutdownPromisePool to manage ShutdownPromises. r=jya
MozReview-Commit-ID: KAr3Fe8Aeqi

--HG--
extra : rebase_source : 3c8d93653f8974d69b356ef49a360105efae28a0
extra : intermediate-source : 5ca91530155e9bae43a349acd30e8e591d1ca928
extra : source : e77a4d9d8c7bfedbe43933781c9090681fdff9af
2017-02-17 19:29:43 +08:00
Jean-Yves Avenard
36471a6bc1 Bug 1336431: P4. Rename SharedTrackInfo. r=gerald
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
2017-02-13 19:18:05 +01:00
Jean-Yves Avenard
2a23d10d73 Bug 1337559: P2. Rework draining in MediaFormatReader. r=gerald
We now use a generic state rather than various booleans.
We handle partial drains better too.

MozReview-Commit-ID: AJSTcJivfEm

--HG--
extra : rebase_source : 26386cea20b97f1f76df829241b091ba837b301a
2017-02-09 15:31:44 +01: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
Jean-Yves Avenard
e2abc1a523 Bug 1319987: P7. Re-implement handling for WaitingForKey in MFR. r=cpearce,gerald
MozReview-Commit-ID: FCiAO54oiH3

--HG--
extra : rebase_source : 898e175742ae4db13c48cf75463a9775968b0030
2017-01-27 11:48:00 +01:00
Jean-Yves Avenard
73fd84bc5d Bug 1319987: P5. Promisify MediaDataDecoder. r=cpearce,gerald,mattwoodrow,snorp
This is a big change, and unfortunately impossible to break down with independently functional commits.

There are four main changes being applied here:

* Code cleanup, including making all MediaDataDecoder related code mozilla coding style compliant
* Make MediaDataDecoder use MozPromise
* Making Flush and Shutdown processes fully asynchronous
* Fixing few data races encountered across the code, in particular in the Android PDM

MozReview-Commit-ID: DpiZucGofJT

--HG--
extra : rebase_source : 80bd6c6f9726d536b6f306c40d9af6df27333be9
2017-01-26 13:56:46 +01:00
Jean-Yves Avenard
d144f37888 Bug 1319987: P1. Remove handling for WaitingForKey in MFR. r=cpearce
This is not compatible with promise based decoders. We'll re-implement it in a different fashion later on.

MozReview-Commit-ID: HYBNKVxEUmB

--HG--
extra : rebase_source : fe9f26e47b77a64099a422be844d20f4108663d0
2016-12-20 18:53:39 +11:00
JW Wang
992114f5fd Bug 1332160 - use nsCString internally whenever possible. r=gerald
MozReview-Commit-ID: 1DUaJWfbL88

--HG--
extra : rebase_source : f4a02736b0385e4be6258a185822f7855d0b0189
extra : intermediate-source : 1faaf4254a2e1ce2c096a8650b66d07c84c7fdbe
extra : source : c23fc2cea382627af8ff20ae3edea926eaa6d51a
2017-01-18 16:51:31 +08:00
Kaku Kuo
5c4d2f2a1d Bug 1324357 - Remove MediaDecoderReader::ForceZeroStartTime(); r=jya
MozReview-Commit-ID: Cm511lpJQ4W

--HG--
extra : rebase_source : c9d1a5a66b787ffffc221c194bb18559c006fa4b
2016-12-21 14:58:38 +08:00
Jean-Yves Avenard
c1797cf144 Bug 1319992: P4. Use Mutex in place of Monitor. r=jwwang
MozReview-Commit-ID: 79z6EtZQhYu

--HG--
extra : rebase_source : c0b7bc861641178539cab15da843d0b4d6ae416e
2016-11-30 01:50:08 +11:00
Jean-Yves Avenard
20853d0607 Bug 1319992: P3. Remove no longer used seeking argument. r=jwwang
MozReview-Commit-ID: 9Oc0SHX0Rw2

--HG--
extra : rebase_source : 845ab6daa4414e57d5ce02dee1424df29d3b962d
2016-11-30 01:42:50 +11:00
Jean-Yves Avenard
c9d75c91a6 Bug 1319992: P1. Run demuxing operations on its own task queue. r=jwwang
We runs all demuxing operations on a dedicated task queue.
MediaDataDemuxer's members using a synchronous API are handled via thread-safe copy that are updated along the operations.

The buffered range calculation is now handled separately and the entire operation is made asynchronous.

MozReview-Commit-ID: Gd4DCC8Ix6n

--HG--
extra : rebase_source : b90bad0a386c2a1e30acc00e3db9db6b6762aa3b
2016-11-28 21:08:01 +11:00
Sebastian Hengst
eda03c6bbf Backed out changeset f3ac066c3741 (bug 1319992) for failing test_eme_stream_capture_blocked_case1.html. r=backout 2016-12-19 12:39:21 +01:00
Sebastian Hengst
e1bd6fb711 Backed out changeset 3cfdc09bf851 (bug 1319992) 2016-12-19 12:38:32 +01:00
Sebastian Hengst
05f0d649cb Backed out changeset 2ae0864c76bc (bug 1319992) 2016-12-19 12:38:28 +01:00
Jean-Yves Avenard
8591c2a530 Bug 1319992: P4. Use Mutex in place of Monitor. r=jwwang
MozReview-Commit-ID: 79z6EtZQhYu

--HG--
extra : rebase_source : 925b627288e6a7237982ea11f76f99c04e782b39
2016-11-30 01:50:08 +11:00
Jean-Yves Avenard
65b1f05d4a Bug 1319992: P3. Remove no longer used seeking argument. r=jwwang
MozReview-Commit-ID: 9Oc0SHX0Rw2

--HG--
extra : rebase_source : 40faa64eab2d6ba65d092d5709103eb6daa30565
2016-11-30 01:42:50 +11:00
Jean-Yves Avenard
c5eae5a4c0 Bug 1319992: P1. Run demuxing operations on its own task queue. r=jwwang
We runs all demuxing operations on a dedicated task queue.
MediaDataDemuxer's members using a synchronous API are handled via thread-safe copy that are updated along the operations.

The buffered range calculation is now handled separately and the entire operation is made asynchronous.

MozReview-Commit-ID: Gd4DCC8Ix6n

--HG--
extra : rebase_source : 6a18ce2552bf4cbf88e9b8db1c9a87e70623fd15
2016-11-28 21:08:01 +11:00
Carsten "Tomcat" Book
c6f3dc11fc Backed out changeset 781555873370 (bug 1319992) for frequent test failurs in mediasource-endofstream.html 2016-12-16 12:41:41 +01:00
Carsten "Tomcat" Book
ba4d31d333 Backed out changeset ab31c60d46d7 (bug 1319992) 2016-12-16 12:41:08 +01:00
Carsten "Tomcat" Book
96bde6ffe2 Backed out changeset 49877fd60322 (bug 1319992) 2016-12-16 12:41:06 +01:00
Jean-Yves Avenard
51407b155e Bug 1319992: P4. Use Mutex in place of Monitor. r=jwwang
MozReview-Commit-ID: 79z6EtZQhYu

--HG--
extra : rebase_source : 506bba4823f3d5deb64909e41340259b409a1282
2016-11-30 01:50:08 +11:00
Jean-Yves Avenard
70465b6470 Bug 1319992: P3. Remove no longer used seeking argument. r=jwwang
MozReview-Commit-ID: 9Oc0SHX0Rw2

--HG--
extra : rebase_source : 0cea32ef23a47b5ed3b2439f2efa268ec66a523c
2016-11-30 01:42:50 +11:00
Jean-Yves Avenard
a0a96efb0f Bug 1319992: P1. Run demuxing operations on its own task queue. r=jwwang
We runs all demuxing operations on a dedicated task queue.
MediaDataDemuxer's members using a synchronous API are handled via thread-safe copy that are updated along the operations.

The buffered range calculation is now handled separately and the entire operation is made asynchronous.

MozReview-Commit-ID: Gd4DCC8Ix6n

--HG--
extra : rebase_source : fb157f58e38c2f3199ed96095634bf8e4ab6065b
2016-11-28 21:08:01 +11:00
JW Wang
114ec342ad Bug 1315631 - Don't dispatch |this| in the constructor. r=jya
Because it will change the ref-count which might cause destructor to run before exiting the constructor.

MozReview-Commit-ID: MMIea970Dv

--HG--
extra : rebase_source : faf898a3107706bc0ea750e738d8c3a7a3824264
2016-11-08 23:09:34 +08:00
JW Wang
6a43760ea7 Bug 1320258. Part 2 - remove MediaDecoderReader::UpdateBufferedWithPromise(). r=jya
Bug 1313635 ensures buffer ranges are updated before resolving metadata.
So we can revert the changes in bug 1251460.

MozReview-Commit-ID: Ek0sgPpv92s

--HG--
extra : rebase_source : 79b457167d5b987280083364afe31b31860b48fe
extra : intermediate-source : 9205ca61bb2255e33744af7ec4e13059f275960c
extra : source : 14d155274dc4e0d2daa8a90b1bbb15f975d7ac24
2016-11-25 16:22:55 +08:00
Kaku Kuo
73e0bee6d2 Bug 1313635 part 1 - don't go through MediaDecoderReaderWrapper to set start time; r=jwwang,jya
MozReview-Commit-ID: KXz1veb7x1i

--HG--
extra : rebase_source : e11247aba37a9edaf9276b7cbbc70c9e867e4dcd
2016-11-25 16:47:02 +08:00
Gerald Squelart
f2a26506fb Bug 1313497 - Use InvokeAsync with Storages in MediaDecoderReaderWrapper - r=jya
Thanks to this, MediaDecoderReader::Seek and overrides can take SeekTarget by
const&.

MozReview-Commit-ID: C5D26jKrW3p

--HG--
extra : rebase_source : 6f6278654ff3c51f6331cbf683c22622223a8cd2
2016-11-13 17:42:19 +11:00
James Cheng
11730376d7 Bug 1318225 - Part2 - Remove demux-only APIs. r=jya
MozReview-Commit-ID: ONS7mMr8mZ

--HG--
extra : rebase_source : a5ea2b94c664766064ca0c765347b4d8cd798cd2
2016-11-17 15:23:07 +08:00
Kaku Kuo
784908b6e8 Bug 1309516 part 2 - replace MediaFormatReader::DemuxStartTime() with MediaInfo::mStartTime; r=jya
MozReview-Commit-ID: JzO0Yv33ljL

--HG--
extra : rebase_source : e59bc8aa168dfda9ec5e41fd81bd98a2b9391663
extra : intermediate-source : cca0e5eaf29e7cfdc32f8b66e217e0d8fb0fd0ea
extra : source : 6af01ba877814a43b68bc004b0e28160216e7367
2016-10-14 17:09:04 +08:00
Kaku Kuo
5bc83d3772 Bug 1309516 part 1 - retrieve start time before resolving the metadata promise; r=jya
MozReview-Commit-ID: FhnoFi1BSHM

--HG--
extra : rebase_source : 3c1a1efa936fa0f4decdfb12c90bcce607c5edba
2016-10-27 15:21:05 +08:00
Sylvestre Ledru
caf1487b6c Bug 1317430 - Avoid a unnecessary copy by passing a const & in dom/media/ r=jya,pehrsons
MozReview-Commit-ID: 9MDVY9mgui0

--HG--
extra : rebase_source : d077c3f4d39e9914c591a0ef671a7db99679c608
2016-11-14 23:15:53 +01:00