Commit Graph

66 Commits

Author SHA1 Message Date
Jean-Yves Avenard
a16fab66e4 Bug 1362165: P7. Only complete appendBuffer once readyState has changed. r=jwwang
MSE specs require that the readyState be modified during either the Initialization Segment Received or the Coded Frame Processing algorithms.

At this stage, we only handle the Initialization Segment part (readyState moving from HAVE_NOTHING to HAVE_METADATA)

MozReview-Commit-ID: KBnnWuHJ6Om

--HG--
extra : rebase_source : a4450139762d5d033438fbee2ce560fe02ed6ffc
2017-05-09 12:23:11 +02:00
Jeff Walden
d73ce21741 Bug 1287006 - Adjust media/ code to not pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer. r=jw_wang, r=rjesup
--HG--
extra : rebase_source : 176a2afde5772bbdf43f0f6dc8082201acadcf4f
2017-02-13 09:07:40 -08:00
Bevis Tseng
f2bdbd8fd1 Bug 1314833 - Part 2.1: Factor out AbstractThread::MainThread() used in Media Playback. r=billm,jwwang
MozReview-Commit-ID: 9yJi3iDtVZG

--HG--
extra : rebase_source : 39c720ccc576ed9247b5e8abb70d99d7873b3ad6
2016-11-29 13:03:36 +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
Jean-Yves Avenard
162fa5f03b Bug 1299072: P11. Use MediaResult with AppendBuffer promises. r=gerald
Will allow to pass detailed failure causes in a followup patch.

MozReview-Commit-ID: 5yGjzZNcYWg

--HG--
extra : rebase_source : fdd76c98900320352ee3c349de1c40df29122ca9
2016-09-12 08:54:10 +10:00
Jean-Yves Avenard
5b04109e85 Bug 1297037: [MSE] Update Duration Change algorithm as per latest spec. r=gerald
The MSE spec was recently updated to use the highest end time across tracks rather than across the buffered ranges.

See https://github.com/w3c/media-source/issues/124 and the fix described in https://github.com/w3c/media-source/pull/154

MozReview-Commit-ID: 4CqI8d2e9gu

--HG--
extra : rebase_source : b25f0e2a76c517c0dca0a9def00edd6eff38d8ad
2016-08-26 16:39:36 +12:00
Jean-Yves Avenard
103da1bf41 Bug 1286810: [MSE] P2. Update duration change as per new MSE spec. r=gerald
See w3c/MSE Issue 19, 20 & 26.

Changing the duration now can never call the range removal algorithm. An explicit call to remove must be used for range removal.
This change performs the following:
- Require remove() for all Range Removals
- Error on Duration Changes that need remove first

MozReview-Commit-ID: 1fK2O1slnQ1
2016-07-19 11:45:28 +10:00
Jean-Yves Avenard
cdf4e99378 Bug 1286810: [MSE] P1. Error on abort() during Range Removals. r=gerald
As per https://github.com/w3c/media-source/issues/26

MozReview-Commit-ID: 1rNKVTBDjFY
2016-07-19 11:45:28 +10:00
Jean-Yves Avenard
01308240dd Bug 1286722: [MSE] P1. Add mediasource event handler attributes. r=bz
See https://github.com/w3c/media-source/issues/66

MozReview-Commit-ID: 9fANabkz5ud

--HG--
extra : rebase_source : 37ef4885191942c56cc2ff0e198c5cbc7cab0c4a
2016-07-14 18:28:19 +10:00
Jonathan Watt
b15368cfcb Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Jean-Yves Avenard
5f3b4ca5d5 Bug 1259274: [MSE] P3. Refactor handling of tasks so they only ever run concurrently. r=gerald
MozReview-Commit-ID: 1U8r82kTR0t

--HG--
extra : rebase_source : 0646125364bee89f37cfff426c1034a6feb3a516
2016-03-27 20:20:40 +11:00
Jean-Yves Avenard
8da4d6ea4d Bug 1259274: [MSE] P2. Remove unused code path. r=gerald
MozReview-Commit-ID: FHj3u1WL1ul

