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

85 Коммитов

Автор SHA1 Сообщение Дата
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
Nicholas Hurley d4f64ba24e Bug 1391467 - Remove --enable-necko-protocols. r=gps,valentin
This patch removes the ability to select which protocols you want
included in necko, a wholly untested configuration that is broken in
practice. We have no need of this kind of configurability in necko.

In addition, this removes the final vestiges of rtsp support, which was
originally removed in bug 1295885 but still had some stuff hanging
around behind some ifdefs (that were never true).

MozReview-Commit-ID: KOEaDmit2IL

--HG--
extra : rebase_source : f6c2fdb972aaba46e922cda801252dc953550b94
2017-08-17 17:30:57 -07:00
JW Wang 9bfb2b1c06 Bug 1390443. P2 - remove unused IsExpectingMoreData(). r=cpearce
MozReview-Commit-ID: KTxmjIrD1WB

--HG--
extra : rebase_source : 8c1fc9b4da08290f7a177ef60793c831b0cc7a25
extra : intermediate-source : a86b94e4bdc04bae34f6e8966dfe9b5e11f98677
extra : source : 498e2844d2d0d1cee087552f5aaf5aac7e34c3bf
2017-08-16 15:37:29 +08:00
Sebastian Hengst 9d63faba53 Backed out changeset 05b2bf2e6017 (bug 1390443) 2017-08-21 10:19:39 +02:00
JW Wang a7f1c5d69b Bug 1390443. P2 - remove unused IsExpectingMoreData(). r=cpearce
MozReview-Commit-ID: KTxmjIrD1WB

--HG--
extra : rebase_source : 3cad2f2df2f75d6b052cbc6e6f5623ba9c587987
extra : intermediate-source : a86b94e4bdc04bae34f6e8966dfe9b5e11f98677
extra : source : 498e2844d2d0d1cee087552f5aaf5aac7e34c3bf
2017-08-16 15:37:29 +08:00
JW Wang af3ce851d6 Bug 1388612. P1 - remove MediaResource::EnsureCacheUpToDate(). r=gerald
This is a workaround to fix bug 687972. It should be OK now to remove
it since we have fix bug 1108960  where MediaCache failed to run the
update loop to update the suspend status of the stream.

MozReview-Commit-ID: MbInehhScs

--HG--
extra : rebase_source : 94345a00af31834db8b9858cdf5a9e889044156a
extra : source : 70f626894c3a15c8077f70425a97004478caa9e1
2017-08-09 16:07:53 +08: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 b2d75fa057 Bug 1383628. P5 - move CanClone() from MediaResource to BaseMediaResource. r=gerald
1. we move clone related methods to BaseMediaResource which is the only cloneable sub-class of MediaResource.
2. add CanClone() to ChannelMediaDecoder to reduce the dependency on MediaResource for HTMLMediaElement.
   MediaResource should be internal details to MediaDecoder.

MozReview-Commit-ID: Hl2nAiuyTO0

--HG--
extra : rebase_source : 43dd9ee33ef2ef2e9093eb6b264dc174379d61d2
extra : source : 978ded48a90f2c407c4545486243acabf492736a
2017-08-04 15:29:55 +08:00
JW Wang 163c6a8c8b Bug 1383628. P4 - move CloneData() and Create() from MediaResource to BaseMediaResource. r=gerald
Now we can store a more specific resource type in ChannelMediaDecoder.

MozReview-Commit-ID: EzXC547O7aR

--HG--
extra : rebase_source : eea1872eeeee9b5964fcc767c79b0315bf277602
extra : source : 84011bf4847bbed26e89af0b831aded93522f7ac
2017-08-04 14:52:22 +08:00
Gerald Squelart 63070aab2f Bug 1384243 - Sanitize offset inputs in MediaResourceIndex - r=cpearce
Also check that the offset doesn't overflow during reads.

MozReview-Commit-ID: DT5neeZuMZu

--HG--
extra : rebase_source : 1f0de82916ebf770a0ea2570161d607216232dfa
2017-08-01 14:07:55 +12:00
JW Wang c6e43291cb Bug 1376363. P3 - remove MediaResource::GetContentType() and its friends. r=gerald
Note we remove the call to mChannel->SetContentType() from RecreateChannel().

The hint never works as expected for [1] is the only caller to
nsIChannel::GetContentType() and MediaResource::Create() always happens
before any reads from the resource.

[1] http://searchfox.org/mozilla-central/rev/b425854d9bbd49d5caf9baef3686e49ec91c17ec/dom/media/MediaResource.cpp#1500

MozReview-Commit-ID: 1n4yHEouCjC

--HG--
extra : rebase_source : 9a7345c29b985ddee7a90a94191e9d526e2a0a67
extra : source : 054d9ffaf21eb937a6349df76228269ad2d7dc2c
2017-06-26 21:39:16 +08:00
JW Wang a05b9a90ee Bug 1376360. P1 - give CloneData() a default implementation for most resource types don't support clone. r=gerald
Also remove CanClone() overrides that are identical to that of the base class.

MozReview-Commit-ID: A0Q5ychQtso

--HG--
extra : rebase_source : 3369558a8e6bc9f86ab6dcdc39fe40f686041001
2017-06-23 16:26:30 +08:00
Gerald Squelart c486410640 Bug 1374180 - MediaResourceIndex won't use ReadFromCache, to keep MediaCache more consistent - r=cpearce
Bug 1368837 (Add lockless cache to MediaResourceIndex) used
MediaResource::ReadFromCache when trying to fill its local cache. But this
meant that these reads would not count as "real reads" for the MediaCache,
which could lead to unexpected states, e.g. "Played block after the current
stream position?"

To solve this, this patch reverts to using normal ReadAt() calls, which let
the MediaCache update itself properly.

While still trying to read more than what is requested (to hopefully fulfill
future reads from the local cache), we don't want to be reading so much that
we block waiting for data past the caller-expected point.
To do this, MediaResourceIndex::UncachedRangedReadAt() is called to try and
read as much as could fill the local cache, but if a single
MediaResource::ReadAt() ends before we can fill the local cache, but *after*
the minimum caller-requested size, we stop trying to read, as such extra read
is at risk of blocking (assuming that the caller knows not to read too far.)

MozReview-Commit-ID: 6fGvJpmkuLz

--HG--
extra : rebase_source : bf8e9f20599a05c8f3f221b55d678f0b5da447a9
2017-06-21 11:35:00 +12:00
JW Wang 4bc2a74510 Bug 1374566 - remove methods that have no callers. r=gerald
MozReview-Commit-ID: 7Ze0q32VS0h

--HG--
extra : rebase_source : 470fdf5d480b9115039faeb519756e05787011af
extra : source : be2cd2df4469cec5ded0f9d07977f8f09ba60cb6
2017-06-20 16:47:03 +08:00
JW Wang 09611a2a6e Bug 1373577. P3 - fix the comment since MediaResource::ReatAt() does update the offset of MediaResource. r=jya
MozReview-Commit-ID: AV2UhhBKNxJ

--HG--
extra : rebase_source : b8e03589a2712f3588de3226228e2b7b2b4d76cb
extra : source : 3d57529a2e1d7c628140968640ebc32d4409d3c9
2017-06-15 17:39:19 +08:00
JW Wang aa62c9e3cc Bug 1373577. P2 - move the code of MediaResource::MediaReadAt() into MediaResourceIndex. r=jya
MediaReadAt() accesses only public members of MediaResource. It doesn't have
to be a member of MediaResource.

MozReview-Commit-ID: D7ByCLiAF4X

--HG--
extra : rebase_source : a25cdee55882c1a5da5816a21f600aab6d4491b3
extra : source : ecbf4d9750d7c0e34fe55208903f0712b4759023
2017-06-15 17:35:05 +08:00
JW Wang 8e98e3c0a2 Bug 1373577. P1 - devritualize MediaResource::MediaReadAt(). r=jya
The difference is the sub-class override doesn't call DispatchBytesConsumed().
It doesn't make sense not to call that after you do consume some data.
For callers that want silent reads, they should call ReadFromCache() instead.

MozReview-Commit-ID: J3dn8qgWKoL

--HG--
extra : rebase_source : 45f465e45ef3d67f989a3235dc1ddd76b11f1a81
extra : source : 9daf21e4c588e6cf13f3b28d8ffd8719573158c0
2017-06-15 17:17:08 +08:00
Gerald Squelart 74fb630e36 Bug 1369322 - MediaResourceIndex follows ShouldCacheReads recommendation - r=cpearce
MozReview-Commit-ID: A8mtz2fJd71

--HG--
extra : rebase_source : 81949d559c5482951ed9186c92d0759dd4a6b3b0
2017-06-02 16:10:48 +12:00
Gerald Squelart caaa280433 Bug 1369322 - MediaResource::ShouldCacheReads to indicate usefulness of caching - r=cpearce
This hint will inform readers if caching is discouraged (e.g., for
SourceBufferResource) or recommmended (e.g., for MediaCache-backed
ChannelMediaResource).

MozReview-Commit-ID: 7hopNS0s5tE

--HG--
extra : rebase_source : 681646cc904229e8513adb148baa085254508049
2017-06-02 14:27:17 +12: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
JW Wang a8484aeb82 Bug 1367705. P2 - since RecordStatisticsTo() is removed in P1, we can now init mChannelStatistics in the constructor. r=cpearce
MozReview-Commit-ID: 5YcxnO368ex

--HG--
extra : rebase_source : bc0e757893de49fcdecf145b15fe13b194c23aa9
extra : intermediate-source : b4fd2265ca2652933fecf5502a4228a3bb0cd8f3
extra : source : 587479f45ef882571e5486b20b0b39dffe4d18fb
2017-06-02 11:51:52 +08:00
JW Wang 2688d70531 Bug 1367705. P1 - remove unused RecordStatisticsTo(). r=cpearce
This allows us to init mChannelStatistics in the constructor and
remove the possibility where we deref a null mChannelStatistics.

MozReview-Commit-ID: 9ZIRu0VXpd6

--HG--
extra : rebase_source : 741c8220e7e451b870aa9edd7d4006fd5c83eec4
extra : intermediate-source : 3cfd983577294749d85a4403724b42689f648df9
extra : source : a3f466b63da03a4989c799c169666bf0df937917
2017-06-02 11:10:38 +08:00
Gerald Squelart 8d4b44ad0f Bug 1368837 - Convert printfs into MOZ_LOG(MediaResourceIndex) - r=cpearce
MozReview-Commit-ID: Bhi1vxDPwDV

--HG--
extra : rebase_source : 4c66f796c5627ca85dbfbeab8ff40909a0249e7b
2017-05-30 14:12:38 +12:00
Gerald Squelart 0a2dc3ad21 Bug 1368837 - Replace debugging ReadAt with CachedReadAt code - r=cpearce
MozReview-Commit-ID: 88j9oAPdI0w

--HG--
extra : rebase_source : 7bf1da0b98eeaa871809c5c7386a7a26f99c7f29
2017-05-29 13:36:27 +12:00
Gerald Squelart 1bb5358dcf Bug 1368837 - media.cache.resource-index controls the MediaResourceIndex cache size - r=cpearce
8KB by default, otherwise using the next power of two from the given
media.cache.resource-index (but staying within 32B-128KB).
'0' means we don't want to use caching.

MozReview-Commit-ID: 8LmS15Ft2MA

--HG--
extra : rebase_source : 992f377a07b7ab173a64fcfbfe45df1da87df31e
2017-05-30 21:43:28 +12:00
Gerald Squelart 9e967498fe Bug 1368837 - MediaResourceIndex::ReadAt tries to cache last-read block - r=cpearce
This is the core of this bug:
- We try to read past the end of the requested range, and save a block-full of
cached data. ("Block" is a memory range, with an alignment and size being a
power of two, to match existing caching happening in MediaCache and
FileBlockCache, and to play nice with the memory allocator.)
- If part of a requested read touches the existing cache, we can just read from
the cache, which means we don't involve any of the locking and IOs that normal
reads use.

The small extra work needed to cache more data in some reads is largely offset
by all the lock&IO-heavy reads that we can subsequently avoid.

UncachedReadAt, which is used internally by CachedReadAt, is left public
because it could be useful if the caller knows for sure that a particular read
is isolated.

(Note: The printfs, and comparison code in ReadAt, will be removed in later
patches. Also the block size will be later controlled by a pref.)

MozReview-Commit-ID: GFiaP5Io7Hf

--HG--
extra : rebase_source : 2bebcdb7854989b55f2026e92338a00ac29a5376
2017-05-30 14:59:30 +12:00
Gerald Squelart 861a99455f Bug 1368837 - Document that MediaResource::GetCachedDataEnd should return aOffset when out of cache - r=cpearce
MozReview-Commit-ID: JKeuEAjIRxr

--HG--
extra : rebase_source : 93e2883833d47626f8d3abce4a151d93c0c106f1
2017-06-01 11:29:49 +12:00
JW Wang c6c155a08e Bug 1364001. P1 - add an API to throttle download. r=cpearce
MozReview-Commit-ID: HdmAgvo1GE3

--HG--
extra : rebase_source : 97f0aa3e40c6c774ad7681ee2aae69393c47e741
extra : intermediate-source : 9f2e1751e19f88625d2a89dba0b1648f97d2478f
extra : source : b68fed514292e5e8c7815633052daeee24f64a95
2017-05-11 16:49:36 +08:00
JW Wang 240b996f12 Bug 1361964 - WebMBufferedState::UpdateIndex() should read from cache. r=jya
We don't want to trigger download when calculating buffer ranges since download
changes buffer ranges.

MozReview-Commit-ID: Be8qFUQ5PpR

--HG--
extra : rebase_source : 4fd77e031577332d9d112faef869cd935275b1af
2017-05-04 21:32:13 +08:00
JW Wang 84734bb3c0 Bug 1194891. P1 - plumb 'isPrivateBrowsing' down to MediaCacheStream. r=cpearce
MozReview-Commit-ID: EBKkOfK7K1p

--HG--
extra : rebase_source : 82daa16ffa0809a4de660867ab61d9a9efdf2a83
extra : source : b61d0c22837a6ee8085c95afbd1370ffa8286e6e
2017-04-06 16:20:00 +08:00
JW Wang a7ba58c6c2 Bug 1353668. P1 - add a member function, CopySegmentToCache. r=kaku
MozReview-Commit-ID: 5uEWpMigspX

--HG--
extra : rebase_source : 51860bbc6e4de4f80045c774d3393158ff2251dd
extra : source : 9cb8013b0761a95eb0b30b83d05361a6d4dad7fd
2017-04-05 17:24:03 +08:00
Gerald Squelart f17dd305d6 Bug 1331289 - Use MediaContainerType in MediaResource, SourceBuffer, TrackBuffersManager, and dependencies - r=jya
Continuing the work of replacing MIME strings with MediaContainerType, starting
from MediaResource and following the dependencies.

Most changes are mechanical: Just change ns*String into MediaContainerType, and
MIME string literals into MEDIAMIMETYPE("a/b").
Some checks for empty/invalid strings and lowercase comparisons can go, thanks
to the always-valid always-lowercase-MIME invariants of MediaContainerType.

