Closed Bug 1742655 Opened 2 years ago Closed 2 years ago

Open/Close audio device via DeviceInputTrack

Categories

(Core :: Audio/Video: MediaStreamGraph, task, P1)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

Details

Attachments

(10 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Now the audio start/stop is controlled by the AudioInputTrack's API but it is not the device-level MediaTrack. The audio start/stop should be controlled via DeviceInputTrack's API instead. The DeviceInputTrack is the source of input port for the AudioInputTracks and it's the MediaTrack that is closest to the device in MediaTrackGraph.

This involves the following tasks:

  • Remove the unused functions in AudioDataListenerInterface once bug 1741959 is done.
  • Implement DeviceInputTrack APIs to open/close audio device in MediaTrackGraph
  • Add tests for AudioInputTrack with mock MediaTrackGraph
Depends on: 1746910

mDeviceTrackMap only has one element since MediaTrackGraph can have only
one input device. Besides, we can get NativeInputTrack directly from
mTracks on graph thread without accessing it from mDeviceTrackMap. The
only left reason for having mDeviceTrackMap is to check if we have any
input device on Android. On Android, the default input device id is
always nullptr, so we use a hashmap to check if MediaTrackGraph contains
any input device. However, this hashmap can be replaced by a Maybe since
MediaTrackGraph can have only one input device.

Depends on D134526

Depends on D134527

Depends on D134528

NativeInputTrack should have a AudioDeviceID value indicating what
device its audio source is from

Depends on D134529

Attached file Bug 1742655 - Add GetNativeInputTrack (obsolete) —

Implement a function in MediaTrackGraph to get the NativeInputTrack by a
device id

Depends on D134530

Implement utility functions to query the input channel count and whether
input has voice from NativeInputTrack's users

Depends on D134531

Depends on D134532

Rename {Close, Open}AudioInput to {Disc, C}onnectDeviceInput

Depends on D134627

Attachment #9256583 - Attachment is obsolete: true
Attachment #9256585 - Attachment description: Bug 1742655 - Open/close audio input via NativeInputTrack → Bug 1742655 - Open/Close audio input via NativeInputTrack
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8ba26997b4b
Move AudioInput* implementations to cpp file r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/53e7f97f8c90
Move NativeInputTrack's ctor to cpp file r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/5e5441649e64
Reword outdated comments r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/dc7fbea824ed
Track AudioDeviceID in NativeInputTrack r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/ae191833e3af
Remove mDeviceTrackMap in MediaTrackGraph r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/b0a8837110db
Add MaxRequestedInputChannels and HasVoiceInput r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/a1def130c105
Remove NotifyOutputData from NativeInputTrack r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/8cb7b8231c98
Open/Close audio input via NativeInputTrack r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/b004b579d1ce
Rename functions r=pehrsons
https://hg.mozilla.org/integration/autoland/rev/3aef6c404e07
Rename AudioInputTrack to AudioProcessingTrack r=pehrsons
Regressions: 1752449
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: