Граф коммитов

65 Коммитов

Автор SHA1 Сообщение Дата
JW Wang 2d2b8a57e9 Bug 1423465. P4 - run GetStatistics() off the main thread. r=bechen,gerald
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
2017-12-05 15:06:34 +08:00
JW Wang 8bf10990f3 Bug 1423465. P2 - run UpdatePlaybackRate() off the main thread. r=bechen,gerald
MozReview-Commit-ID: Ktw4IxzHT2f

--HG--
extra : rebase_source : 9edd14062ad1692bf4a85655ac126e1d199e9e8c
extra : intermediate-source : 78e2a1d577508ff3619debdbdd35c64fcd1b0b1e
extra : source : 970eb209afa288929bed8f8b16c40c48c0dc5fda
2017-12-05 14:13:22 +08:00
JW Wang 32ec06ebb2 Bug 1422657. P2 - remove unused mDecoderPosition and related code. r=bechen,gerald
MozReview-Commit-ID: 8RobmJKC40i

--HG--
extra : rebase_source : 2b9abaa1a22b78cadbbdbf99d1c778fe82f84eac
extra : source : 7267883c2b722f806fc11c35ff9c8c5743a57bf3
2017-12-01 14:02:44 +08:00
JW Wang d72cfc05d2 Bug 1422657. P1 - GetStatistics() should pass mPlaybackPosition to mResource->GetCachedDataEnd(). r=bechen,gerald
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
2017-12-01 13:53:46 +08:00
Gerald Squelart c5aeab4f69 Bug 1407810 - Use DDMOZ_LOG in media stack - r=jwwang
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
2017-10-13 16:31:59 +11:00
Gerald Squelart 1b357db99b Bug 1407810 - Use DDLogger in media stack - r=jwwang
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
2017-10-10 17:55:27 +11:00
Narcis Beleuzu bc723a6e7e Backed out 2 changesets (bug 1422657) for browser chrome failures on browser_cache.js r=backout on a CLOSED TREE
Backed out changeset 7267883c2b72 (bug 1422657)
Backed out changeset 9c77dddb2fac (bug 1422657)
2017-12-06 00:40:16 +02:00
JW Wang e6e0f63154 Bug 1422677. P5 - remove mPlaybackBytesPerSecond and mPlaybackRateReliable by removing the side effect of ComputePlaybackRate(). r=bechen,gerald
MozReview-Commit-ID: BbCdsLXHT9d

--HG--
extra : rebase_source : c5a538b16ef91e20a54f2f645d8d5e0c88462b97
2017-12-01 15:05:25 +08:00
JW Wang 19a55c6ba7 Bug 1422677. P4 - remove the call to ComputePlaybackRate() from OnPlaybackEvent(). r=bechen,gerald
It should be called explicitly for anyone that wants its side effect.

MozReview-Commit-ID: EHiPjklV6oZ

--HG--
extra : rebase_source : bb7b0138698448f1064e90b0318637db969b1527
2017-12-01 14:44:34 +08:00
JW Wang d1dc9d3976 Bug 1422677. P3 - pass a MediaStatistics to ShouldThrottleDownload(). r=bechen,gerald
So it won't have to call GetStatistics() again.

MozReview-Commit-ID: 1tRnRHAiX4L

--HG--
extra : rebase_source : 4e2d3c4eb6f149fded9c9ba05872a72c55fad05b
2017-12-01 14:36:35 +08:00
JW Wang 2f2083875c Bug 1422677. P2 - remove the side effect of MediaDecoder::CanPlayThrough(). r=bechen,gerald
We calculate 'canplaythrough' in ChannelMediaDecoder::DownloadProgressed() and
send updates to MDSM.

MozReview-Commit-ID: KAeDciPAUKs

--HG--
extra : rebase_source : 64d7705fb5ca6b1003664ac313ad1ae0ab1bbea6
2017-12-01 14:34:58 +08:00
JW Wang d2f91da2bd Bug 1422677. P1 - move the call to ComputePlaybackRate() out of UpdatePlaybackRate(). r=bechen,gerald
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
2017-12-01 14:24:27 +08:00
JW Wang da8d5c072e Bug 1422657. P2 - remove unused mDecoderPosition and related code. r=bechen,gerald
MozReview-Commit-ID: 8RobmJKC40i

