Separate AudioInputTrack into NativeInputTrack and AudioProcessingTrack
Categories
(Core :: Audio/Video: MediaStreamGraph, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: chunmin, Assigned: chunmin)
References
Details
Attachments
(5 files, 1 obsolete file)
Now AudioInputTrack is the source of the MediaStreamTrack, which is created from getUserMedia at first, to get the microphone data. It has an AudioDataListener member to handle the audio input data from the microphone and an AudioInputProcessing member to apply the audio processing configured by the MediaTrackConstraints.
To make multiple microphones work in the same MediaTrackGraph which is driven by a certain audio device, we need to separate the AudioInputTrack into two tracks:
- NativeInputTrack
- handle the audio input data from the microphone
- AudioProcessingTrack:
- is the source of the MediaStreamTrack
- apply the audio processing configured by the MediaTrackConstraints for the MediaStreamTrack
and they will be linked via a MediaInputPort
By doing so, the AudioProcessingTrack, which is paired to a MediaStreamTrack, can use a different source track than the NativeInputTrack when we are able to open another microphone in the MediaTrackGraph, if the user asks to create another MediaStreamTrack from another microphone device
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Draft will be on this branch. The below commits will be updated from times to times here:
- Absorb mInputDeviceUsers into NativeInputTrack
- TODO: Replace mInputDeviceUsers by
mConsumers[i]->GetDestination()
Assignee | ||
Comment 2•4 years ago
|
||
Replace mInputDeviceUsers by a <device-id, NativeInputTrack> map
Assignee | ||
Comment 3•4 years ago
|
||
Remove mDataUsers in NativeInputTrack. We can deliver audio data
via NativeInputTrack's data consumer tracks directly.
This patch demonstrates a way to deliver audio data from NativeInputTrack to AudioInputTrack from MediaInputPort directly, without using a nsTArray<RefPtr<AudioDataListener>> list to track the data receiver in AudioInputTrack. However, we need to make sure the AudioInputTrack::CloseAudioInputis called before the MediaInputPort is destroyed and we will use raw pointers all the times. I am not sure if it's a good way to go now.
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D113680
Assignee | ||
Comment 5•4 years ago
|
||
The final goal is to get the input audio data from MediaInputPort, so we
move the data receiving and processing from NotifyInputData to
ProcessInput, which is a new function created in this patch.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 7•4 years ago
|
||
Backed out 3 changesets (Bug 1702646) for causing gtest failures CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=341513992&repo=autoland&lineNumber=4035
https://treeherder.mozilla.org/logviewer?job_id=341513233&repo=autoland&lineNumber=30166
Backout: https://hg.mozilla.org/integration/autoland/rev/f59d5e60aee16f7e34d9dd160efeef8cea3da835
Assignee | ||
Comment 8•4 years ago
|
||
The AudioInputProcessing now needs to call ProcessInput to process the
given input data instead of processing them in NotifyInputData
Assignee | ||
Comment 9•4 years ago
|
||
Add an utility function named AppendFromInterleavedBuffer in
AudioSegment to append data from the given interleaved buffer. This
function does the same job as what AudioInputProcessing::InsertInGraph
and NativeInputTrack::ProcessInput were used to do. As a result, these
two functions can be eliminated or simplified.
Depends on D116673
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Noemi Erli[:noemi_erli] from comment #7)
Log: https://treeherder.mozilla.org/logviewer?job_id=341513992&repo=autoland&lineNumber=4035
The following crash is expected. Do not panic.
./mach gtest PLDHashTableTest.InitCapacityOk
intends to cause crashes. Nothing needs to worry about here ( Do not panic ;) ). In addition, I don't think my code touches any hash-table implementation.
https://treeherder.mozilla.org/logviewer?job_id=341513233&repo=autoland&lineNumber=30166
This is the only thing we should take care of. D116673 should fix the problem.
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dad561cb1cfb
https://hg.mozilla.org/mozilla-central/rev/98aad7de92bf
https://hg.mozilla.org/mozilla-central/rev/303bfb969f52
https://hg.mozilla.org/mozilla-central/rev/c450c5d35c61
https://hg.mozilla.org/mozilla-central/rev/f0c736218ab6
Description
•