--HG--
extra : rebase_source : aa5303670890056e716edb3ce50e774df143c6e7
2016-03-27 18:44:10 +11:00
Jean-Yves Avenard
734a39347d Bug 1259274: [MSE] P1. Remove unnecessary abstraction layer. r=gerald
We now longer require an abstraction layer with the TrackBuffersManager now that the old MSE has been removed.

MozReview-Commit-ID: 3uEejohvFQD

--HG--
extra : rebase_source : 2e89fe4c7b9d13910fb6f26f0090fca26d19726f
2016-03-25 11:31:30 +11:00
Eugen Sawin
c94e9927bc Bug 1216460 - [2.2] Refactor SourceBuffer frame eviction and threshold defaults. r=jya
* Move eviction handling out of SourceBuffer into TrackBuffersManager
* Separate audio and video eviction thresholds
* Reduce default audio eviction threshold to 15MB
2016-03-22 21:24:45 +01:00
Jean-Yves Avenard
c5c63d35fc Bug 1245463: [MSE] P5. Remove no longer working Dump() commands. r=gerald
MozReview-Commit-ID: 71hgJ63ksPU
2016-02-12 23:45:48 +11:00
Jean-Yves Avenard
30db7c749e Bug 1245463: [MSE] P3. When abort() is called, wait until the current appendBuffer completes. r=gerald
The W3C spec indicates that while everything in MSE is asynchronous, the abort() command is to interrupt the current segment parser loop and have the reset parser loop synchronously completes the frames present in the input buffer.
This causes a fundamental issue that abort() will never result in a deterministic outcome as the segment parser loop may be in different condition.

We used to really attempt to abort the current operation, however there could have been a race in the order in which tasks were queued. As such, we now simply wait for the current appendBuffer to complete.

This also simplifies the code greatly, as we don't need to worry about pending concurrent appendBuffer.

The actually happens to be similar to the Chromium behavior.

Similar to bug 1239983, we strongly assert should a segment parser loop be running when it must have completed.

MozReview-Commit-ID: 9772PLQEozf
2016-02-12 23:45:47 +11:00
Phil Ringnalda
6111439998 Back out 6 changesets (bug 1245463) for !mAppendRunning (Append is running) assertion failures
CLOSED TREE

Backed out changeset 75d96e417aaf (bug 1245463)
Backed out changeset dca0577d741c (bug 1245463)
Backed out changeset 17ffbe7ca24e (bug 1245463)
Backed out changeset 83a2de2fcf02 (bug 1245463)
Backed out changeset e8bb35ea72e4 (bug 1245463)
Backed out changeset 48364b868055 (bug 1245463)
2016-02-11 23:39:36 -08:00
Jean-Yves Avenard
a6a8d0565d Bug 1245463: [MSE] P4. Remove no longer working Dump() commands. r=gerald
MozReview-Commit-ID: 71hgJ63ksPU
2016-02-12 10:30:16 +11:00
Jean-Yves Avenard
dda61422b8 Bug 1245463: [MSE] P3. When abort() is called, wait until the current appendBuffer completes. r=gerald
The W3C spec indicates that while everything in MSE is asynchronous, the abort() command is to interrupt the current segment parser loop and have the reset parser loop synchronously completes the frames present in the input buffer.
This causes a fundamental issue that abort() will never result in a deterministic outcome as the segment parser loop may be in different condition.

We used to really attempt to abort the current operation, however there could have been a race in the order in which tasks were queued. As such, we now simply wait for the current appendBuffer to complete.

This also simplifies the code greatly, as we don't need to worry about pending concurrent appendBuffer.

The actually happens to be similar to the Chromium behavior.

Similar to bug 1239983, we strongly assert should a segment parser loop be running when it must have completed.

