class FakeComposite

Defined at line 33 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 kDefaultNumberOfChannels1
static const uint8_t kDefaultNumberOfChannels2
static const uint32_t kDefaultChannelAttributes1MinFrequency
static const uint32_t kDefaultChannelAttributes1MaxFrequency
static const uint32_t kDefaultChannelAttributes2MinFrequency
static const uint32_t kDefaultChannelAttributes3MaxFrequency
static ChannelAttributes kDefaultChannelAttributes1
static ChannelAttributes kDefaultChannelAttributes2
static ChannelAttributes kDefaultChannelAttributes3
static vector kDefaultChannelAttributesSet1
static vector kDefaultChannelAttributesSet2
static ChannelSet kDefaultChannelSet1
static ChannelSet kDefaultChannelSet2
static vector kDefaultChannelSets1
static vector kDefaultChannelSets2
static SampleFormat kDefaultRbSampleFormat1
static SampleFormat kDefaultRbSampleFormat2
static vector kDefaultRbSampleFormats1
static vector kDefaultRbSampleFormats2
static const uint8_t kDefaultRbBytesPerSample1
static const uint8_t kDefaultRbBytesPerSample2
static vector kDefaultRbBytesPerSampleSet1
static vector kDefaultRbBytesPerSampleSet2
static const uint8_t kDefaultRbValidBitsPerSample1
static const uint8_t kDefaultRbValidBitsPerSample2
static vector kDefaultRbValidBitsPerSampleSet1
static vector kDefaultRbValidBitsPerSampleSet2
static const uint32_t kDefaultRbFrameRate1
static const uint32_t kDefaultRbFrameRate2
static const uint32_t kDefaultPsFrameRate1
static const uint32_t kDefaultPsFrameRate2
static vector kDefaultRbFrameRates1
static vector kDefaultRbFrameRates2
static vector kDefaultPsFrameRates1
static vector kDefaultPsFrameRates2
static const uint32_t kDefaultPsEncodingBitRate1
static const uint32_t kDefaultPsEncodingBitRate2
static EncodingType kDefaultPsEncodingType1
static EncodingType kDefaultPsEncodingType2
static vector kDefaultPsEncodingTypes1
static vector kDefaultPsEncodingTypes2
static PcmSupportedFormats kDefaultPcmRingBufferFormatSet1
static PcmSupportedFormats kDefaultPcmRingBufferFormatSet2
static SupportedEncodings kDefaultEncodingSet1
static SupportedEncodings kDefaultEncodingSet2
static SupportedFormats2 kDefaultRbFormatSet1
static SupportedFormats2 kDefaultRbFormatSet2
static SupportedFormats2 kDefaultPsFormatSet1
static SupportedFormats2 kDefaultPsFormatSet2
static vector kDefaultRbFormatSets1
static vector kDefaultRbFormatSets2
static vector kDefaultPsFormatSets1
static vector kDefaultPsFormatSets2
static const std::unordered_map<ElementId, std::vector<fuchsia_hardware_audio::SupportedFormats2>> kDefaultRbFormatsMap
static const std::unordered_map<ElementId, std::vector<fuchsia_hardware_audio::SupportedFormats2>> kDefaultPsFormatsMap
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 kDestPsElementId
static const ElementId kSourcePsElementId
static const ElementId kMinPacketStreamElementId
static const ElementId kMaxPacketStreamElementId
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 kSourcePsElementDescription
static basic_string kDestPsElementDescription
static basic_string kMuteElementDescription
static Element kSourceDaiElement
static Element kDestRbElement
static Element kDestPsElement
static Element kSourceRbElement
static Element kSourcePsElement
static Element kDestDaiElement
static Element kMuteElement
static duration kSourceDaiElementProcessingDelay
static duration kSourceRbElementProcessingDelay
static duration kSourcePsElementProcessingDelay
static duration kDestDaiElementProcessingDelay
static ElementState kSourceDaiElementInitState
static ElementState kDestRbElementInitState
static ElementState kDestPsElementInitState
static ElementState kSourceRbElementInitState
static ElementState kSourcePsElementInitState
static ElementState kDestDaiElementInitState
static ElementState kMuteElementInitState
static vector kElements
static const TopologyId kInputOnlyTopologyId
static const TopologyId kPacketStreamCaptureTopologyId
static const TopologyId kFullDuplexTopologyId
static const TopologyId kOutputOnlyTopologyId
static const TopologyId kPacketStreamOutputTopologyId
static const TopologyId kOutputWithMuteTopologyId
static const TopologyId kMinTopologyId
static const TopologyId kMaxTopologyId
static EdgePair kTopologyInputEdgePair
static EdgePair kTopologyPsCaptureEdgePair
static EdgePair kTopologyOutputEdgePair
static EdgePair kTopologyPsOutputEdgePair
static EdgePair kTopologyRbToMuteEdgePair
static EdgePair kTopologyMuteToDaiEdgePair
static Topology kInputOnlyTopology
static Topology kPacketStreamCaptureTopology
static Topology kFullDuplexTopology
static Topology kOutputOnlyTopology
static Topology kPacketStreamOutputTopology
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 214 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void ~FakeComposite ()

Defined at line 224 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 227 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void DropChildren ()

Defined at line 234 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 246 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void InjectPacketStreamBufferTypes (ElementId element_id, fuchsia_hardware_audio::BufferType buffer_types)

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

void InjectPacketStreamAllocateVmosError (ElementId element_id, zx_status_t error)

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

void DropRingBuffers ()

From the driver side, drop all RingBuffer protocol connections for this device.

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

void InjectPacketStreamRegisterVmosError (ElementId element_id, zx_status_t error)

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

void DropPacketStreams ()

From the driver side, drop all PacketStream protocol connection for this device.

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

async_dispatcher_t * dispatcher ()

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

bool is_bound ()

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

bool responsive ()

Defined at line 289 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 289 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 291 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

std::optional<bool> health_state ()

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

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

Defined at line 293 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 295 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 296 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 297 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.h

void DropPacketStream (ElementId element_id)

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

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

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

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

bool is_element_type (ElementId element_id, fuchsia_hardware_audio_signalprocessing::ElementType element_type)

Defined at line 306 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 347 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 315 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void on_ps_unbind (FakeCompositePacketStream * fake_packet_stream, fidl::UnbindInfo info, fidl::ServerEnd<fuchsia_hardware_audio::PacketStreamControl> )

Defined at line 322 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 331 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void PacketStreamWasDropped (ElementId element_id)

The PacketStream 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 340 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

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 542 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

void EnableActiveChannelsSupport (ElementId element_id)

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

void DisableActiveChannelsSupport (ElementId element_id)

Defined at line 549 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 552 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 556 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

uint64_t RingBufferActiveChannelsBitmask (ElementId element_id)

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

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

zx::time RingBufferSetActiveChannelsCompletedAt (ElementId element_id)

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

bool RingBufferStarted (ElementId element_id)

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

zx::time RingBufferMonoStartTime (ElementId element_id)

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

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

Defined at line 1127 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 1078 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 967 of file ../../src/media/audio/services/device_registry/testing/fakes/fake_composite.cc

Friends

class FakeCompositePacketStream
class FakeCompositeRingBuffer