Track AudioDeviceID in AudioInputTrack
Categories
(Core :: Audio/Video: MediaStreamGraph, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: chunmin, Assigned: chunmin)
References
Details
Attachments
(1 file, 1 obsolete file)
Now the AudioDeviceID
is tracked by MediaEngineWebRTCMicrophoneSource.mDeviceInfo.DeviceID()
so AudioInputTrack
has no idea of what device is closed when it's destroyed. In this situation, we search the paired device for the AudioDeviceID
's mInputListener
, in MediaTrackGraphImpl
, to get the information.
We could track the AudioDeviceID
directly when AudioInputTrack::OpenAudioInput
is called and use this AudioDeviceID
whenever AudioInputTrack::CloseAudioInput
is called. Then MediaTrackGraphImpl
has no need to do the search.
This gives two benefits:
- I am going to remove
mInputDeviceUsers
and skip trackingAudioDataListener
inMediaTrackGraphImpl
in bug 1702646. This makes things easier. - The time complexity to get the device that will be closed, in
MediaTrackGraphImpl::CloseAudioInputImpl
, is reduced from O(MN) to O(1), where N is the number of listeners in device D and M is the number of devices inMediaTrackGraphImpl
. Since we only support one device at a time currently so the actual time complexity is O(N).
Assignee | ||
Comment 1•3 years ago
|
||
This patch adds an AudioDeviceID
member in AudioInputTrack
. This
aims to simplify AudioInputTrack::CloseAudioInput
.
Before this patch, the AudioDeviceID
is tracked by
MediaEngineWebRTCMicrophoneSource
only instead so AudioInputTrack
has no idea of what device it pairs with. One main drawback is that
MediaTrackGraphImpl
needs to search all the AudioDataListener
inside it to infer what device is closed when
AudioInputTrack::Destroy()
is called, since AudioInputTrack
doesn't know what is its paired device, which gives an O(N) time
complexity, where N is the number of AudioDataListener
in
MediaTrackGraphImpl
A simple way to reduce the time complexity from O(N) to O(1) is to track
the paired device when AudioInputTrack::OpenAudioInput
is called. This
also enables the possibility to remove mInputDeviceUsers
in Bug
1702646.
Assignee | ||
Comment 2•3 years ago
|
||
This patch adds an AudioDeviceID
member in AudioInputTrack
. This
aims to simplify AudioInputTrack::CloseAudioInput
.
Before this patch, the AudioDeviceID
is tracked by
MediaEngineWebRTCMicrophoneSource
only instead so AudioInputTrack
has no idea of what device it pairs with. One main drawback is that
MediaTrackGraphImpl
needs to search all the AudioDataListener
inside it to infer what device is closed when
AudioInputTrack::Destroy()
is called, since AudioInputTrack
doesn't know what is its paired device, which gives an O(N) time
complexity, where N is the number of AudioDataListener
in
MediaTrackGraphImpl
A simple way to reduce the time complexity from O(N) to O(1) is to track
the paired device when AudioInputTrack::OpenAudioInput
is called. This
also enables the possibility to remove mInputDeviceUsers
in Bug
1702646.
Updated•3 years ago
|
Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/595892080fa3 Track AudioDeviceID in AudioInputTrack r=padenot
Comment 4•3 years ago
|
||
bugherder |
Description
•