This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.
Differential Revision: https://phabricator.services.mozilla.com/D105473
so that EnumerateDevicesImpl() callers don't need to care about this.
This also provides a SourceListener::Stop() call to fix a leak from the logic
in GetSinkDevice().
Differential Revision: https://phabricator.services.mozilla.com/D105252
This was already happening to some extent due to the recursive relationship of
SourceListener::Stop() and GetUserMediaWindowListener::Remove(), but being
direct about it saves a parameter.
Depends on D105248
Differential Revision: https://phabricator.services.mozilla.com/D105249
This also clarifies the safety of non-thread-safe PeerIdentity reference
counting.
There is a potential change in behavior because ~GetUserMediaStreamRunnable
rejected with AbortError, but ~GetUserMediaTask rejects with NotAllowedError.
Differential Revision: https://phabricator.services.mozilla.com/D101566
This will make a future diff to merge GetUserMediaStreamRunnable into
GetUserMediaTask more readable.
A comment about supporting more that two tracks is removed because that is not
a likely scenario.
Differential Revision: https://phabricator.services.mozilla.com/D101565
I expect BeginReading() happened to return the same string due to the storage
format, but using get() clarifies that this will provide what is required.
Differential Revision: https://phabricator.services.mozilla.com/D101563
The navigator.mozGetUserMedia() fully active test is merged into the existing single-level
active test with a synchronous exception. The async error dispatch for empty constraints,
which aligns with the spec, is retained.
Differential Revision: https://phabricator.services.mozilla.com/D96519
for consistency with ErrorResult and dom::Promise, which will mean no reverse
conversion is required for rejecting Promises.
Differential Revision: https://phabricator.services.mozilla.com/D95967
This was mainly driven by the need of querying this track for its channel count,
but it also moves us one usage away from SourceMediaTrack, which is a
longer-term goal (because of SourceMediaTrack::mMutex).
Differential Revision: https://phabricator.services.mozilla.com/D95934
This renames the thread and identifiers derived from the thread's name. This is
to avoid ambiguity over if the thread relates to the MediaController class,
which it does not.
Differential Revision: https://phabricator.services.mozilla.com/D93806
GeckoView is seemingly the last user depending on MediaManager iterating over
a all iframes of a window when queried for its capture state.
It is fine however, since GeckoViewMedia already iterates over all windows in
MediaManagerService.activeMediaCaptureWindows, which includes all subframes that
are actively captured.
This patch removes IterateWindowListeners altogether, and the last callsite is
simplified.
Differential Revision: https://phabricator.services.mozilla.com/D93079
This patch was generated by running:
```
perl -p -i \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
$FILE
```
against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes. The errors fell into three categories:
1. Calling the convert functions with `std::string::c_str()`; these were
changed to simply pass the string instead, relying on implicit conversion
to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
replacement not being type-aware. These changes were reverted.
Differential Revision: https://phabricator.services.mozilla.com/D88903
This allows newly created window listeners, in MediaManager instances where the
cameras have already been muted, to get the right state.
Differential Revision: https://phabricator.services.mozilla.com/D87127
Add UA (user agent) muting, a spec-supported feature that somewhat mirrors
track enabling/disabling, except only the browser controls it. The effect
on track sinks is additive: must be unmuted and enabled for there to be
output.
Fire mute/unmute events on JS, and observably set track.muted independent
of track.enabled (reusing existing infrastructure already in use by
RTCPeerConnection tracks).
Low-level: add mDeviceMuted and SetMutedFor() modeled after mDeviceEnabled
and SetEnabledFor() as parallel device state for both camera and microphone for
symmetry and maintenance.
High-level: Only expose messages to mute/unmute camera at the moment, since
that is what is immediately required for Android in bug 1564451.
Differential Revision: https://phabricator.services.mozilla.com/D84222
This allows newly created window listeners, in MediaManager instances where the
cameras have already been muted, to get the right state.
Differential Revision: https://phabricator.services.mozilla.com/D87127