Commit Graph

400 Commits

Author SHA1 Message Date
Jan-Ivar Bruaroey
ef83b4f124 Bug 1166293 - Use AsyncShutdown API to shut down media thread in non-e10s. r= jesup
--HG--
extra : transplant_source : %5Cfb%EC%C4%C6L%9E%8C%0E%E5%C5%C3/%81lS%06%D2%F3
2015-10-14 23:54:39 -04: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
Nathan Froyd
583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Andrew McCreight
ae5fe6a2ad Bug 1210591, part 1 - Use nsVariantCC in various places. r=smaug
Most of these will end up in DataTransfer:mItems, so this is needed
for it to do anything useful.
2015-10-09 10:24:23 -07:00
Andrew McCreight
0ff7248107 Bug 1210517 - Create nsVariant directly rather than via do_CreateInstance(). r=froydnj
The goal here is to leave creation stuff mostly for JS, so we can
convert it entirely over to a non-threadsafe cycle-collected version
without breaking any existing C++ users.

I didn't do this for a remaining use in nsGlobalWindow.h to avoid
including nsVariant.h all over the place.
2015-10-07 08:17:42 -07:00
Jan-Ivar Bruaroey
61cd22ad23 Bug 1210852 - do SelectSettings of device capabilities on media thread. r=jesup
--HG--
extra : transplant_source : %8E%BB%7B%90MSt%0F%40s%8A%0C/%16y%15Ne%2A%1E
2015-10-03 20:42:26 -04:00
Sotaro Ikeda
739eddd54e Bug 1186813 - Replace nsBaseHashtable::EnumerateRead() calls in dom/media/ with iterators r=cpearce 2015-09-30 06:40:54 -07:00
Andreas Pehrson
9914ff85f8 Bug 1103188 - Keep track of stopped tracks in gUM stream listener. r=jib
This is needed to avoid something like:
* [old stream] stop track 1 -> deallocate MediaDevice for track 1
* [new stream] gUM() -> allocate MediaDevice for track 1
* [old stream] stop stream -> deallocate MediaDevice for track 1
* [new stream] gUM() -> start MediaDevice for track 1 (oops, MediaDevice was no more!)

--HG--
extra : commitid : FmkFYbCfel7
extra : rebase_source : e17ad400705198c48e3d561241dd50d0844c472e
2015-09-30 14:08:33 +08:00
Andreas Pehrson
6f60cbc89d Bug 1103188 - Keep track of capture stop only in gUM stream listener. r=jib
--HG--
extra : commitid : AqIOlsR7w1y
extra : rebase_source : 6f5670be3bf711a38eb9f914dc69c5b987dd9b9e
2015-09-30 14:08:26 +08:00
Andreas Pehrson
aaef4911a9 Bug 1103188 - Always call MediaManager::NotifyFinished/NotifyRemoved on main thread. r=jib
--HG--
extra : commitid : 8kb5G98FAY9
extra : rebase_source : 97086507d1c546f9423f4d2f790924c21ccfa28a
2015-09-30 14:08:22 +08:00
Andreas Pehrson
0239788481 Bug 1103188 - Deprecate DOMMediaStream::Stop(). r=jib
--HG--
extra : commitid : 3I8mAeBB3oL
extra : rebase_source : cc7351a34694b7b0e822bcd0b7025ded0ab54b9d
2015-09-30 09:32:06 +08:00
Andreas Pehrson
ce2776ea0d Bug 1103188 - Remove identical override nsDOMUserMediaStream::Stop(). r=jib
--HG--
extra : commitid : 3I8mAeBB3oL
extra : rebase_source : 2e37a21b1789bf4ab893c6fb8b2dd2c75f613855
2015-09-30 09:32:05 +08:00
Andreas Pehrson
867415c0b5 Bug 1170958 - Remove ProcessedMediaStream::ForwardTrackEnabled. r=roc,jesup
TrackUnionStream guarantees that TrackIDs are maintained if no tracks
have claimed them before.

