Closed
Bug 1457427
Opened 7 years ago
Closed 7 years ago
Use ControlMessage to open a new driver from SourceStream
Categories
(Core :: Audio/Video: MediaStreamGraph, enhancement, P2)
Core
Audio/Video: MediaStreamGraph
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: achronop, Assigned: achronop)
Details
Attachments
(6 files)
59 bytes,
text/x-review-board-request
|
pehrsons
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
padenot
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
padenot
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
padenot
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
padenot
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
padenot
:
review+
|
Details |
SourceMediaStream::OpenNewAudioCallbackDriver opens a new AudioCallbackDriver every time the channel count constraint is updated, on a track coming from a gUM request. Currently the MSG mutex is locked for that update. The correct way to do it is to send a ControlMessage to the MSG that will cause the update. Besides the above this bug includes the followings: OnThread assert of AudioCallbackDriver has been improved to track if we are in audio thread or not. A flag had been used till now. The flag is able to tell if the callback is on at a specific time but it's not possible to tell if we are on that thread. `MediaStreamGraphImpl::UpdateStreamOrder()` and `MediaStreamGraphImpl::CreateOrDestroyAudioStreams()` methods, assert for `OnGraphThreadOrNotRunning`, which is not necessary since they are called once, from the methods `UpdateGraph()` and `Process` methods respectively which conatin a more limited assert check: `OnGraphThread`. Small restructuring GraphDriver, switchin code has been wrapped around a helper method. Not a real change is the functionality. Small restructuring in MediaEngineWebRTC.cpp to improve readability. Not real change in functionality. A bit unrelated to MSG/GraphDriver. I include it here to avoid creating a separate bug for a low priority change.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → achronop
Rank: 19
Priority: -- → P2
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 7•7 years ago
|
||
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=09514730e6bb610c9dc0a8c5ea4ab249a3a620e4 and some corrections: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3efce4ba3f47dc2800e19f36e50902a5364d97ed
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8971570 [details] Bug 1457427 - Create a new GraphDriver method which performs the switching to next driver. https://reviewboard.mozilla.org/r/240334/#review246444
Attachment #8971570 -
Flags: review?(padenot) → review+
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8971571 [details] Bug 1457427 - In SourceMediaStream request driver change through ControlMessage to avoid locking on non priority thread. https://reviewboard.mozilla.org/r/240336/#review246448 This is unnecessary with bug 1404977.
Attachment #8971571 -
Flags: review?(padenot)
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8971572 [details] Bug 1457427 - Improve OnThread method of AudioCallbackDriver to track the thread id of the audio thread so be more accurate. https://reviewboard.mozilla.org/r/240338/#review246450
Attachment #8971572 -
Flags: review?(padenot) → review+
Comment 11•7 years ago
|
||
mozreview-review |
Comment on attachment 8971571 [details] Bug 1457427 - In SourceMediaStream request driver change through ControlMessage to avoid locking on non priority thread. https://reviewboard.mozilla.org/r/240336/#review246452 That said you'll probably land before me.
Attachment #8971571 -
Flags: review+
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8971573 [details] Bug 1457427 - Restrict the asserts of two MediaStreamGraph methods to align it with their callers. https://reviewboard.mozilla.org/r/240340/#review246454
Attachment #8971573 -
Flags: review?(padenot) → review+
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8971574 [details] Bug 1457427 - Change the assert in SetInputListener of GraphDriver to verify that the driver is not started. https://reviewboard.mozilla.org/r/240342/#review246456 Again not necessary with my changes, but fine to land now, I'll rebase on top.
Attachment #8971574 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 14•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8a52ed4fdc284c84a4c418913ec05df1b8f5033a
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8971569 [details] Bug 1457427 - Restructure EnumerateDevices method is webrtc engine to improve readability. https://reviewboard.mozilla.org/r/240332/#review246898 ::: dom/media/webrtc/MediaEngineWebRTC.cpp (Diff revision 1) > - if (MediaEngineSource::IsVideo(aMediaSource)) { > - // We spawn threads to handle gUM runnables, so we must protect the member vars > - MutexAutoLock lock(mMutex); Skipping the lock looks like a functional change. Since this is now done by the caller, assert here that the mutex is locked by us. ::: dom/media/webrtc/MediaEngineWebRTC.cpp:261 (Diff revision 1) > - return; > - } > +} > > +void > +MediaEngineWebRTC::EnumerateMicrophoneDevices(uint64_t aWindowId, > + dom::MediaSourceEnum aMediaSource, `aMediaSource` is not used as this is always for microphones. Remove. ::: dom/media/webrtc/MediaEngineWebRTC.cpp:263 (Diff revision 1) > > +void > +MediaEngineWebRTC::EnumerateMicrophoneDevices(uint64_t aWindowId, > + dom::MediaSourceEnum aMediaSource, > + nsTArray<RefPtr<MediaEngineSource> >* aSources) > +{ Assert that the mutex is held by us. Preferably add a thread assert to these methods you are touching as well, if possible. ::: dom/media/webrtc/MediaEngineWebRTC.cpp:334 (Diff revision 1) > + } else { > + EnumerateMicrophoneDevices(aWindowId, aMediaSource, aSources); Assert that aMediaSource is now microphone, or do ``` else if (aMediaSource == dom::MediaSourceEnum::Microphone) { ... } else { MOZ_CRASH(...); } ```
Attachment #8971569 -
Flags: review?(apehrson)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 22•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=685990d3d473028b5d507ed683f9b04b26b3b756
Assignee | ||
Comment 23•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8971569 [details] Bug 1457427 - Restructure EnumerateDevices method is webrtc engine to improve readability. https://reviewboard.mozilla.org/r/240332/#review246898 > Skipping the lock looks like a functional change. Since this is now done by the caller, assert here that the mutex is locked by us. Updated > `aMediaSource` is not used as this is always for microphones. Remove. Updated > Assert that the mutex is held by us. > Preferably add a thread assert to these methods you are touching as well, if possible. Updated > Assert that aMediaSource is now microphone, or do ``` > else if (aMediaSource == dom::MediaSourceEnum::Microphone) { > ... > } else { > MOZ_CRASH(...); > } > ``` Updated
Comment 24•7 years ago
|
||
mozreview-review |
Comment on attachment 8971569 [details] Bug 1457427 - Restructure EnumerateDevices method is webrtc engine to improve readability. https://reviewboard.mozilla.org/r/240332/#review247466
Attachment #8971569 -
Flags: review?(apehrson) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 31•7 years ago
|
||
Pushed by achronop@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b8edee5bd7d2 Restructure EnumerateDevices method is webrtc engine to improve readability. r=pehrsons https://hg.mozilla.org/integration/autoland/rev/1b0e22638045 Create a new GraphDriver method which performs the switching to next driver. r=padenot https://hg.mozilla.org/integration/autoland/rev/dc1bf6cad8ce In SourceMediaStream request driver change through ControlMessage to avoid locking on non priority thread. r=padenot https://hg.mozilla.org/integration/autoland/rev/dd269b789ebf Improve OnThread method of AudioCallbackDriver to track the thread id of the audio thread so be more accurate. r=padenot https://hg.mozilla.org/integration/autoland/rev/b3a339994f64 Restrict the asserts of two MediaStreamGraph methods to align it with their callers. r=padenot https://hg.mozilla.org/integration/autoland/rev/c5e2684bc485 Change the assert in SetInputListener of GraphDriver to verify that the driver is not started. r=padenot
Comment 32•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b8edee5bd7d2 https://hg.mozilla.org/mozilla-central/rev/1b0e22638045 https://hg.mozilla.org/mozilla-central/rev/dc1bf6cad8ce https://hg.mozilla.org/mozilla-central/rev/dd269b789ebf https://hg.mozilla.org/mozilla-central/rev/b3a339994f64 https://hg.mozilla.org/mozilla-central/rev/c5e2684bc485
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Assignee | ||
Comment 33•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a8e3334c78c2fa921fe5bb0688833a12a3b93088
You need to log in
before you can comment on or make changes to this bug.
Description
•