class FakeComposite

Defined at line 35 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

This driver implements the audio driver interface and is configurable to simulate audio hardware.

Public Members

static const char[] kDefaultManufacturer
static const char[] kDefaultProduct
static array kDefaultUniqueInstanceId
static const ClockDomain kDefaultClockDomain
static const char[] kDefaultClockDomainStr
static const uint32_t kDefaultDaiNumberOfChannels
static const uint32_t kDefaultDaiNumberOfChannels2
static DaiSampleFormat kDefaultDaiSampleFormat
static DaiSampleFormat kDefaultDaiSampleFormat2
static const uint32_t kDefaultDaiFrameRate
static const uint32_t kDefaultDaiFrameRate2
static const uint8_t kDefaultDaiBitsPerSlot
static const uint8_t kDefaultDaiBitsPerSlot2
static const uint8_t kDefaultDaiBitsPerSample
static const uint8_t kDefaultDaiBitsPerSample2
static DaiFrameFormat kDefaultDaiFrameFormat
static DaiFrameFormat kDefaultDaiFrameFormat2
static vector kDefaultDaiNumberOfChannelsSet
static vector kDefaultDaiNumberOfChannelsSet2
static vector kDefaultDaiSampleFormatSet
static vector kDefaultDaiSampleFormatSet2
static vector kDefaultDaiFrameFormatSet
static vector kDefaultDaiFrameFormatSet2
static vector kDefaultDaiFrameRateSet
static vector kDefaultDaiFrameRateSet2
static vector kDefaultDaiBitsPerSlotSet
static vector kDefaultDaiBitsPerSlotSet2
static vector kDefaultDaiBitsPerSampleSet
static vector kDefaultDaiBitsPerSampleSet2
static DaiSupportedFormats kDefaultDaiFormatSet
static DaiSupportedFormats kDefaultDaiFormatSet2
static vector kDefaultDaiFormatSets
static vector kDefaultDaiFormatSets2
static const std::unordered_map<ElementId, std::vector<fuchsia_hardware_audio::DaiSupportedFormats>> kDefaultDaiFormatsMap
static DaiFormat kDefaultDaiFormat
static DaiFormat kDefaultDaiFormat2
static const size_t kDefaultRingBufferAllocationSize
static const uint8_t kDefaultRbNumberOfChannels
static const uint8_t kDefaultRbNumberOfChannels2
static const uint32_t kDefaultRbChannelAttributes1MinFrequency
static const uint32_t kDefaultRbChannelAttributes1MaxFrequency
static const uint32_t kDefaultRbChannelAttributes2MinFrequency
static const uint32_t kDefaultRbChannelAttributes3MaxFrequency
static ChannelAttributes kDefaultRbChannelAttributes1
static ChannelAttributes kDefaultRbChannelAttributes2
static ChannelAttributes kDefaultRbChannelAttributes3
static vector kDefaultRbChannelAttributesSet1
static vector kDefaultRbChannelAttributesSet2
static ChannelSet kDefaultRbChannelSet1
static ChannelSet kDefaultRbChannelSet2
static vector kDefaultRbChannelSets1
static vector kDefaultRbChannelSets2
static SampleFormat kDefaultRbSampleFormat
static SampleFormat kDefaultRbSampleFormat2
static vector kDefaultRbSampleFormats
static vector kDefaultRbSampleFormats2
static const uint8_t kDefaultRbBytesPerSample
static const uint8_t kDefaultRbBytesPerSample2
static vector kDefaultRbBytesPerSampleSet
static vector kDefaultRbBytesPerSampleSet2
static const uint8_t kDefaultRbValidBitsPerSample
static const uint8_t kDefaultRbValidBitsPerSample2
static vector kDefaultRbValidBitsPerSampleSet
static vector kDefaultRbValidBitsPerSampleSet2
static const uint32_t kDefaultRbFrameRate
static const uint32_t kDefaultRbFrameRate2
static vector kDefaultRbFrameRates
static vector kDefaultRbFrameRates2
static PcmSupportedFormats kDefaultPcmRingBufferFormatSet
static PcmSupportedFormats kDefaultPcmRingBufferFormatSet2
static SupportedFormats2 kDefaultRbFormatSet
static SupportedFormats2 kDefaultRbFormatSet2
static vector kDefaultRbFormatSets
static vector kDefaultRbFormatSets2
static const std::unordered_map<ElementId, std::vector<fuchsia_hardware_audio::SupportedFormats2>> kDefaultRbFormatsMap
static PcmFormat kDefaultRbFormat
static PcmFormat kDefaultRbFormat2
static const ElementId kSourceDaiElementId
static const ElementId kDestDaiElementId
static const ElementId kMinDaiElementId
static const ElementId kMaxDaiElementId
static const ElementId kDestRbElementId
static const ElementId kSourceRbElementId
static const ElementId kMinRingBufferElementId
static const ElementId kMaxRingBufferElementId
static const ElementId kMuteElementId
static const ElementId kMinElementId
static const ElementId kMaxElementId
static basic_string kSourceDaiElementDescription
static basic_string kDestDaiElementDescription
static basic_string kSourceRbElementDescription
static basic_string kDestRbElementDescription
static basic_string kMuteElementDescription
static Element kSourceDaiElement
static Element kDestRbElement
static Element kSourceRbElement
static Element kDestDaiElement
static Element kMuteElement
static duration kSourceDaiElementProcessingDelay
static duration kSourceRbElementProcessingDelay
static duration kDestDaiElementProcessingDelay
static ElementState kSourceDaiElementInitState
static ElementState kDestRbElementInitState
static ElementState kSourceRbElementInitState
static ElementState kDestDaiElementInitState
static ElementState kMuteElementInitState
static vector kElements
static const TopologyId kInputOnlyTopologyId
static const TopologyId kFullDuplexTopologyId
static const TopologyId kOutputOnlyTopologyId
static const TopologyId kOutputWithMuteTopologyId
static const TopologyId kMinTopologyId
static const TopologyId kMaxTopologyId
static EdgePair kTopologyInputEdgePair
static EdgePair kTopologyOutputEdgePair
static EdgePair kTopologyRbToMuteEdgePair
static EdgePair kTopologyMuteToDaiEdgePair
static Topology kInputOnlyTopology
static Topology kFullDuplexTopology
static Topology kOutputOnlyTopology
static Topology kOutputWithMuteTopology
static vector kTopologies

