class BaseCapturer

Defined at line 35 of file ../../src/media/audio/audio_core/base_capturer.h

Public Methods

std::shared_ptr<Clock> reference_clock ()

Defined at line 39 of file ../../src/media/audio/audio_core/base_capturer.h

Protected Methods

void BaseCapturer (std::optional<Format> format, fidl::InterfaceRequest<fuchsia::media::AudioCapturer> audio_capturer_request, Context * context)

Defined at line 42 of file ../../src/media/audio/audio_core/base_capturer.cc

Context & context ()

Defined at line 49 of file ../../src/media/audio/audio_core/base_capturer.h

ExecutionDomain & mix_domain ()

Defined at line 51 of file ../../src/media/audio/audio_core/base_capturer.h

void ~BaseCapturer ()

Defined at line 71 of file ../../src/media/audio/audio_core/base_capturer.cc

State capture_state ()

Defined at line 128 of file ../../src/media/audio/audio_core/base_capturer.h

bool has_pending_packets ()

Defined at line 130 of file ../../src/media/audio/audio_core/base_capturer.h

bool IsOperating ()

Defined at line 291 of file ../../src/media/audio/audio_core/base_capturer.cc

void UpdateFormat (Format format)

Defined at line 807 of file ../../src/media/audio/audio_core/base_capturer.cc

void BeginShutdown ()

Removes the capturer from its owner, the route graph, triggering shutdown and drop.

Defined at line 124 of file ../../src/media/audio/audio_core/base_capturer.cc

void ReportStart ()

Defined at line 460 of file ../../src/media/audio/audio_core/base_capturer.cc

void ReportStop ()

Defined at line 462 of file ../../src/media/audio/audio_core/base_capturer.cc

void OnStateChanged (State old_state, State new_stage)

Defined at line 129 of file ../../src/media/audio/audio_core/base_capturer.cc

void SetRoutingProfile (bool routable)
bool StateIsRoutable (BaseCapturer::State state)

Defined at line 146 of file ../../src/media/audio/audio_core/base_capturer.h

fpromise::result<std::pair<std::shared_ptr<Mixer>, ExecutionDomain *>, zx_status_t> InitializeSourceLink (const AudioObject & source, std::shared_ptr<ReadableStream> stream)

|media::audio::AudioObject|

Defined at line 146 of file ../../src/media/audio/audio_core/base_capturer.cc

void CleanupSourceLink (const AudioObject & source, std::shared_ptr<ReadableStream> stream)

Defined at line 178 of file ../../src/media/audio/audio_core/base_capturer.cc

void OnLinkAdded ()

Defined at line 73 of file ../../src/media/audio/audio_core/base_capturer.cc

fidl::Binding<fuchsia::media::AudioCapturer> & binding ()

Defined at line 157 of file ../../src/media/audio/audio_core/base_capturer.h

void SetClock (std::shared_ptr<Clock> audio_clock)

AudioCore treats client-provided clocks as not-rate-adjustable.

Defined at line 160 of file ../../src/media/audio/audio_core/base_capturer.h

Reporter::Capturer & reporter ()

Defined at line 162 of file ../../src/media/audio/audio_core/base_capturer.h

Enumerations

enum State
Name Value
WaitingForVmo 0
WaitingForRequest 1
SyncOperating 2
AsyncOperating 3
AsyncStopping 4
AsyncStoppingCallbackPending 5
Shutdown 6

The BaseCapturer state machine:

(start)

|

V

WaitingForVmo

|

| (client provides a VMO)

V

WaitingForRequest

| ^ ^ |

| | | | (client calls CaptureAt)

| | ( no more ) | |

| | (CaptureAt) | |

| | ( pending ) | V

| | SyncOperating

| |

(client calls ) | |

(StartAsyncCapture) | +------------------+

V |

AsyncOperating |

| |

(client calls ) | |

(StopAsyncCapture) | |

V |

AsyncStopping |

| |

(mixer thread ) | |

(finishes cleanup) | |

V |

AsyncStoppingCallbackPending |

| |

(FIDL thread ) | |

(delivers callback) +--------------------+

:: WaitingForVmo ::

AudioCapturers start in this state. They should have a default capture

format set, and will accept a state change up until the point where they

have a shared payload VMO assigned to them.

:: WaitingForRequest ::

After a format has been assigned and a shared payload VMO has provided, the

AudioCapturer is waiting to operate in Sync or Async mode.

:: SyncOperating ::

AudioCapturers enter SyncOperating after a successful call to CaptureAt.

They remain in this state until all pending CaptureAt requests are handled

or flushed.

:: AsyncOperating ::

AudioCapturers enter AsyncOperating after a successful call to

StartAsyncCapture. CaptureAt and Flush are illegal while in this state.

:: AsyncStopping ::

:: AsyncStoppingCallbackPending ::

AudioCapturers enter AsyncStopping after a successful call to

StopAsyncCapture. A thread from the mix_domain will handle the details of

stopping. Aside from setting the gain, all operations are illegal while the

AudioCapturer is in the process of stopping. Once the mix domain thread has

finished cleaning up, it will transition to the AsyncStoppingCallbackPending

state and signal the main service thread in order to complete the process.

:: Shutdown ::

AudioCapturers enter this state when the connection is closing. We might

transition to this state from any other state.

Defined at line 119 of file ../../src/media/audio/audio_core/base_capturer.h