--HG--
extra : rebase_source : 50037c4dbe422f911819f845548b0ba69ac5d35f
2017-12-01 14:02:44 +08:00
JW Wang 972cab9021 Bug 1422657. P1 - GetStatistics() should pass mPlaybackPosition to mResource->GetCachedDataEnd(). r=bechen,gerald
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
2017-12-01 13:53:46 +08:00
JW Wang f2f9809386 Bug 1421179. P3 - ComputePlaybackRate() should call mPlaybackStatistics.GetRate() instead of mPlaybackStatistics.GetRateAtLastStop(). r=bechen,gerald
Otherwise mPlaybackBytesPerSecond will always be zero before playback is
stopped for the 1st time. This is important for a live stream where playback
rate can't be calculated from the duration and resource length (-1).

MozReview-Commit-ID: GEojREzHVEz

--HG--
extra : rebase_source : 6f770b54597abb303631da8e41c3199d92ebda6e
2017-12-01 12:25:00 +08:00
JW Wang d6c2016780 Bug 1421179. P2 - mPlaybackStatistics should accumulate bytes as playback position progresses. r=bechen,gerald
The original code accumulates bytes as the underlying decoder moves on which is wrong.

MozReview-Commit-ID: 72hTwOHwKRh

--HG--
extra : rebase_source : 68b62543314c7ecc823473a8dbf14e17d2a6eb7b
2017-12-01 11:26:03 +08:00
JW Wang 73e80931ea Bug 1421179. P1 - associate data with playback events published by MDSM. r=bechen,gerald
This is required for we want to associate playback offset with the
PlaybackStarted/PlaybackStopped events.

MozReview-Commit-ID: JkRhC2QE7kr

--HG--
extra : rebase_source : c5f637f2e5849565acb5b91364537f1724ce7d5f
2017-12-01 10:33:44 +08:00
JW Wang 855a4bc6c4 Bug 1421875. P3 - remove MediaDecoder::DownloadProgressed() which is basically a one-line call to GetOwner()->DownloadProgressed(). r=bechen,gerald
Also devirtualize ChannelMediaDecoder::DownloadProgressed() and move it to private.

MozReview-Commit-ID: ITv3ISRbN5t

--HG--
extra : rebase_source : aa75bc11fc1a4af8df15db9224928b1f02267b80
2017-11-30 11:21:14 +08:00
JW Wang 9262b684e3 Bug 1421875. P1 - rename MediaDecoder::NotifyDataArrivedInternal(). r=bechen,gerald
MozReview-Commit-ID: DVzTX4GePtB

--HG--
extra : rebase_source : 82b1f291468aa7e20d661161c9e83ec41a3864ab
2017-11-30 10:51:56 +08:00
JW Wang 1ee2ce9a65 Bug 1421861 - remove unused MediaStatistics::mDecoderPosition. r=bechen
MozReview-Commit-ID: LxZtvFpg3mD

--HG--
extra : rebase_source : 5f3c9132a386b1d290b8c0b169011baec4240b34
extra : source : b30985c8d5b99f6770d156942e5f91a0a408513a
2017-11-29 10:57:40 +08:00
JW Wang 1ae4603e61 Bug 1421134. P1 - default MediaCacheStream::mCurrentMode to MODE_METADATA. r=bechen,gerald
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
2017-11-28 10:43:50 +08:00
JW Wang 1f62c1d92b Bug 1417869. P3 - pass descriptive messages to NetworkError(). r=jya
MozReview-Commit-ID: 6yaFJvXG3g8

--HG--
extra : rebase_source : 2d1c851098be7eb880a01432c504c6db96d86756
extra : source : a30f9699f49687b23d4ccf955d7a0af8ce0c7653
2017-11-17 11:07:30 +08:00
JW Wang 819392126d Bug 1417305. P3 - treat NS_BASE_STREAM_CLOSED as success. r=bechen,gerald
Since we don't want to treat NS_BASE_STREAM_CLOSED as abort or error, let's just
treat it as success to simplify the call flow.

MozReview-Commit-ID: 1Fubaq6lfAq

--HG--
extra : rebase_source : b9168704aa618eca553d96770e3256aadcc4b925
2017-11-15 11:24:22 +08:00
JW Wang 15d26ae3e8 Bug 1417305. P2 - move some code from NotifyDataEnded() into NotifyDownloadEnded() to make the code more readable. r=bechen,gerald
MozReview-Commit-ID: LveThVjuemq

