Commit Graph

410 Commits

Author SHA1 Message Date
Randell Jesup
c45f35255b Bug 1218799: Shutdown MediaManager engines from the MediaManager thread r=jib 2015-11-18 15:03:13 -05:00
sajitk
16f44d3d8d Bug 1219480 - Replace PRLogModuleInfo with LazyLogModule in the media directory. r=rillian 2015-11-15 14:49:01 +01:00
Wes Kocher
798325cd22 Backed out changeset 1e5f3d1151d6 (bug 1219480) for cpp unittest bustage CLOSED TREE 2015-11-11 09:36:56 -08:00
sajitk
ac8ad4ec76 Bug 1219480 - Replace PRLogModuleInfo with LazyLogModule in the media directory. r=rillian 2015-11-11 06:52:00 +01:00
Andreas Pehrson
6c7833bebf Bug 1219711 - Let fake stream take precedence in testing. r=jib
TL;DR requesting a fake stream always gives you a fake stream. No magic.

The gUMConstraint `fake: true` should take precedence and if set always
use MediaEngineDefault.
If it is set the state of `faketracks` is passed
on to MediaEngineDefault.
If it is not set, but (any of) audio/video loopback devices are set, the
device enumeration will filter out only those.
2015-11-09 23:17:42 +08:00
Wes Kocher
42739fea04 Backed out 5 changesets (bug 1219711) for frequent android m(9) failures
Backed out changeset 2d5f09d89424 (bug 1219711)
Backed out changeset cf14a6e5f340 (bug 1219711)
Backed out changeset 4eaa8cf9a752 (bug 1219711)
Backed out changeset 65abe62869df (bug 1219711)
Backed out changeset a21d79a94307 (bug 1219711)
2015-11-06 11:14:11 -08:00
Matthew Noorenberghe
050420213f Bug 1221365 - Move "Is origin potentially trustworthy?" logic outside ServiceWorkerManager.cpp. r=ckerschb,bkelly 2015-11-06 11:10:17 -08:00
Andreas Pehrson
6695aebdce Bug 1219711 - Let fake stream take precedence in testing. r=jib
TL;DR requesting a fake stream always gives you a fake stream. No magic.

