Commit Graph

155 Commits

Author SHA1 Message Date
Jean-Yves Avenard
0b347434ba Bug 1218157: Only ever read from cached data in NotifyDataArrived. r=cpearce
The logic of queuing NotifyDataArrived and read data there was fundamentally flawed as we would continually perform reads from the same MediaResource at two different ends.
This would cause repetitive seeks and data being removed from the media cache. Worse, a read in NotifyDataArrived would cause another NotifyDataArrived to be scheduled.

As range-request are extremely slow, it would result in stutters and constant interruptions.
2015-10-29 10:18:58 +11:00
JW Wang
fb4f215e74 Bug 1217714 - Remove some unused functions from MediaDecoderReader. r=jya. 2015-10-26 14:10:29 +08:00
JW Wang
44d9dd6f96 Bug 1216850. Part 1 - backout bug 1215003. r=me. 2015-10-21 10:59:56 +08:00
Nathan Froyd
9dcc7f6a0c Bug 1190472 - part 3 - optimize pushing an entire queue onto MediaRawDataQueue; r=kinetik
In the one place we push a MediaRawDataQueue onto a MediaRawDataQueue,
we don't use the pushee aftewards.  It's more efficient to indicate that
by using Move(), and we can then save on reference-counting things
needlessly.
2015-10-01 19:06:50 -04:00
Nathan Froyd
75f9108c18 Bug 1190472 - part 2 - delete unused MediaRawDataQueue::Push method; r=kinetik
We don't call it, and it's not particularly efficient anyway.
2015-10-01 19:04:02 -04:00
Nathan Froyd
c91ebbc90c Bug 1190472 - part 1 - improve MediaRawDataQueue's reference-counting behavior; r=kinetik
Sometimes when we push onto the queue, we don't need to hold a reference
afterwards.  In that case, we can pass the reference in and avoid
unnecessary reference counting.
2015-10-01 19:02:18 -04:00
JW Wang
698a2ef447 Bug 1215003. Part 2 - rename AsyncReadMetadata and move it to the private section. r=gerald. 2015-10-19 10:52:15 +08:00
Nathan Froyd
e4e2da55c9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Jean-Yves Avenard
7c80fad3c7 Bug 1213176: P1. Remove most MediaFormatReader dependencies on its MediaDecoder parent. r=jwwang
The LayersBackend can be defined at construction time, however if a parent MediaDecoder exists, the value will be overwritten by the MediaDecoderOwner value.
2015-10-15 02:04:00 +02:00
JW Wang
c8950ac644 Bug 1214989. Part 2 - add MediaDecoderOwner to Clone() and overrides. r=gerald. 2015-10-15 11:37:47 +08:00
JW Wang
e7d54121a1 Bug 1214989. Part 1 - add MediaDecoderOwner to the constructors of MediaDecoder and sub-classes. r=gerald. 2015-10-15 11:36:21 +08:00
JW Wang
8e808c080b Bug 1212723. Part 2 - remove unused argument aCloneDonor from MediaDecoderReader::Init(). r=jya. 2015-10-13 15:28:57 +08:00
JW Wang
faa15fb677 Bug 1212723. Part 1 - don't share mBufferedState per bug 1212723 comment 6. r=jya. 2015-10-13 15:28:50 +08:00
JW Wang
0e7279c703 Bug 1213726 - Remove AbstractMediaDecoder::HasInitializationData(). r=kinetik. 2015-10-12 12:08:46 +08:00
JW Wang
b66b801b82 Bug 1212701. Part 1 - remove AbstractMediaDecoder::OnDecodeTaskQueue(). r=jya. 2015-10-12 12:05:49 +08:00
JW Wang
ddb5ad7d92 Bug 1212246. Part 1 - remove the aBorrowedTaskQueue parameter from the MediaDecoderReader constructor. r=jya. 2015-10-09 09:25:23 +08:00
Jean-Yves Avenard
7d0beeed77 Bug 1212176: Remove arguments passed to MediaDataDemuxer::NotifyDataArrived API. r=cpearce
Be more explicit on what it does and how it should be used.
2015-10-08 20:47:21 +11:00
Jean-Yves Avenard
d0715538c2 Bug 1206977: [webm] P7. Remove IntelWebMVideoDecoder. r=kinetik
That code path is no longer used and handled directly in the MediaFormatReader.

Also, partially revert commit ac6d0b0befb2 as it broke WebMReader.
2015-10-08 00:34:45 +11:00
Nigel Babu
52bc70c35b Backed out 16 changesets (bug 1206977, bug 1211652, bug 1211335) for linux bc7 bustage ON A CLOSED TREE
Backed out changeset 51b1b076a386 (bug 1206977)
Backed out changeset dec7c35469d1 (bug 1206977)
Backed out changeset bf9ddc78b394 (bug 1206977)
Backed out changeset 08f5cff5aa12 (bug 1206977)
Backed out changeset e4e91de99867 (bug 1206977)
Backed out changeset 696ecf2e2947 (bug 1206977)
Backed out changeset ab2d524a9b35 (bug 1206977)
Backed out changeset d66be0e4547f (bug 1206977)
Backed out changeset 64c58afbd6c1 (bug 1206977)
Backed out changeset eb10d09015e1 (bug 1206977)
Backed out changeset 042959216393 (bug 1206977)
Backed out changeset 7e0de7f62202 (bug 1206977)
Backed out changeset 3d095569f6ba (bug 1206977)
Backed out changeset 041418a07ae5 (bug 1206977)
Backed out changeset 654970da23e4 (bug 1211335)
Backed out changeset 8ba8e24a84d3 (bug 1211652)
2015-10-07 13:43:39 +05:30
Jean-Yves Avenard
3928f33b75 Bug 1206977: [webm] P7. Remove IntelWebMVideoDecoder. r=kinetik
That code path is no longer used and handled directly in the MediaFormatReader.

Also, partially revert commit ac6d0b0befb2 as it broke WebMReader.
2015-10-07 16:40:27 +11:00
Nicholas Nethercote
7700404de3 Bug 1208300 (part 4) - Remove gfxRGBA and some related things. r=jwatt.
Hooray!
2015-09-24 19:24:16 -07:00
Jean-Yves Avenard
9052bbef25 Bug 1208799: [webm] Use first track found. r=kinetik 2015-09-29 11:37:14 +10:00
Jean-Yves Avenard
a170acd84e Bug 1204407: P2. Remove no longer required MediaDataDemuxer APIs. r=cpearce 2015-09-16 18:14:15 +10:00
Jean-Yves Avenard
89aaeddd55 Bug 1204419: P4. Remove MediaDataDemuxer API no longer used. r=cpearce 2015-09-16 18:14:12 +10:00
Jean-Yves Avenard
b52263188a Bug 1204419: P3. Remove now unused MediaDecoderReader functions. r=cpearce 2015-09-16 18:14:12 +10:00
Jean-Yves Avenard
03263ef23e Bug 1204419: P1. Fix webm headers. r=kinetik 2015-09-16 18:14:10 +10:00
Jean-Yves Avenard
5c049f4667 Bug 1204776: P1. Have the PlatformDecoderModules use their own log. r=cpearce
Stop using MP4Demuxer.
2015-09-16 12:26:03 +10:00
Jean-Yves Avenard
2d45ab2aaf Bug 1203367: Ensure WebMBufferedState is only used after reading metadata. r=kinetik
We also now limit the use of the WebMBufferedState for calculating the buffered range and seeking on buffered data.
2015-09-14 19:06:50 +10:00
Jean-Yves Avenard
d60f8b1dd9 Bug 1199518: [webm] P2. Properly determine next keyframe time. r=kinetik 2015-09-12 20:53:25 +10:00
Jean-Yves Avenard
d5782105c2 Bug 1199518: [webm] P1. Have WebMDemuxer use its own logger. r=kinetik 2015-09-12 20:53:24 +10:00
Nathan Froyd
71ab89f807 Bug 1202474 - improve refcounting behavior of webm decoders; r=kinetik
We can remove refcounted things from deques without unnecessary refcounting.
2015-09-07 20:36:47 -04:00
Jean-Yves Avenard
99fb2040fe Bug 1199878: [webm] P2. Hold one frames for which the duration can't be known or estimated. r=kinetik 2015-09-01 10:47:07 +12:00
Nicholas Nethercote
69d088e45f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Jean-Yves Avenard
986e495fea Bug 1197125: [webm]. Don't load the entire webm in RAM. r=kinetik
Instead we parse it in chunks of 1MiB max.
2015-08-28 14:06:35 +10:00
Jean-Yves Avenard
27fcb73603 Bug 1199032: [webm] P1. Explicitly differentiate WebM usage for mediasource. r=kinetik
Relying on the data being fully buffered or not turned out to not be such a great idea.
2015-08-28 14:06:33 +10:00
Jean-Yves Avenard
f5e672a07b Bug 1197977: [webm]. Ensure resource length calculation never underflows. r=kinetik 2015-08-27 12:28:20 +10:00
Jean-Yves Avenard
be2837a7a6 Bug 1195073: [webm] P6. Calculate cluster's end offset if its size is known in advance. r=kinetik.
This allows to detect the end of a webm media segment without having to wait for the start of a new one.
Also record where an init segment (EBML) starts as this will be required by the WebM ContainerParser.
2015-08-24 23:13:49 +10:00
Jean-Yves Avenard
98864bb30c Bug 1195073: [MSE] P5. Detect out of order appends and recreate demuxer. r=gerald
The webm demuxer will only handle data where frames's a monotonically increasing.
2015-08-24 23:13:49 +10:00
Jean-Yves Avenard
693ecb89cc Bug 1195073: [MSE/webm] P4. Limit nestegg reads to the last block's boundaries. r=kinetik
This prevent entering into an unrecoverable error state when parsing incomplete data as often seen with MSE.
2015-08-24 23:13:48 +10:00
Jean-Yves Avenard
d6a6fb71ca Bug 1195073: [webm] P3. Initialize members. r=kinetik 2015-08-24 23:13:48 +10:00
Jean-Yves Avenard
803201660b Bug 1195073: [webm] P2. Add WebMBufferedState::GetLastBlockOffset method. r=kinetik
MSE may input partial media segment, which could cause the WebMDemuxer and libnestegg to error upon encountering an incomplete block which can't be recovered from.
this will allow to limit read to known complete blocks.
2015-08-24 23:13:47 +10:00
Timothy B. Terriberry
94ebb79c9f Bug 1196353 - Use standard Xiph extradata format to pass headers from demuxers to decoders. r=jya 2015-08-21 10:17:00 -04:00
Jean-Yves Avenard
07f01c536d Bug 1194884: [webm] P1. Use MediaResourceIndex. r=j^
Remove duplicated code.
2015-08-16 11:58:40 +10:00
Aryeh Gregor
d23d38648e Bug 1179451 - Part 4: Don't pass nsRefPtr&& to functions that want raw pointers. r=froydnj 2015-08-13 15:22:48 +03:00
Jean-Yves Avenard
b77989d237 Bug 1190238: P3. Do not loop calling MediaResource::Read or ReadAt, let MediaResourceIndex do it for us. r=cpearce
This allows to remove a fair amount of duplicated logic.
Most of it is in obsoleted code though.
2015-08-13 15:27:10 +10:00
Jean-Yves Avenard
b2f4db10c9 Bug 1190238: P1. Remove MediaResource::Read/Seek. r=cpearce
This functionality is now replaced with a dedicated new MediaResourceIndex class.
This allows for concurrent Read/Seek use of the MediaResource without having side effects.
2015-08-13 15:27:09 +10:00
Bobby Holley
7f57389c3d Bug 1190495 - Separate FlushableTaskQueue into its own file. r=cpearce
This thing is garbage, and I don't want to hoist it into XPCOM.
2015-08-11 08:55:18 -04:00
Jean-Yves Avenard
c9c6a84341 Bug 1146086: Properly marking overridden member with override keyword. v2. a=bustage 2015-08-11 16:42:42 +10:00
Jean-Yves Avenard
431834c7cd Bug 1146086: Properly marking overridden member with override keyword. a=bustage
Interesting that it was never picked up, until only one was done.
2015-08-11 16:26:20 +10:00
Alfredo Yang
fa4f511520 Bug 1146086: use promise to Init() in PlatformDecoderModule. r=jya,r=cpearce 2015-08-11 14:09:12 +10:00