class BaseCapturer

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

Public Methods

std::shared_ptr<Clock> reference_clock ()

Defined at line 40 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 153 of file ../../src/media/audio/audio_core/base_capturer.cc

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

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

void OnLinkAdded ()

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

void GetStreamType (GetStreamTypeCallback cbk)

|fuchsia::media::AudioCapturer|

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

void AddPayloadBuffer (uint32_t id, zx::vmo payload_buf_vmo)

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

void RemovePayloadBuffer (uint32_t id)

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

void GetReferenceClock (GetReferenceClockCallback callback)

Regardless of the source of the reference clock, we can duplicate and return it here.

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

void CaptureAt (uint32_t payload_buffer_id, uint32_t offset_frames, uint32_t num_frames, CaptureAtCallback cbk)

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

void ReleasePacket (fuchsia::media::StreamPacket packet)

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

void DiscardAllPackets (DiscardAllPacketsCallback cbk)

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

void DiscardAllPacketsNoReply ()

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

void StartAsyncCapture (uint32_t frames_per_packet)

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

void StopAsyncCapture (StopAsyncCaptureCallback cbk)

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

void StopAsyncCaptureNoReply ()

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

Protected Methods

Context & context ()

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

ExecutionDomain & mix_domain ()

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

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

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

void ~BaseCapturer ()

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

State capture_state ()

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

bool has_pending_packets ()

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

bool StateIsRoutable (BaseCapturer::State state)

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

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

Defined at line 172 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 175 of file ../../src/media/audio/audio_core/base_capturer.h

Reporter::Capturer & reporter ()

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

void handle_unknown_method (uint64_t ordinal, bool method_has_response)

|fuchsia::media::AudioCapturer|

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

bool IsOperating ()

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

void UpdateFormat (Format format)

Defined at line 808 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 128 of file ../../src/media/audio/audio_core/base_capturer.cc

void ReportStart ()

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

void ReportStop ()

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

void OnStateChanged (State old_state, State new_state)

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

void SetRoutingProfile (bool routable)

Enumerations

enum class State : uint8_t
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 141 of file ../../src/media/audio/audio_core/base_capturer.h