Public Methods

void FakeComposite (zx::channel server_end, zx::channel client_end, async_dispatcher_t * dispatcher)

Defined at line 154 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void DropComposite ()

From the device side, drop the Composite protocol connection as if the device has been removed.

Defined at line 165 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void DropChildren ()

Defined at line 172 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void DropRingBuffers ()

From the driver side, drop the RingBuffer protocol connection for this element_id.

Defined at line 206 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void NotImplemented_ (const std::string & name, ::fidl::CompleterBase & completer)

Defined at line 209 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void DropRingBuffer (ElementId element_id)

From the driver side, drop the RingBuffer protocol connection for this element_id.

Defined at line 215 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void on_rb_unbind (FakeCompositeRingBuffer * fake_ring_buffer, fidl::UnbindInfo info, fidl::ServerEnd<fuchsia_hardware_audio::RingBuffer> )

static

Defined at line 228 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

async_dispatcher_t * dispatcher ()

Defined at line 233 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

bool is_bound ()

Defined at line 234 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

bool responsive ()

Defined at line 236 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

fidl::ClientEnd<fuchsia_hardware_audio::Composite> Enable ()

This returns a fidl::client_end

<fuchsia

_hardware_audio::Composite>. The driver will not start

serving requests until Enable is called, which is why we separate construction and Enable().

Defined at line 244 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void RingBufferWasDropped (ElementId element_id)

The RingBuffer FIDL connection has already been dropped, so there's nothing else for the parent

driver to do, except clean up our accounting.

Defined at line 237 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void set_unresponsive ()

Once we mark a device unresponsive, it cannot correctly transition back to responsive state.

Defined at line 238 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

std::optional<bool> health_state ()

Defined at line 239 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void set_health_state (std::optional<bool> healthy)

Defined at line 240 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void set_device_manufacturer (std::optional<std::string> mfgr)

Defined at line 242 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void set_device_product (std::optional<std::string> product)

Defined at line 243 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void set_stream_unique_id (std::optional<UniqueId> uid)

Defined at line 244 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void set_clock_domain (std::optional<ClockDomain> clock_domain)

Defined at line 251 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

bool is_ring_buffer (ElementId element_id)

Defined at line 253 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

uint64_t active_channels_bitmask (ElementId element_id)

These rely on the RingBuffer being created; do not use them to pre-configure the RingBuffer.

Defined at line 264 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

zx::time set_active_channels_completed_at (ElementId element_id)

Defined at line 268 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

bool started (ElementId element_id)

Defined at line 272 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

zx::time mono_start_time (ElementId element_id)

Defined at line 276 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void InjectDelayUpdate (ElementId element_id, std::optional<zx::duration> internal_delay, std::optional<zx::duration> external_delay)

Explicitly trigger a change notification, for the current values of gain/plug/delay.

Defined at line 281 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void ReserveRingBufferSize (ElementId element_id, size_t size)

These may be called before the RingBuffer object is created; info must be cached until then.

Defined at line 395 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void EnableActiveChannelsSupport (ElementId element_id)

Defined at line 399 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void DisableActiveChannelsSupport (ElementId element_id)

Defined at line 402 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void PresetTurnOnDelay (ElementId element_id, std::optional<zx::duration> turn_on_delay)

Defined at line 405 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void PresetInternalExternalDelays (ElementId element_id, zx::duration internal_delay, std::optional<zx::duration> external_delay)

Defined at line 409 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void InjectTopologyChange (std::optional<TopologyId> topology_id)

Inject std::nullopt to simulate "no topology", such as at power-up or after Reset().

Defined at line 869 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void InjectElementStateChange (ElementId element_id, fuchsia_hardware_audio_signalprocessing::ElementState new_state)

Defined at line 758 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

Friends

class FakeCompositeRingBuffer