MozReview-Commit-ID: 9772PLQEozf
2016-02-12 10:30:09 +11:00
Carsten "Tomcat" Book
dc41ea5c25 Backed out changeset a9ccf315f1f2 (bug 1245463) 2016-02-10 11:20:16 +01:00
Carsten "Tomcat" Book
9f354ccec0 Backed out changeset 22641351f11f (bug 1245463) 2016-02-10 11:20:12 +01:00
Jean-Yves Avenard
7b7a27dd0f Bug 1245463: [MSE] P5. Remove no longer working Dump() commands. r=gerald
MozReview-Commit-ID: 71hgJ63ksPU
2016-02-10 20:07:29 +11:00
Jean-Yves Avenard
018bf90ad7 Bug 1245463: [MSE] P2. When abort() is called, wait until the current appendBuffer completes. r=gerald
The W3C spec indicates that while everything in MSE is asynchronous, the abort() command is to interrupt the current segment parser loop and have the reset parser loop synchronously completes the frames present in the input buffer.
This causes a fundamental issue that abort() will never result in a deterministic outcome as the segment parser loop may be in different condition.

We used to really attempt to abort the current operation, however there could have been a race in the order in which tasks were queued. As such, we now simply wait for the current appendBuffer to complete.

This also simplifies the code greatly, as we don't need to worry about pending concurrent appendBuffer.

The actually happens to be similar to the Chromium behavior.

MozReview-Commit-ID: CHppUOGM1mk
2016-02-10 20:07:27 +11:00
JW Wang
2344481e8c Bug 1220558. Part 2 - remove unused members. r=jya. 2015-11-11 07:43:41 +08:00
Guang-De Lin
5fc8c948b4 Bug 1150305 - sourcebuffer.buffered returns the same object if not changed. r=roc, r=bz, r=jya
--HG--
extra : rebase_source : ffacfcb39b567a6cd034b081f4330d88aacb98f4
2015-10-19 14:10:47 +08:00
Nathan Froyd
01583602a9 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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Jean-Yves Avenard
eb81f3580e Bug 1204419: P2. Remove old MediaSource implementation. r=cpearce 2015-09-16 18:14:11 +10:00
Jean-Yves Avenard
8905370e55 Bug 1190019: [MSE] P1. Remove cycle between SourceBuffer and TrackBuffersManager. r=cpearce
Instead we use a a ref-counted attribute holder to store those arguments.
2015-08-04 16:19:14 +10:00
Ralph Giles
f104891fe4 Bug 1186257 - Avoid 'using' namespace imports in headers. r=jya
This is poor style as it can have side-effects in the caller's
code. Instead, use full namespace prefixes.
2015-07-22 16:59:27 -07:00
Bobby Holley
04eaf4c167 Bug 1184634 - Move various includes into the mozilla namespace. r=gerald
I did my a quick best-effort pass to fix up the most egregious ordering
problems. I left some big pre-existing messes alone.
2015-07-16 22:23:18 -07:00
Bobby Holley
407d2c5f90 Bug 1184634 - Rename MediaPromise to MozPromise. r=gerald 2015-07-16 22:21:56 -07:00
Birunthan Mohanathas
a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Jean-Yves Avenard
48ecf05758 Bug 1171760: P4. Process an entire media segment at a time rather than frame by frame. r=gerald
This provides significant speed improvement, halving the CPU usage.
Rationalise similar methods.
This assumes that frames within a media segment are continuous.
2015-07-01 11:42:51 +10:00
Bobby Holley
a80e87862b Bug 1175768 - Use mirroring for buffered ranges. r=jya 2015-06-27 01:19:13 -07:00
Ryan VanderMeulen
d9ca5de3ed Backed out 8 changesets (bug 1175768) for frequent media test failures.
Backed out changeset a369cfb95b59 (bug 1175768)
Backed out changeset e02dd312d622 (bug 1175768)
Backed out changeset 6776ce74b9e5 (bug 1175768)
Backed out changeset 6aa5fa1d318e (bug 1175768)
Backed out changeset a8bd7a0d2aea (bug 1175768)
Backed out changeset 41ffc9a9ac48 (bug 1175768)
Backed out changeset 2d2cefa397dc (bug 1175768)
Backed out changeset 4e06368496d2 (bug 1175768)