In the gUM case, we have a SourceMediaStream which we wholly own (the
DOMMediaStream's Input stream), piped into a TrackUnionStream which
no-one external is able to add tracks to (the DOMMediaStream's Owned
stream) - addTrack()ed tracks are added to the DOMMediaStream's Playback
stream.

The MediaStreamTracks being enabled/disable refer to a TrackID in the
DOMMediaStream's Owned stream.

Alas, we don't need to forward a track's enabled state, we can just do
it on the source.

--HG--
extra : commitid : GPSNwBVyD4j
extra : rebase_source : 4388211be87ebe8a3839ea031b5c504d642806ab
2015-09-30 09:31:54 +08:00
Andreas Pehrson
9ecf8f59c7 Bug 1170958 - Feed a SourceMediaStream-backed dom stream instead of a raw SourceMediaStream in MediaManager. r=jesup
Simplifies the structure of MediaManager somewhat. Possible since
MediaManager owns both the SourceMediaStream and the DOMMediaStream.

--HG--
extra : commitid : GPSNwBVyD4j
extra : rebase_source : 494b8b673084ea050420dfaf8d16e44a3bc49672
2015-09-30 09:31:54 +08:00
Andreas Pehrson
937747498a Bug 1170958 - Refactor DOMMediaStream to contain a 3-stage track chain. r=roc
This lets us separate tracks by ownership like so:
* Input    - Owned by the producer of the DOMMediaStream (gUM etc.)
* Owned    - Contains Input tracks (per above) or tracks cloned tracks
             if this DOMMediaStream is a clone.
* Playback - Contains Owned tracks plus tracks addTrack()ed to this
             DOMMediaStream minus tracks removeTrack()ed from this
             DOMMediaStream.

--HG--
extra : commitid : GPSNwBVyD4j
extra : rebase_source : fba22e96c6c65a74e012509f3da67a4d7df7a244
2015-09-30 09:31:54 +08:00
Wes Kocher
03a1803261 Backed out 9 changesets (bug 1170958) for frequent test_getUserMedia_addTrackRemoveTrack.html failures
Backed out changeset 277c1f8098d1 (bug 1170958)
Backed out changeset aa86bb9eea95 (bug 1170958)
Backed out changeset 8af8b85a4b26 (bug 1170958)
Backed out changeset ec1bf225e9cb (bug 1170958)
Backed out changeset 4a04ddca2b6b (bug 1170958)
Backed out changeset e85c9977a311 (bug 1170958)
Backed out changeset 16b40ff04e8f (bug 1170958)
Backed out changeset ad206925c84a (bug 1170958)
Backed out changeset 2106eccec79b (bug 1170958)
2015-09-25 13:08:55 -07:00
Wes Kocher
b4a25c9f58 Backed out 7 changesets (bug 1103188) for frequent test_getUserMedia_addTrackRemoveTrack.html failures
Backed out changeset f0f33a8ef14c (bug 1103188)
Backed out changeset dbe0ebdebad5 (bug 1103188)
Backed out changeset bb656022a1a7 (bug 1103188)
Backed out changeset cc6b5f5ba444 (bug 1103188)
Backed out changeset ca97d52bf144 (bug 1103188)
Backed out changeset de8cc967f8eb (bug 1103188)
Backed out changeset 6da8f4905060 (bug 1103188)
2015-09-25 13:08:44 -07:00
Andreas Pehrson
7c822e759d Bug 1103188 - Deprecate DOMMediaStream::Stop(). r=jib
--HG--
extra : commitid : FxucwRqUZUo
2015-09-25 23:23:31 +08:00
Andreas Pehrson
6c449288a0 Bug 1103188 - Remove identical override nsDOMUserMediaStream::Stop(). r=jib
--HG--
extra : commitid : FxucwRqUZUo
2015-09-25 23:23:30 +08:00
Andreas Pehrson
b4ff8db67c Bug 1170958 - Remove ProcessedMediaStream::ForwardTrackEnabled. r=roc,jesup
TrackUnionStream guarantees that TrackIDs are maintained if no tracks
have claimed them before.

In the gUM case, we have a SourceMediaStream which we wholly own (the
DOMMediaStream's Input stream), piped into a TrackUnionStream which
no-one external is able to add tracks to (the DOMMediaStream's Owned
stream) - addTrack()ed tracks are added to the DOMMediaStream's Playback
stream.

The MediaStreamTracks being enabled/disable refer to a TrackID in the
DOMMediaStream's Owned stream.

Alas, we don't need to forward a track's enabled state, we can just do
it on the source.

--HG--
extra : commitid : Kvj9RrN9MgP
2015-09-25 23:23:18 +08:00
Andreas Pehrson
96fa1303ef Bug 1170958 - Feed a SourceMediaStream-backed dom stream instead of a raw SourceMediaStream in MediaManager. r=jesup
Simplifies the structure of MediaManager somewhat. Possible since
MediaManager owns both the SourceMediaStream and the DOMMediaStream.

--HG--
extra : commitid : Kvj9RrN9MgP
2015-09-25 23:23:18 +08:00
Andreas Pehrson
eacfc2cf0e Bug 1170958 - Refactor DOMMediaStream to contain a 3-stage track chain. r=roc
This lets us separate tracks by ownership like so:
* Input    - Owned by the producer of the DOMMediaStream (gUM etc.)
* Owned    - Contains Input tracks (per above) or tracks cloned tracks
             if this DOMMediaStream is a clone.
* Playback - Contains Owned tracks plus tracks addTrack()ed to this
             DOMMediaStream minus tracks removeTrack()ed from this
             DOMMediaStream.

--HG--
extra : commitid : Kvj9RrN9MgP
2015-09-25 23:23:18 +08:00
Andreas Pehrson
143e9256c4 Bug 1192170 - Remove media capture indicator when all tracks have ended. r=jib
--HG--
extra : commitid : 7nO1zyYTfLV
extra : rebase_source : 4761874ce4d5bb2d5675d3fa8e235cb491348919
2015-09-25 13:55:29 +08:00
Randell Jesup
b7ab4c0916 Bug 953265: make getUserMedia fake audio tones configurable in frequency via pref r=jib 2015-09-24 09:23:37 -04:00
Randell Jesup
6a27768207 Bug 1206900: Add telemetry for device types captured with getUserMedia() r=jib,smaug 2015-09-21 22:20:45 -04:00
Jan-Ivar Bruaroey
1c3f3f8536 Bug 1206982 - getUserMedia s/PermissionDeniedError/SecurityError/. r=jesup
--HG--
extra : transplant_source : %BB%1A%10%27%95%15%E0%A4%F3%F4%93%83%26%B91%CA%C8%9Cn%B1
2015-09-21 20:57:12 -04:00
Jan-Ivar Bruaroey
4fbccc5b50 Bug 912342 - get Promise out. r=jesup
--HG--
extra : commitid : L54TpPNzEgB
extra : rebase_source : 29eceb81efe9ab96053b37a202714319be13fc80
2015-09-20 10:04:51 -04:00
Jan-Ivar Bruaroey
5c97b1be39 Bug 912342 - Move code SelectSettings to MediaConstraintsHelper. r=jesup
--HG--
extra : commitid : IHOcGmMAzno
extra : rebase_source : 371c265877854d57f094583066b145aae50ed638
2015-09-19 02:00:48 -04:00
Jan-Ivar Bruaroey
17d85435b2 Bug 912342 - Pass in Audio/VideoDevice in place of Audio/VideoSource. r=jesup
--HG--
extra : commitid : KyF5JvNyJbV
extra : rebase_source : e8fc7ff48eb38d5df55cd685e187a2069f66d6de
2015-09-19 00:49:07 -04:00
Jan-Ivar Bruaroey
434ce0be70 Bug 912342 - Change capture resolution. r=jesup
--HG--
extra : commitid : I3MtL3fA2IA
extra : rebase_source : 5ffa9bc955b35b2915afea6c5bff794ca97a4ea2
2015-09-20 18:45:57 -04:00
Jan-Ivar Bruaroey
e5af2b70b2 Bug 912342 - Move code MediaOperationTask from .h to .cpp. r=jesup
--HG--
extra : commitid : L4YvvKBc9ft
extra : rebase_source : 3f732a3e21b8a9038ce35f232c012169134248e9
2015-09-16 22:44:14 -04:00
Jan-Ivar Bruaroey
f953fc2b69 Bug 1195951 - fix heap type on stack error in MediaUtils' Pledge class. r=jesup
--HG--
extra : commitid : 7vVVqOmBW1W
extra : rebase_source : 186c56708e579f2734a1a9db8acebcb69c9f5af2
2015-09-20 02:26:41 -04:00
Jan-Ivar Bruaroey
19676d62dc Bug 1181896 - make gUM fail w/OverconstrainedError and candidate argument r=jesup 2015-09-18 14:04:41 -04:00
Jan-Ivar Bruaroey
3f14a4d7ce Bug 1181896 - rename .constraintName to .constraint in MediaStreamError r=jesup,bz 2015-09-18 14:03:30 -04:00
Richard Barnes
52d9a0fc5e Bug 1205156 - Add telemetry to measure how often getUserMedia is used over non-secure origins r=jib 2015-09-17 08:44:50 -04:00
Robert O'Callahan
53dbc8f50e Bug 1189506. Remove aFlags parameter from AllocateInputPort. r=karlt
--HG--
extra : commitid : GZuYprloPNM
extra : rebase_source : 17ca412dd6232ad5c739918500d959a03895a65c
2015-09-04 16:42:42 +12:00
Robert O'Callahan
5c2c7e03d5 Bug 1189506. Remove usage of FLAG_BLOCK_OUTPUT from MediaManager. r=jesup
--HG--
extra : commitid : GWToVox5Vvu
extra : rebase_source : 0054cbd1ddc64ad48e84b175d3c05a16ac79a4a7
2015-09-04 16:39:37 +12:00
Jan-Ivar Bruaroey
c64c66da29 Bug 1201197 - add dedicated listener to enumerateDevices. r=jesup
--HG--
extra : transplant_source : %AF3%DCR%D41%91%FD4U%C1%5E%03%1C%0F%AE%92o%95U
2015-09-03 19:09:34 -04:00
Jan-Ivar Bruaroey
f777a670cd Bug 1187315 - Refactor out Constraints.webidl. r=bz
--HG--
extra : transplant_source : r%D6%95%C3%AE%3F%98%E5%2C%2C%067%B8%ABX%90%9F%5D%0Dz
2015-07-29 01:16:19 -04:00
Paul Adenot
2c70ea6a84 Bug 1190676 - Part 6 - Fix consumers: MediaManager. r=jesup
--HG--
extra : rebase_source : d7f9711c20834a8acd4e1e11ff5bfecb9f8a3c9b
2015-08-25 10:29:51 +02:00
Aryeh Gregor
15205c18ac Bug 1179451 - Part 4: Don't pass nsRefPtr&& to functions that want raw pointers. r=froydnj
--HG--
extra : rebase_source : d25c43a593a72615259e39ae053376f261aa55ad
2015-08-13 15:22:48 +03:00
Jan-Ivar Bruaroey
ec3cfdec9c Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression) r=jesup 2015-08-10 12:16:30 -04:00
Birunthan Mohanathas
2b4a52cf2e Bug 1185763 - Part 3: Rename nsTArray::MoveElementsFrom to AppendElements. r=froydnj 2015-08-11 08:29:46 -07:00
Birunthan Mohanathas
edbcd5e014 Bug 1185763 - Part 1: Always use mozilla::Move with nsTArray::MoveElementsFrom. r=froydnj 2015-08-11 08:29:46 -07:00
Paul Adenot
d4057fe585 Bug 1156472 - Part 12 - Allow to pipe the AudioCaptureStream into an AudioContext. r=mt,roc 2015-07-24 14:28:17 +02:00
Paul Adenot
da9b49eced Bug 1156472 - Part 11 - Unbitrot MediaManager.cpp over jib's changes. r=jib 2015-07-24 14:28:17 +02:00
Paul Adenot
6f08789e18 Bug 1156472 - Part 5 - Add MediaEngineWebRTCAudioCaptureSource as a new audio source, and "audioCapture" as a new MediaSource. r=jesup,bz 2015-07-24 14:28:16 +02:00
Wes Kocher
83b4188234 Backed out 14 changesets (bug 1156472) for test_getUserMedia_audioCapture.html failures on b2g emulator
Backed out changeset deec8eb18346 (bug 1156472)
Backed out changeset 0f5bec4c05ba (bug 1156472)
Backed out changeset 2dd83ac00bf9 (bug 1156472)
Backed out changeset abd4e47887f7 (bug 1156472)
Backed out changeset 4824d9874663 (bug 1156472)
Backed out changeset 12805598e6fa (bug 1156472)
Backed out changeset e2f0062a1f67 (bug 1156472)
Backed out changeset 99ef8e436a7f (bug 1156472)
Backed out changeset 65bbfc1546af (bug 1156472)
Backed out changeset 2ab4f16eaf0a (bug 1156472)
Backed out changeset 7f565685e20a (bug 1156472)
Backed out changeset 28c03c98cb2b (bug 1156472)
Backed out changeset d477cfba6e1d (bug 1156472)
Backed out changeset 9819fa56caa1 (bug 1156472)
2015-07-24 13:15:57 -07:00
Paul Adenot
8290e5cb5d Bug 1156472 - Part 12 - Allow to pipe the AudioCaptureStream into an AudioContext. r=mt,roc 2015-07-24 14:28:17 +02:00
Paul Adenot
889273bd21 Bug 1156472 - Part 11 - Unbitrot MediaManager.cpp over jib's changes. r=jib 2015-07-24 14:28:17 +02:00