One special case in is MediaSourceResource, which used to have an empty string
as its type (because its own type is not relevant, but its SourceBuffers carry
types). Because the inherited GetContentType *must* be overridden, and must
return a MediaContainerType, we needed a valid type even though it should not
be seen in the real world. I've chosen "application/x.mediasource" for that.

MozReview-Commit-ID: 1aCH75Kh2e6

--HG--
extra : rebase_source : 0d9cd9b69c264e5dcfc3845f80ee107f4bcbcd9a
2016-12-28 18:59:02 +11:00
Andrew McCreight fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd 826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
bechen 931402dd2f Bug 1291629 - Remove RTSP code. r=jwwang
MozReview-Commit-ID: AxaLwO4rTuY

--HG--
extra : rebase_source : f8a5de1be1471238d62b6bbc419b3a45f2590da6
2016-08-10 10:32:25 +08:00
Nicholas Nethercote 3b0485fcdb Bug 1294645 - Don't use NS_CALLBACK for callbacks in nsI{Input,Output,UnicharInput},Stream.idl. r=froydnj.
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.

This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.

--HG--
extra : rebase_source : c15d85298e0975fd030cd8f8f8e54501f453959b
2016-08-12 17:36:22 +10:00
JW Wang d27b3f1144 Bug 1273063 - remove ChannelMediaResource::mIsTransportSeekable. r=cpearce.
MozReview-Commit-ID: DvBaIzbh72D

--HG--
extra : rebase_source : d507ef58c8556ee45be49668422c3843c92ed5bc
2016-05-17 10:33:34 +08:00
Jean-Yves Avenard 7a839f5456 Bug 1251044: P2. Remove dead code and generalise the use of content-range header. r=roc
MozReview-Commit-ID: ESMlcBOQKsy
2016-02-29 11:41:14 +11:00
Jean-Yves Avenard bc55ba93a4 Bug 1240411: P9. Clean up media headers. r=jwwang
Remove redundant virtual keyword and add missing override if any.
2016-01-19 19:47:36 +11:00
Andrea Marchesini 7167daa292 summary: Bug 1231378 - part 5 - Fix uninitialized members of classes in dom/{workers,events,media,canvas}, r=smaug 2016-01-12 18:16:59 +00:00
Carsten "Tomcat" Book 00abd66130 Backed out changeset 6d08ab04a77c (bug 1231378) 2016-01-12 15:48:53 +01:00
Andrea Marchesini 98f16784c5 Bug 1231378 - part 5 - Fix uninitialized members of classes in dom/{workers,events,media,canvas}, r=smaug 2016-01-12 13:57:37 +00:00
Mike Hommey 58b657359f Bug 1225682 - Don't use nsAuto{,C}String as class member variables in dom/media/. r=cpearce 2015-12-02 11:04:37 +09:00
Jean-Yves Avenard a7975b198f Bug 1227396: P8. Replace MediaByteRange with Interval<int64_t> typedef. r=cpearce
It's now okay to simplify.
2015-11-30 11:29:34 +11:00
Jean-Yves Avenard c8c275cee2 Bug 1227396: P7. Replace nsTArray<MediaByteRange> with dedicated MediaByteRangeSet object. r=cpearce 2015-11-30 11:29:34 +11:00
Jean-Yves Avenard 98b7b59261 Bug 1227396: P6. Replace MediaByteBuffer with Interval<int64_t>. r=cpearce 2015-11-30 11:29:33 +11:00
Jean-Yves Avenard 70f2124283 Bug 1227396: P2. Rename some MediaByteRange methods. r=cpearce
Will facilitate the replacement of MediaByteRange by Interval<int64_t>
2015-11-30 11:29:30 +11:00
Jean-Yves Avenard c92e468354 Bug 1227396: P1. Remove TimestampedMediaByteRange object. r=cpearce 2015-11-30 11:29:29 +11:00