CLOSED TREE
2015-06-23 16:20:15 -04:00
Bobby Holley
5c20ea36aa Bug 1175768 - Use mirroring for buffered ranges. r=jya 2015-06-22 22:53:09 -07:00
Birunthan Mohanathas
2d96c72f58 Bug 1174220 - Part 2: Use MediaByteBuffer instead of MediaLargeByteBuffer. r=jya
All MediaLargeByteBuffer calls already include the `mozilla::fallible`
parameter so we can safely replace MediaLargeByteBuffer with MediaByteBuffer.
2015-06-14 21:37:13 -07:00
Jean-Yves Avenard
b6bafeb601 Bug 1171311: P3. Add MediaSourceDemuxer object. r=cpearce
Code isn't active. Need to set media.mediasource.format-reader to true.

--HG--
extra : rebase_source : 4996284f3eac81338548376f055c4849025233f3
2015-06-12 09:26:57 +10:00
Jean-Yves Avenard
a998798778 Bug 1171330: P10. Add TrackBuffersManager object. r=cajbir
This implements MSE's SourceBuffer exactly per spec.
No memory or speed optimisations of any kind were added for the purpose of
being 100% W3C spec compliant.

--HG--
extra : rebase_source : fe010841210c66e20ce55a45d76fd6736f9d3a7f
2015-06-11 15:55:20 +10:00
Jean-Yves Avenard
ca280f4bf4 Bug 1171330: P6. Make RangeRemoval use promises. r=cajbir
--HG--
extra : rebase_source : f96e700000c86e2902cbcff86523faa0914dffd6
2015-06-11 15:55:12 +10:00
Jean-Yves Avenard
323f8c749d Bug 1171330: P5. Split AppendData task to be closer to spec. r=cajbir.
--HG--
extra : rebase_source : 43000d795f7633786cd8319213da795e97151a9e
2015-06-11 15:49:50 +10:00
Jean-Yves Avenard
97f3b3817f Bug 1165819: Part2. Use TimeUnits in SourceBuffer. r=mattwoodrow 2015-06-05 11:53:05 +10:00
Jean-Yves Avenard
69f4fc3572 Bug 1165819: Abstract TrackBuffer interface. r=kentuckyfriedtakahe 2015-06-05 11:52:57 +10:00
Bobby Holley
80857671e7 Bug 1168008 - Replace 'Consumer' with 'Request' in MediaPromise naming. r=jww
I think this makes more sense, and it matches the naming convention that all
of the consumers of this stuff are actually using.
2015-05-28 16:03:10 -07:00
Jean-Yves Avenard
52a7a65989 Bug 1153094: Rename LargeDataBuffer and DataBuffer object. r=cpearce
This causes conflicts with webRTC libraries that use those names already. The
linker appears to get it wrong and calls the destructor of the wrong class.

--HG--
extra : rebase_source : 809221de3e5bde540bd40406f061f3865e4c4f00
2015-04-15 15:27:38 +10:00
Ehsan Akhgari
883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky
dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Jean-Yves Avenard
2bc6b14368 Bug 1143514: Part1. Only add sourcebuffer to ActiveSourceBuffers once active. r=cajbir
--HG--
extra : rebase_source : 766249adc3b7a3cbb4aa63c24aaefbe855c121fd
2015-03-18 14:10:56 +11:00
Jean-Yves Avenard
fb8fc9e241 Bug 1131433: Show codec/container type in MSE logs. r=cajbir
Also rationalize MSE debugging logs, so they all follow the same format.
2015-02-12 18:52:13 +11:00
Jean-Yves Avenard
5ceb7474c4 Bug 1130826: Run range removal algorithm when setting mediasource duration. r=cajbir 2015-02-12 18:52:12 +11:00