--HG--
extra : rebase_source : 8a3164b767fa86468725de9401db308daeba591d
2017-11-15 11:07:06 +08:00
JW Wang e02c72ba9e Bug 1417305. P1 - let callers of MediaResourceCallback::NotifyDataEnded() decide whether to call it synchronously. r=bechen,gerald
Instead of doing dispatch inside MediaResourceCallback::NotifyDataEnded(),
we let the callers decide whether to call the function synchronously. This is required
by ChannelMediaResource::CacheClientNotifyDataEnded() which will run off the main thread.

MozReview-Commit-ID: IzUYw8QMZbD

--HG--
extra : rebase_source : b888049d5b999a37515f00e52ae02dcf17f227e8
extra : intermediate-source : 7b660cd9b9fbb1a00e427b8e9074c9b736a80ae9
extra : source : cc055c39bd9fbbeb4354bbbebe0c46512be6e3a3
2017-11-10 14:27:59 +08:00
JW Wang da256ca76e Bug 1411476. P5 - dump debug info for ChannelMediaResource. r=gerald
MozReview-Commit-ID: GjdtrlNb948

--HG--
extra : rebase_source : 248f4926435118ddc8baa0f901c5e4ec3f699c64
2017-10-25 13:57:39 +08:00
Sebastian Hengst 32f7c8fec3 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 1h3kZyrtqSt
2017-10-17 11:45:16 +02:00
Chris Pearce 2ba329dae6 Bug 1409178 - Move DecoderTraits::CreateDecoder() to ChannelMediaDecoder::Create(). r=jwwang
Now DecoderTraits doesn't need to depend on ChannelMediaDecoder.

MozReview-Commit-ID: D4AUiV2eGWy

--HG--
extra : rebase_source : 38e6c4cdd0f7e32473c6945550bca6fd0cc72bf2
2017-10-16 22:55:26 +02:00
Kris Maglione 60d080b412 Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn
MozReview-Commit-ID: 8Oei6TuXNbu

--HG--
extra : rebase_source : 31c583c699790cbcf302064146d313ee8126ef0c
2017-10-15 23:15:40 -07:00
Chris Pearce 47c2e3ae92 Bug 1405697 - Move BaseMediaResource declaration to its own file. r=jwwang
This means we can simplify MediaResource.h to only include the abstract
interface, and MediaResourceIndex.

I also had to add a few includes here and there to fix the non-unified build.


MozReview-Commit-ID: 4R7LTXq25dm

--HG--
rename : dom/media/MediaResource.h => dom/media/BaseMediaResource.h
extra : rebase_source : edef4a65df4dcb92f8536052d170d78f95315753
2017-10-04 20:57:11 +02:00
JW Wang 6dcbfcbee7 Bug 1398659. P4 - remove unused code and add some assertions. r=gerald
MozReview-Commit-ID: LRgF9qjdMXz

--HG--
extra : rebase_source : af8b8bb4272c9be0f0ab8b51356362e9676c7076
extra : intermediate-source : 640d38acf9d3cf4aa583c67fc20ea487c849a570
extra : source : 0faec6a6b214ce4d5ca59ac2b098d4a5bfe4470b
2017-09-05 17:39:57 +08:00
JW Wang be83fdf7b4 Bug 1398659. P3 - ChannelMediaResource::Open() is a no-op for a cloned resource. r=gerald
1. mChannel is null.
2. mCacheStream has been initialized by InitAsClone().

So ChannelMediaDecoder::Load() doesn't need to call OpenResource(nullptr) at all.

MozReview-Commit-ID: FeARp9fu65L

--HG--
extra : rebase_source : ee3ae9bfa6830ed18fea152e12da18e181870d2d
extra : intermediate-source : 6b78ae143afa325b378d7cc2cbd2e3e0bcfdfe93
extra : source : 098787b9606b70697a3b1762b35a488799995475
2017-09-05 17:35:24 +08:00
JW Wang 7183d8c7c6 Bug 1395802. P1 - add AbstractMainThread() to MediaResourceCallback. r=cpearce
This is required by P3 to preserve the ordering. E.g. we want
mChannelStatistics.AddBytes() to happen before the new data is consumed
by the decoder and is made observable to the main thread. Using
SystemGroup::Dispatch() won't guarantee the ordering.

