class AudioOutput
Defined at line 29 of file ../../src/media/audio/audio_core/audio_output.h
Public Methods
void ~AudioOutput ()
Defined at line 31 of file ../../src/media/audio/audio_core/audio_output.h
OutputPipeline * output_pipeline ()
Defined at line 40 of file ../../src/media/audio/audio_core/audio_output.h
fpromise::promise<void, fuchsia::media::audio::UpdateEffectError> UpdateEffect (const std::string & instance_name, const std::string & config)
Defined at line 242 of file ../../src/media/audio/audio_core/audio_output.cc
fpromise::promise<void, zx_status_t> UpdateDeviceProfile (const DeviceConfig::OutputDeviceProfile::Parameters & params)
Replace the existing DeviceProfile and restart the OutputPipeline, for tuning purposes.
Defined at line 257 of file ../../src/media/audio/audio_core/audio_output.cc
void SetGainInfo (const fuchsia::media::AudioGainInfo & info, fuchsia::media::AudioGainValidFlags set_flags)
|media::audio::AudioDevice|
Defined at line 285 of file ../../src/media/audio/audio_core/audio_output.cc
Protected Methods
void AudioOutput (const std::string &name,const DeviceConfig &config,ThreadingModel *threading_model,DeviceRegistry *registry,LinkMatrix *link_matrix,std::shared_ptr<AudioCoreClockFactory>clock_factory,EffectsLoaderV2 *effects_loader_v2,std::unique_ptr<AudioDriver>)
TODO(https://fxbug.dev/42126303): We should not need driver to be set for all Audio Devices.
Defined at line 35 of file ../../src/media/audio/audio_core/audio_output.cc
void Process ()
Defined at line 46 of file ../../src/media/audio/audio_core/audio_output.cc
std::mutex & reporter_mutex ()
Defined at line 52 of file ../../src/media/audio/audio_core/audio_output.h
std::optional<Reporter::Container<Reporter::OutputDevice, Reporter::kObjectsToCache>::Ptr> & reporter ()
Defined at line 53 of file ../../src/media/audio/audio_core/audio_output.h
EffectsLoaderV2 * effects_loader_v2 ()
Defined at line 57 of file ../../src/media/audio/audio_core/audio_output.h
void SetNextSchedTimeMono (zx::time next_sched_time_mono)
Mark this output as needing to be mixed at the specified future time.
async PostForTime requires a time in the CLOCK_MONOTONIC timebase, so we use that here.
Defined at line 72 of file ../../src/media/audio/audio_core/audio_output.h
void ClearNextSchedTime ()
Defined at line 76 of file ../../src/media/audio/audio_core/audio_output.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|
If we're initializing a source link, then we're connecting a renderer to this output. Else
if we're initializing a dest link, then we're being connected as a loopback so we should return
our loopback stream.
Defined at line 168 of file ../../src/media/audio/audio_core/audio_output.cc
void CleanupSourceLink (const AudioObject & source, std::shared_ptr<ReadableStream> stream)
Defined at line 191 of file ../../src/media/audio/audio_core/audio_output.cc
fpromise::result<std::shared_ptr<ReadableStream>, zx_status_t> InitializeDestLink (const AudioObject & dest)
Defined at line 199 of file ../../src/media/audio/audio_core/audio_output.cc
void SetupMixTask (const DeviceConfig::OutputDeviceProfile &profile,size_tmax_block_size_frames,TimelineFunctiondevice_reference_clock_to_fractional_frame)
Defined at line 221 of file ../../src/media/audio/audio_core/audio_output.cc
std::shared_ptr<OutputPipeline> CreateOutputPipeline (const PipelineConfig &config,const VolumeCurve &volume_curve,size_tmax_block_size_frames,TimelineFunctiondevice_reference_clock_to_fractional_frame,std::shared_ptr<Clock>ref_clock)
Defined at line 211 of file ../../src/media/audio/audio_core/audio_output.cc
void Cleanup ()
Defined at line 237 of file ../../src/media/audio/audio_core/audio_output.cc
void ProcessMixJob (ReadableStream::ReadLockContext & ctx, FrameSpan mix_span)
Defined at line 132 of file ../../src/media/audio/audio_core/audio_output.cc
std::optional<AudioOutput::FrameSpan> StartMixJob (zx::time device_ref_time)
Start mixing frames for a periodic mix job. This is called internally during the periodic mix
task for this output. Implementations can control mix behavior in the following ways:
If |std::nullopt| is returned, then no frames will be mixed. Instead all inputs will be trimmed
such that any client audio packets that would have been fully consumed by the end of this mix
job will be released. There will be no call to |FinishMixJob|.
If the returned optional contains a FrameSpan with |is_mute| set to true, then no frames will
be mixed. Instead all inputs will be trimmed such that any client audio packets that would have
been fully consumed by the end of this mix job will be released. |WriteMixOutput| will be
called to write silence. |FinishMixJob| will be called with the returned FrameSpan.
If the returned optional contains a FrameSpan with |is_mute| set to false, then the mix
pipeline will be advanced by the requested frame region. |WriteMixOutput| will be called one
or more times to write the mixed output. |FinishMixJob| will be called with the returned
FrameSpan.
void WriteMixOutput (int64_tstart,int64_tlength,const float *payload)
Writes frames in the given region. The start and end will intersect the FrameSpan returned from
a prior |StartMixJob|. Write the given |payload|, or silence if |payload| is nullptr.
void FinishMixJob (const AudioOutput::FrameSpan & span)
This is called at the end of a mix job to update internal state. |span| is the same span
returned by the last call to StartMixJob.
zx::duration MixDeadline ()
The maximum amount of time it can take to run all pending mix jobs when a device
wakes up to process pending jobs.