Closed
Bug 1286096
Opened 8 years ago
Closed 8 years ago
Make getSettings() and concurrent access work for audio constraints as well
Categories
(Core :: WebRTC: Audio/Video, defect, P1)
Core
WebRTC: Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: jib, Assigned: jib)
References
()
Details
Attachments
(7 files)
(deleted),
text/x-review-board-request
|
padenot
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
padenot
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
drno
:
review+
smaug
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
padenot
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
padenot
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
padenot
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
smaug
:
review+
padenot
:
review+
|
Details |
A follow-up from bug 1213517: Share new constraints code added for cameras with microphone stack as well, so it'll work for echoCancellation et al.
Comment 1•8 years ago
|
||
Jib, can you give my an idea of the priority of this ask.
Flags: needinfo?(jib)
Assignee | ||
Comment 2•8 years ago
|
||
Yes sorry, same as bug 1213517. Just need to land that patch queue before it swallows me.
Rank: 18
Flags: needinfo?(jib)
Priority: -- → P1
Assignee | ||
Comment 3•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64992/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64992/
Attachment #8772087 -
Flags: review?(rjesup)
Attachment #8772088 -
Flags: review?(rjesup)
Attachment #8772089 -
Flags: review?(drno)
Attachment #8772090 -
Flags: review?(rjesup)
Attachment #8772091 -
Flags: review?(rjesup)
Attachment #8772092 -
Flags: review?(rjesup)
Attachment #8772093 -
Flags: review?(rjesup)
Attachment #8772093 -
Flags: review?(bugs)
Assignee | ||
Comment 4•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64994/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64994/
Assignee | ||
Comment 5•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64996/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64996/
Assignee | ||
Comment 6•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64998/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64998/
Assignee | ||
Comment 7•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65000/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65000/
Assignee | ||
Comment 8•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65002/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65002/
Assignee | ||
Comment 9•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65004/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65004/
Assignee | ||
Comment 10•8 years ago
|
||
Some of this overlaps with bug 1088621, but the patch queue worked out this way, so I'm thinking I'll save that bug for writing the actual tests.
Comment 11•8 years ago
|
||
Why we want or need mozNoiseSuppression and mozAutoGainControl?
Updated•8 years ago
|
Flags: needinfo?(jib)
Comment 12•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #11)
> Why we want or need mozNoiseSuppression and mozAutoGainControl?
Because those make important modifications to the captured audio - which some people very much do not want (think music recording, people who run fanless computers or are using a real mic on a cable, and gain control we default off (unlike Chrome), but for some usecases it could be very useful, where some talkers are close to the mic and some very far away.
Google gangs control of them with the AEC (turn AEC off, and those turn off). Since we don't default them all on that doesn't quite fit - and it makes it very hard to do certain things (like record a video for distribution on a laptop - you don't need the AEC (hurts quality, or can), but if you turn it off you lose noise suppression. I hope we can add them to the standard eventually.
Flags: needinfo?(jib)
Assignee | ||
Comment 13•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #11)
> Why we want or need mozNoiseSuppression and mozAutoGainControl?
We already support mozNoiseSuppression and mozAutoGainControl as constraints in getUserMedia() and track.applyConstraints() [1] The webidl in this bug is for track.getSettings() which is a complement method to those.
(Unfortunately for code maintenance, the spec people decided to split up what used to be a single dictionary into three: MediaTrackConstraints, MediaTrackCapabilities, and MediaTrackSettings).
[1] https://dxr.mozilla.org/mozilla-central/source/dom/webidl/MediaStreamTrack.webidl#58-59
Comment 14•8 years ago
|
||
ok. So has someone at least filed a spec bug to get these properties into some spec?
Exposing moz-prefixed stuff is against our rules, so reviewing this kinds of changes makes me feel a bit unease.
Comment 15•8 years ago
|
||
Comment on attachment 8772093 [details]
Bug 1286096 - Wire up audio getSettings().
https://reviewboard.mozilla.org/r/65004/#review62016
Attachment #8772093 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 16•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #14)
> ok. So has someone at least filed a spec bug to get these properties into
> some spec?
We need a spec to file a bug on at this point, since mediacapture is near frozen and not accepting any more constraints. There's also supposed to be a registry for constraints, to reserve the name at least [1], but I don't know if it's up and running yet.
[1] https://tools.ietf.org/html/draft-ietf-rtcweb-constraints-registry-03
Comment 17•8 years ago
|
||
Comment on attachment 8772089 [details]
Bug 1286096 - Remove fakeTracks constraint.
https://reviewboard.mozilla.org/r/64996/#review62008
LGTM with one Nit
::: dom/media/test/test_multiple_mediastreamtracks.html:17
(Diff revision 1)
> function startTest() {
> - navigator.mediaDevices.getUserMedia({audio:true, video:true, fake:true, fakeTracks:true})
> + navigator.mediaDevices.getUserMedia({audio:true, video:true, fake:true})
> .then(function(stream) {
> + var a = stream.getAudioTracks()[0];
> + var v = stream.getVideoTracks()[0];
> + stream = new MediaStream([a, a, a, a, v, v, v].map(track => track.clone()));
Nit: I would prefer to create a new variable for the new MediaStream here rather then overloading the input argument.
Attachment #8772089 -
Flags: review?(drno) → review+
Assignee | ||
Comment 18•8 years ago
|
||
(In reply to Nils Ohlmeier [:drno] from comment #17)
> Nit: I would prefer to create a new variable for the new MediaStream here
> rather then overloading the input argument.
OK, but doesn't having two variables named stream-something just increase the risk of using the wrong one?
Assignee | ||
Comment 19•8 years ago
|
||
Comment on attachment 8772089 [details]
Bug 1286096 - Remove fakeTracks constraint.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64996/diff/1-2/
Assignee | ||
Comment 20•8 years ago
|
||
Comment on attachment 8772090 [details]
Bug 1286096 - Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64998/diff/1-2/
Assignee | ||
Comment 21•8 years ago
|
||
Comment on attachment 8772091 [details]
Bug 1286096 - Move UpdateSingleSource pattern to MediaEngine base class for reuse.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65000/diff/1-2/
Assignee | ||
Comment 22•8 years ago
|
||
Comment on attachment 8772092 [details]
Bug 1286096 - Consider competing audio constraints as well.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65002/diff/1-2/
Assignee | ||
Comment 23•8 years ago
|
||
Comment on attachment 8772093 [details]
Bug 1286096 - Wire up audio getSettings().
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65004/diff/1-2/
Assignee | ||
Updated•8 years ago
|
Attachment #8772089 -
Flags: review?(bugs)
Assignee | ||
Comment 24•8 years ago
|
||
Addressed feedback, and simplified the UpdateSingleSource pattern slightly.
Updated•8 years ago
|
Attachment #8772089 -
Flags: review?(bugs) → review+
Comment 25•8 years ago
|
||
Comment on attachment 8772089 [details]
Bug 1286096 - Remove fakeTracks constraint.
https://reviewboard.mozilla.org/r/64996/#review62242
Comment 26•8 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] from comment #18)
> OK, but doesn't having two variables named stream-something just increase
> the risk of using the wrong one?
I guess it is one of these things which you can prefer one way or the other, because there are no real hard arguments for having it to do either way. So I'll leave it up to you :-)
Assignee | ||
Updated•8 years ago
|
Attachment #8772087 -
Flags: review?(rjesup) → review?(padenot)
Attachment #8772088 -
Flags: review?(rjesup) → review?(padenot)
Attachment #8772090 -
Flags: review?(rjesup) → review?(padenot)
Attachment #8772091 -
Flags: review?(rjesup) → review?(padenot)
Attachment #8772092 -
Flags: review?(rjesup) → review?(padenot)
Attachment #8772093 -
Flags: review?(rjesup) → review?(padenot)
Comment 27•8 years ago
|
||
Comment on attachment 8772090 [details]
Bug 1286096 - Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones.
https://reviewboard.mozilla.org/r/64998/#review64482
Edit the commit message to tell why you're doing this move.
Attachment #8772090 -
Flags: review?(padenot) → review+
Comment 28•8 years ago
|
||
Comment on attachment 8772088 [details]
Bug 1286096 - Enable width/height constraints on fake device.
https://reviewboard.mozilla.org/r/64994/#review64492
Update the commit message to explain why you're doing this.
Attachment #8772088 -
Flags: review?(padenot) → review+
Comment 29•8 years ago
|
||
https://reviewboard.mozilla.org/r/64992/#review64460
::: dom/media/webrtc/MediaEngineDefault.cpp:47
(Diff revision 1)
> /**
> * Default video source.
> */
>
> MediaEngineDefaultVideoSource::MediaEngineDefaultVideoSource()
> - : MediaEngineVideoSource(kReleased)
> + : MediaEngineCameraVideoSource(0, "FakeVideo.Monitor")
Magic numbers and strings are not ideal. In particular, nothing tells me why passing in `0` here is okay.
Comment 30•8 years ago
|
||
Comment on attachment 8772087 [details]
Bug 1286096 - Have MediaEngineDefaultVideoSource inherit from MediaEngineCameraVideoSource.
https://reviewboard.mozilla.org/r/64992/#review64498
Attachment #8772087 -
Flags: review?(padenot) → review+
Comment 31•8 years ago
|
||
Comment on attachment 8772091 [details]
Bug 1286096 - Move UpdateSingleSource pattern to MediaEngine base class for reuse.
https://reviewboard.mozilla.org/r/65000/#review64500
::: dom/media/webrtc/MediaEngine.h:385
(Diff revision 2)
> + * aDeviceId - As passed in (origin-dependent id).
> + * aOutBadConstraint - Result: nonzero if failed to apply. Name of culprit.
> + */
> +
> + nsresult
> + UpdateShareOfSingleSource(AllocationHandle* aHandle,
Maybe rename this to make it clear that the intent is to reevaluate the current allocation considering a new constraint set for a shared device ?
Attachment #8772091 -
Flags: review?(padenot) → review+
Comment 32•8 years ago
|
||
Comment on attachment 8772092 [details]
Bug 1286096 - Consider competing audio constraints as well.
https://reviewboard.mozilla.org/r/65002/#review64484
::: dom/media/webrtc/MediaEngineWebRTCAudio.cpp:232
(Diff revision 2)
> const char** aOutBadConstraint)
> {
> AssertIsOnOwningThread();
> - if (mState == kReleased) {
> + nsresult rv = Super::Allocate(aConstraints, aPrefs, aDeviceId, aOrigin,
> + aOutHandle, aOutBadConstraint);
> + if (NS_FAILED(rv)) {
Can you not just return rv ?
Attachment #8772092 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 33•8 years ago
|
||
Comment on attachment 8772087 [details]
Bug 1286096 - Have MediaEngineDefaultVideoSource inherit from MediaEngineCameraVideoSource.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64992/diff/1-2/
Attachment #8772090 -
Attachment description: Bug 1286096 - Move AllocationHandle to MediaEngineSource base class. → Bug 1286096 - Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones.
Assignee | ||
Comment 34•8 years ago
|
||
Comment on attachment 8772088 [details]
Bug 1286096 - Enable width/height constraints on fake device.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64994/diff/1-2/
Assignee | ||
Comment 35•8 years ago
|
||
Comment on attachment 8772089 [details]
Bug 1286096 - Remove fakeTracks constraint.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64996/diff/2-3/
Assignee | ||
Comment 36•8 years ago
|
||
Comment on attachment 8772090 [details]
Bug 1286096 - Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64998/diff/2-3/
Assignee | ||
Comment 37•8 years ago
|
||
Comment on attachment 8772091 [details]
Bug 1286096 - Move UpdateSingleSource pattern to MediaEngine base class for reuse.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65000/diff/2-3/
Assignee | ||
Comment 38•8 years ago
|
||
Comment on attachment 8772092 [details]
Bug 1286096 - Consider competing audio constraints as well.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65002/diff/2-3/
Assignee | ||
Comment 39•8 years ago
|
||
Comment on attachment 8772093 [details]
Bug 1286096 - Wire up audio getSettings().
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65004/diff/2-3/
Assignee | ||
Comment 40•8 years ago
|
||
Thanks Paul! Feedback addressed. Note, I'm still missing a review from you on the last patch I think: https://reviewboard.mozilla.org/r/65004/diff/3/
MozReview's UI shows it as green because smaug r+'ed it, but I think he only looked at the webidl. Did you miss it?
Flags: needinfo?(padenot)
Assignee | ||
Comment 41•8 years ago
|
||
https://reviewboard.mozilla.org/r/64994/#review64492
This patch really belongs in Bug 1088621 is the real issue. I'll see if I can rebase it.
Comment 42•8 years ago
|
||
Comment on attachment 8772093 [details]
Bug 1286096 - Wire up audio getSettings().
https://reviewboard.mozilla.org/r/65004/#review64772
Attachment #8772093 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 43•8 years ago
|
||
Comment on attachment 8772087 [details]
Bug 1286096 - Have MediaEngineDefaultVideoSource inherit from MediaEngineCameraVideoSource.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64992/diff/2-3/
Assignee | ||
Comment 44•8 years ago
|
||
Comment on attachment 8772088 [details]
Bug 1286096 - Enable width/height constraints on fake device.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64994/diff/2-3/
Assignee | ||
Comment 45•8 years ago
|
||
Comment on attachment 8772089 [details]
Bug 1286096 - Remove fakeTracks constraint.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64996/diff/3-4/
Assignee | ||
Comment 46•8 years ago
|
||
Comment on attachment 8772090 [details]
Bug 1286096 - Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64998/diff/3-4/
Assignee | ||
Comment 47•8 years ago
|
||
Comment on attachment 8772091 [details]
Bug 1286096 - Move UpdateSingleSource pattern to MediaEngine base class for reuse.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65000/diff/3-4/
Assignee | ||
Comment 48•8 years ago
|
||
Comment on attachment 8772092 [details]
Bug 1286096 - Consider competing audio constraints as well.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65002/diff/3-4/
Assignee | ||
Comment 49•8 years ago
|
||
Comment on attachment 8772093 [details]
Bug 1286096 - Wire up audio getSettings().
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65004/diff/3-4/
Assignee | ||
Comment 50•8 years ago
|
||
Rebased.
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(padenot)
Comment 51•8 years ago
|
||
Pushed by jbruaroey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca07b7baf290
Have MediaEngineDefaultVideoSource inherit from MediaEngineCameraVideoSource. r=padenot
https://hg.mozilla.org/integration/autoland/rev/8a75cd08366e
Enable width/height constraints on fake device. r=padenot
https://hg.mozilla.org/integration/autoland/rev/54d171fd763a
Remove fakeTracks constraint. r=drno,smaug
https://hg.mozilla.org/integration/autoland/rev/3b9c5f9d8a42
Move AllocationHandle used for cameras to MediaEngineSource base class to reuse for microphones. r=padenot
https://hg.mozilla.org/integration/autoland/rev/e3354c949659
Move UpdateSingleSource pattern to MediaEngine base class for reuse. r=padenot
https://hg.mozilla.org/integration/autoland/rev/274a3c105eb5
Consider competing audio constraints as well. r=padenot
https://hg.mozilla.org/integration/autoland/rev/26085bd0d428
Wire up audio getSettings(). r=padenot,smaug
Comment 52•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ca07b7baf290
https://hg.mozilla.org/mozilla-central/rev/8a75cd08366e
https://hg.mozilla.org/mozilla-central/rev/54d171fd763a
https://hg.mozilla.org/mozilla-central/rev/3b9c5f9d8a42
https://hg.mozilla.org/mozilla-central/rev/e3354c949659
https://hg.mozilla.org/mozilla-central/rev/274a3c105eb5
https://hg.mozilla.org/mozilla-central/rev/26085bd0d428
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•