The gUMConstraint `fake: true` should take precedence and if set always
use MediaEngineDefault.
If it is set the state of `faketracks` is passed
on to MediaEngineDefault.
If it is not set, but (any of) audio/video loopback devices are set, the
device enumeration will filter out only those.
2015-11-05 17:15:51 +08:00
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Jan-Ivar Bruaroey
e519d05b74 Bug 1193075 - add viewport constraints for independent scrolling in tab sharing. r=smaug, r=jesup 2015-10-22 17:03:47 -04:00
Jan-Ivar Bruaroey
8eb44ff540 Bug 1166293 - Use AsyncShutdown API to shut down media thread in non-e10s. r= jesup 2015-10-14 23:54:39 -04: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
Nathan Froyd
5254890206 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
dc667287f6 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
0c62d00526 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
416250d08d Bug 1210852 - do SelectSettings of device capabilities on media thread. r=jesup 2015-10-03 20:42:26 -04:00
Sotaro Ikeda
4302b4f0a7 Bug 1186813 - Replace nsBaseHashtable::EnumerateRead() calls in dom/media/ with iterators r=cpearce 2015-09-30 06:40:54 -07:00
Andreas Pehrson
310106a37d 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!)
2015-09-30 14:08:33 +08:00
Andreas Pehrson
b53b7b0e03 Bug 1103188 - Keep track of capture stop only in gUM stream listener. r=jib 2015-09-30 14:08:26 +08:00
Andreas Pehrson
245842068e Bug 1103188 - Always call MediaManager::NotifyFinished/NotifyRemoved on main thread. r=jib 2015-09-30 14:08:22 +08:00
Andreas Pehrson
e9dc12e436 Bug 1103188 - Deprecate DOMMediaStream::Stop(). r=jib 2015-09-30 09:32:06 +08:00
Andreas Pehrson
1ef1c35d28 Bug 1103188 - Remove identical override nsDOMUserMediaStream::Stop(). r=jib 2015-09-30 09:32:05 +08:00
Andreas Pehrson
400f1f3074 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.
2015-09-30 09:31:54 +08:00
Andreas Pehrson
737f97851c 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.
2015-09-30 09:31:54 +08:00
Andreas Pehrson
9fb5ec93b1 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.
2015-09-30 09:31:54 +08:00
Wes Kocher
84e72a2137 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
50ac2b87e5 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
afde4d73e7 Bug 1103188 - Deprecate DOMMediaStream::Stop(). r=jib 2015-09-25 23:23:31 +08:00
Andreas Pehrson
9d02866a25 Bug 1103188 - Remove identical override nsDOMUserMediaStream::Stop(). r=jib 2015-09-25 23:23:30 +08:00
Andreas Pehrson
c5ca578a06 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.
2015-09-25 23:23:18 +08:00
Andreas Pehrson
7f8b2b04db 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.
2015-09-25 23:23:18 +08:00
Andreas Pehrson
dbb83ae994 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.
2015-09-25 23:23:18 +08:00
Andreas Pehrson
d8b8b4cf69 Bug 1192170 - Remove media capture indicator when all tracks have ended. r=jib 2015-09-25 13:55:29 +08:00
Randell Jesup
36f1c10ade Bug 953265: make getUserMedia fake audio tones configurable in frequency via pref r=jib 2015-09-24 09:23:37 -04:00
Randell Jesup
61f2b07fab Bug 1206900: Add telemetry for device types captured with getUserMedia() r=jib,smaug 2015-09-21 22:20:45 -04:00
Jan-Ivar Bruaroey
7810914636 Bug 1206982 - getUserMedia s/PermissionDeniedError/SecurityError/. r=jesup 2015-09-21 20:57:12 -04:00
Jan-Ivar Bruaroey
6c9de039ed Bug 912342 - get Promise out. r=jesup 2015-09-20 10:04:51 -04:00
Jan-Ivar Bruaroey
32e9d893c2 Bug 912342 - Move code SelectSettings to MediaConstraintsHelper. r=jesup 2015-09-19 02:00:48 -04:00
Jan-Ivar Bruaroey
c8450f5db9 Bug 912342 - Pass in Audio/VideoDevice in place of Audio/VideoSource. r=jesup 2015-09-19 00:49:07 -04:00
Jan-Ivar Bruaroey
b2c0974877 Bug 912342 - Change capture resolution. r=jesup 2015-09-20 18:45:57 -04:00
Jan-Ivar Bruaroey
7575061788 Bug 912342 - Move code MediaOperationTask from .h to .cpp. r=jesup 2015-09-16 22:44:14 -04:00
Jan-Ivar Bruaroey
a0aeb846e8 Bug 1195951 - fix heap type on stack error in MediaUtils' Pledge class. r=jesup 2015-09-20 02:26:41 -04:00
Jan-Ivar Bruaroey
6dccc3ae57 Bug 1181896 - make gUM fail w/OverconstrainedError and candidate argument r=jesup 2015-09-18 14:04:41 -04:00
Jan-Ivar Bruaroey
1fedf527e6 Bug 1181896 - rename .constraintName to .constraint in MediaStreamError r=jesup,bz 2015-09-18 14:03:30 -04:00
Richard Barnes
7f2bacd58c 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
2b6ab625a1 Bug 1189506. Remove aFlags parameter from AllocateInputPort. r=karlt 2015-09-04 16:42:42 +12:00
Robert O'Callahan
d23422b233 Bug 1189506. Remove usage of FLAG_BLOCK_OUTPUT from MediaManager. r=jesup 2015-09-04 16:39:37 +12:00
Jan-Ivar Bruaroey
8fec18ab44 Bug 1201197 - add dedicated listener to enumerateDevices. r=jesup 2015-09-03 19:09:34 -04:00
Jan-Ivar Bruaroey
ffe45a44b9 Bug 1187315 - Refactor out Constraints.webidl. r=bz 2015-07-29 01:16:19 -04:00
Paul Adenot
e862413472 Bug 1190676 - Part 6 - Fix consumers: MediaManager. r=jesup 2015-08-25 10:29:51 +02:00