MozReview-Commit-ID: 7MP0CzTGpOs

--HG--
extra : rebase_source : 1161b7c713f57625f38b70714bb8684c2edecb2a
extra : source : 22b362b56f218acb70cc7ce3c0fd0ea113563681
2017-09-06 15:12:34 +08:00
Kaku Kuo e738871d59 Bug 1393399 P3 - keep the MediaDecoderOwner's identification in MFR; r=gerald
When GPU process crashes, the MediaDecoder, MDSM, and MFR are all destroyed.
So, we use MediaDecoderOwner to identify which video we're dealing with.

MozReview-Commit-ID: 1cv08M7Cpcf

--HG--
extra : rebase_source : 62f7be874d97a58eb4c1d7a98b4e9fe83a9313d3
2017-08-31 17:31:51 +08:00
JW Wang 2cbbe83757 Bug 1393386. P2 - remove MediaDecoder::GetResource(). r=gerald
MozReview-Commit-ID: 7OfkJthwfoM

--HG--
extra : rebase_source : 88b63f6ebbab3a4df15febede377e427e32e065e
extra : intermediate-source : 39514e130ddbda604a9fdc69fd99d0248ed40420
extra : source : 91eded128b33b655d023f8aa73f9eaf2a38aac4a
2017-08-24 18:10:31 +08:00
JW Wang 4af519df25 Bug 1393386. P1 - make PinForSeek/UnpinForSeek pure virtual. r=gerald
Sub-classes should know how to pin/unpin the resource.

MozReview-Commit-ID: 50S8oSD5oEU

--HG--
extra : rebase_source : 5e1b7c657b759c0d1dfdd7b5c0a4b7dbc4077ffe
extra : intermediate-source : 3000b76a3b97c08955c2d584ac215114c8e8f59a
extra : source : a56b9846db916ff85a0cae09736c3284bd895506
2017-08-24 18:08:37 +08:00
JW Wang 2c37ac8f7c Bug 1393379. P1 - make MediaDecoder::AddSizeOfResources pure virtual. r=gerald
We will move the implementation to sub-classes which have more details
about how to calculate the resource size.

MozReview-Commit-ID: 7lfiz5GNtPE

--HG--
extra : rebase_source : bf14ef91a6de456d65bee7cb1f53f8e542f55247
extra : source : 22640df9dd3a1491594a82b3d0bd175e46073fa3
2017-08-24 17:35:24 +08:00
JW Wang 59d7107e86 Bug 1393369. P1 - virtualize MediaDecoder::GetCurrentPrincipal() so the sub-classes know how to calculate the current principal. r=gerald
MozReview-Commit-ID: EOUtPE4hfgO

--HG--
extra : rebase_source : d15166e373fdd3a8490e2c794215aeb2551a7397
extra : source : 5f627ea709d24c8b7c5ddd0115524ef734378e66
2017-08-24 16:58:06 +08:00
JW Wang 3202c8815c Bug 1393346. P1 - virtualize IsTransportSeekable(). r=gerald
MozReview-Commit-ID: LIwEEbH3tBT

--HG--
extra : rebase_source : e02954fb3b6ddf40259bc6c69221192e01fc1410
2017-08-24 00:06:23 +08:00
JW Wang c960cfcc65 Bug 1392919. P1 - include the suspend status when notifying NotifySuspendedStatusChanged. r=gerald
MozReview-Commit-ID: GwzIBNLjcZr

--HG--
extra : rebase_source : 7673ba535636b3442f3987d3fe30f7e00822c621
2017-08-23 14:32:51 +08:00
JW Wang 41cd273f4e Bug 1391142. P3 - remove IsLiveStream() from MediaResource. r=gerald
MozReview-Commit-ID: DBFrYfj2lGB

--HG--
extra : rebase_source : 18532f55f38c5ac54660c11f078741e09273a30a
extra : source : 0e45bca0cdc0b2428216e6c9a55f8651e5b21017
2017-08-17 15:20:40 +08:00
Chris Pearce 09b9dbe471 Bug 1390748 - Remove ChannelMediaDecoder::CloneImpl() and remove subclasses of ChannelMediaDecoder. r=jwwang
MozReview-Commit-ID: 6nlBArYgwEJ

--HG--
extra : rebase_source : 5a87dfe0d77fc23d36a4f57452322c39d720698c
2017-08-15 17:52:17 +12:00
Carsten "Tomcat" Book cdf7a88921 Backed out changeset d3c000525403 (bug 1390748)
--HG--
extra : rebase_source : e8fcead7d669d02c1696a522777c83e4b0def623
2017-08-17 08:35:25 +02:00
Chris Pearce 51800b3d2a Bug 1390748 - Remove ChannelMediaDecoder::CloneImpl() and remove subclasses of ChannelMediaDecoder. r=jwwang
MozReview-Commit-ID: 6nlBArYgwEJ

--HG--
extra : rebase_source : eb7a6fedf7b118e951e5f701b2c9f54459b3f3f0
2017-08-15 17:52:17 +12:00
Phil Ringnalda 38ce1ea2a0 Backed out 10 changesets (bug 1390748) for build bustage
Backed out changeset 02b36ee5fb17 (bug 1390748)
Backed out changeset 84e8bf01c856 (bug 1390748)
Backed out changeset fc8989be30f3 (bug 1390748)
Backed out changeset 14d421ace6cc (bug 1390748)
Backed out changeset 7dadac869038 (bug 1390748)
Backed out changeset 0e77809e7bc2 (bug 1390748)
Backed out changeset bf78a8dce9c5 (bug 1390748)
Backed out changeset 5fa77990472e (bug 1390748)
Backed out changeset 5d3b637d2485 (bug 1390748)
Backed out changeset 634fe076d134 (bug 1390748)

MozReview-Commit-ID: Dxio8vXDCHg
2017-08-16 21:33:10 -07:00
Chris Pearce d22c79dd24 Bug 1390748 - Remove ChannelMediaDecoder::CloneImpl() and remove subclasses of ChannelMediaDecoder. r=jwwang
MozReview-Commit-ID: 6nlBArYgwEJ

--HG--
extra : rebase_source : 5a669544b7a9c6f2d4d27a47c621c21b9317f789
2017-08-15 17:52:17 +12:00
JW Wang 32951f4824 Bug 1388604 - move SetReadMode() from MediaResource to BaseMediaResource. r=gerald
It would be less accurate to call SetReadMode(MediaCacheStream::MODE_PLAYBACK)
in ChannelMediaDecoder::MetadataLoaded() instead of DecodeMetadataState::OnMetadataRead()
because MDSM might have started decoding by the time 'metadata loaded' event arrives
in the main thread. However this little inaccuracy should be fine since it only
affects a small amount of data concerning the eviction algorithm.

MozReview-Commit-ID: JoQMGr5Fvge

--HG--
extra : rebase_source : 3663a028522cc8b973964f62e59d7568a5eba10a
extra : source : 359b4454633432d3334a106aedb267a2451afb45
2017-08-09 11:06:29 +08:00
JW Wang cf112f4b88 Bug 1388228. P6 - following P5, we are now able to move some methods that are related to nsIChannel to BaseMediaResource. r=gerald
So we reduce the number of unimplemented methods in the sub-classes of MediaResource.

MozReview-Commit-ID: EAmUEv9WQk8

--HG--
extra : rebase_source : deed5fd089e8c42a5a6ab0546e0781d0061591e5
2017-08-07 18:09:56 +08:00
JW Wang 6ab3fdad07 Bug 1388228. P5 - move some more members to ChannelMediaDecoder. r=gerald
Those members only make sense for ChannelMediaResource.

MozReview-Commit-ID: 2z6WPQeJnIT

--HG--
extra : rebase_source : 7f43635ee91c8fad1d6ad6f56788e880d54beab2
2017-08-07 13:23:43 +08:00
JW Wang e5f016de87 Bug 1388228. P4 - move the implementation of MediaDecoder::CanPlayThroughImpl() down to ChannelMediaDecoder. r=gerald
Because GetStatistics() only makes sense for ChannelMediaResource.

MozReview-Commit-ID: HkEpb4frUx1

--HG--
extra : rebase_source : 7086721f47b381b692a165302ff3bdc13caa8b41
2017-08-07 11:48:43 +08:00