pub struct ControlProxy { /* private fields */ }Implementations§
Source§impl ControlProxy
impl ControlProxy
Sourcepub fn take_event_stream(&self) -> ControlEventStream
pub fn take_event_stream(&self) -> ControlEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_elements(
&self,
) -> QueryResponseFut<ReaderGetElementsResult, DefaultFuchsiaResourceDialect>
pub fn get_elements( &self, ) -> QueryResponseFut<ReaderGetElementsResult, DefaultFuchsiaResourceDialect>
Returns a vector of supported processing elements. This vector must include one or more processing elements.
Sourcepub fn watch_element_state(
&self,
processing_element_id: u64,
) -> QueryResponseFut<ElementState, DefaultFuchsiaResourceDialect>
pub fn watch_element_state( &self, processing_element_id: u64, ) -> QueryResponseFut<ElementState, DefaultFuchsiaResourceDialect>
Get the processing element state via a hanging get.
For a given processing_element_id, the driver will immediately reply to the first
WatchElementState sent by the client. The driver will not respond to subsequent client
WatchElementState calls for that processing_element_id until any portion of the
ElementState has changed from what was most recently reported for that element.
The driver will close the protocol channel with an error of ZX_ERR_INVALID_ARGS, if
processing_element_id does not match an ElementId returned by GetElements.
The driver will close the protocol channel with an error of ZX_ERR_BAD_STATE, if this
method is called again while there is already a pending WatchElementState for this client
and processing_element_id.
Sourcepub fn get_topologies(
&self,
) -> QueryResponseFut<ReaderGetTopologiesResult, DefaultFuchsiaResourceDialect>
pub fn get_topologies( &self, ) -> QueryResponseFut<ReaderGetTopologiesResult, DefaultFuchsiaResourceDialect>
Returns a vector of supported topologies.
This vector must include one or more topologies.
If more than one topology is returned, then the client may select any topology from the
list by calling SetTopology.
If only one topology is returned, SetTopology can still be called but causes no change.
Each Element must be included in at least one Topology, but need not be included in every Topology.
Sourcepub fn watch_topology(
&self,
) -> QueryResponseFut<u64, DefaultFuchsiaResourceDialect>
pub fn watch_topology( &self, ) -> QueryResponseFut<u64, DefaultFuchsiaResourceDialect>
Get the current topology via a hanging get.
The driver will immediately reply to the first WatchTopology sent by each client.
The driver will not respond to subsequent WatchTopology calls from that client until the
signal processing topology changes; this occurs as a result of a SetTopology call.
The driver will close the protocol channel with an error of ZX_ERR_BAD_STATE, if this
method is called again while there is already a pending WatchTopology for this client.
Sourcepub fn set_topology(
&self,
topology_id: u64,
) -> QueryResponseFut<SignalProcessingSetTopologyResult, DefaultFuchsiaResourceDialect>
pub fn set_topology( &self, topology_id: u64, ) -> QueryResponseFut<SignalProcessingSetTopologyResult, DefaultFuchsiaResourceDialect>
Sets the currently active topology by specifying a topology_id, which matches to an entry
in the vector returned by GetTopologies.
The currently active topology is communicated by WatchTopology responses. To change which
topology is active, a client uses SetTopology.
If GetTopologies returns only one Topology, SetTopology is optional and has no effect.
This call will fail and return ZX_ERR_INVALID_ARGS if the specified topology_id is not
found within thetopologies returned by GetTopologies.
SetTopology may be called before or after non-SignalProcessing protocol calls.
If called after non-SignalProcessing protocol calls, then SetTopology may return
ZX_ERR_BAD_STATE to indicate that the operation can not proceed without renegotiation of
the driver state. See SetElementState for further discussion.
Sourcepub fn set_element_state(
&self,
processing_element_id: u64,
state: &SettableElementState,
) -> QueryResponseFut<SignalProcessingSetElementStateResult, DefaultFuchsiaResourceDialect>
pub fn set_element_state( &self, processing_element_id: u64, state: &SettableElementState, ) -> QueryResponseFut<SignalProcessingSetElementStateResult, DefaultFuchsiaResourceDialect>
Controls the processing element specified by processing_element_id, a unique ElementId
returned by GetElements.
The state specified in calls to SetElementState is a SettableElementState. This is a
subset of ElementState because some fields returned by WatchElementState (e.g. latency
or plug_state) can only be observed (not set) by the client.
Returns ZX_ERR_INVALID_ARGS if processing_element_id does not match a known ElementId
returned by GetElements, or if state is not valid for the element. This entails any
violation of the rules specified in this protocol.
Examples:
state specifies that an element should be stopped or bypassed, but the corresponding
element does not specify (or explicitly set to false) can_stop or can_bypass.
state includes a type_specific entry, but that SettableTypeSpecificElementState does
not match the ElementType of the element corresponding to processing_element_id.
state changes an EqualizerBandState for an EQUALIZER element (so far so good), but
specifies a change to frequency when this element did not set CAN_CONTROL_FREQUENCY
in its supported_controls.
state specifies a GainElementState for a GAIN element with a gain value that is
-infinity, NAN, or outside the Element’s stated [min_gain, max_gain] range.
Callers may intersperse method calls to the SignalProcessing protocol with calls to other
driver protocols. Some non-SignalProcessing configuration changes may require a
renegotiation of the driver state before certain elements can receive a SetElementState.
For example, if a DaiFormat is changed, then SetElementState changing an AGL element’s
parameters may not require renegotiation of driver state because changing gain parameters
usually does not change the set of supported audio formats.
By contrast, following the same DaiFormat change, before SetElementState can be called
on a CONNECTION_POINT element, the driver state may need to be reestablished because the
format change may invalidate the set of supported formats returned in a previous
GetDaiFormats protocol call for another part of the Topology.
It is the driver’s job to determine when renegotiation is required. When this is needed,
the related SetElementState call must return ZX_ERR_BAD_STATE and the client must
close the protocol channel entirely, such that the protocol negotiations are started over.
The client then must re-invoke the SetElementState call that returned
ZX_ERR_BAD_STATE before any non-SignalProcessing protocol calls.
Sourcepub fn create_ring_buffer(
&self,
payload: ControlCreateRingBufferRequest,
) -> QueryResponseFut<ControlCreateRingBufferResult, DefaultFuchsiaResourceDialect>
pub fn create_ring_buffer( &self, payload: ControlCreateRingBufferRequest, ) -> QueryResponseFut<ControlCreateRingBufferResult, DefaultFuchsiaResourceDialect>
Create the ring buffer used to pass audio to/from this device. If the device is
Composite, then the targeted RING_BUFFER ENDPOINT must be identified by element_id.
Should only be called for Composite devices.
Sourcepub fn set_dai_format(
&self,
payload: &ControlSetDaiFormatRequest,
) -> QueryResponseFut<ControlSetDaiFormatResult, DefaultFuchsiaResourceDialect>
pub fn set_dai_format( &self, payload: &ControlSetDaiFormatRequest, ) -> QueryResponseFut<ControlSetDaiFormatResult, DefaultFuchsiaResourceDialect>
Set the wire format for the digital interconnect connected to this Codec endpoint.
This method returns information related to the format that was set, including delay values.
If the device is Composite, then the targeted DAI_INTERCONNECT ENDPOINT must be identified
by element_id.
Should only be called for Codec and Composite devices.
Sourcepub fn codec_start(
&self,
) -> QueryResponseFut<ControlCodecStartResult, DefaultFuchsiaResourceDialect>
pub fn codec_start( &self, ) -> QueryResponseFut<ControlCodecStartResult, DefaultFuchsiaResourceDialect>
Start the Codec hardware. If successful, this returns after the Codec was started and
start_time indicates the time when the hardware started. Note that the Codec’s DaiFormat
must be set (by a successful SetDaiFormat call) before calling this method.
Should only be called for Codec devices.
Sourcepub fn codec_stop(
&self,
) -> QueryResponseFut<ControlCodecStopResult, DefaultFuchsiaResourceDialect>
pub fn codec_stop( &self, ) -> QueryResponseFut<ControlCodecStopResult, DefaultFuchsiaResourceDialect>
Stop the Codec hardware. If successful, this returns after the Codec was stopped and
stop_time indicates the time when the hardware stopped. Note that the Codec’s DaiFormat
must be set (by a successful SetDaiFormat call) before calling this method.
Should only be called for Codec devices.
Sourcepub fn reset(
&self,
) -> QueryResponseFut<ControlResetResult, DefaultFuchsiaResourceDialect>
pub fn reset( &self, ) -> QueryResponseFut<ControlResetResult, DefaultFuchsiaResourceDialect>
Reset the hardware – stopping the hardware, releasing any ring buffers, and clearing any DaiFormats or RingBufferFormats that were set.
This method returns when the hardware reset is complete.
After calling this method, the device is still controlled, but any ring buffers must be
re-created and re-started.
For devices with DAI_INTERCONNECTs (such as Codecs and some Composites), SetDaiFormat and
CodecStart must be called again (in that order) to return the interconnect to the active
operational mode.
As applicable, SetTopology and SetElementState must also be called.
Should only be called for Codec and Composite devices.
Trait Implementations§
Source§impl Clone for ControlProxy
impl Clone for ControlProxy
Source§fn clone(&self) -> ControlProxy
fn clone(&self) -> ControlProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ControlProxyInterface for ControlProxy
impl ControlProxyInterface for ControlProxy
type GetElementsResponseFut = QueryResponseFut<Result<Vec<Element>, i32>>
type WatchElementStateResponseFut = QueryResponseFut<ElementState>
type GetTopologiesResponseFut = QueryResponseFut<Result<Vec<Topology>, i32>>
type WatchTopologyResponseFut = QueryResponseFut<u64>
type SetTopologyResponseFut = QueryResponseFut<Result<(), i32>>
type SetElementStateResponseFut = QueryResponseFut<Result<(), i32>>
type CreateRingBufferResponseFut = QueryResponseFut<Result<ControlCreateRingBufferResponse, ControlCreateRingBufferError>>
type SetDaiFormatResponseFut = QueryResponseFut<Result<ControlSetDaiFormatResponse, ControlSetDaiFormatError>>
type CodecStartResponseFut = QueryResponseFut<Result<ControlCodecStartResponse, ControlCodecStartError>>
type CodecStopResponseFut = QueryResponseFut<Result<ControlCodecStopResponse, ControlCodecStopError>>
type ResetResponseFut = QueryResponseFut<Result<ControlResetResponse, ControlResetError>>
fn get_elements(&self) -> Self::GetElementsResponseFut
fn watch_element_state( &self, processing_element_id: u64, ) -> Self::WatchElementStateResponseFut
fn get_topologies(&self) -> Self::GetTopologiesResponseFut
fn watch_topology(&self) -> Self::WatchTopologyResponseFut
fn set_topology(&self, topology_id: u64) -> Self::SetTopologyResponseFut
fn set_element_state( &self, processing_element_id: u64, state: &SettableElementState, ) -> Self::SetElementStateResponseFut
fn create_ring_buffer( &self, payload: ControlCreateRingBufferRequest, ) -> Self::CreateRingBufferResponseFut
fn set_dai_format( &self, payload: &ControlSetDaiFormatRequest, ) -> Self::SetDaiFormatResponseFut
fn codec_start(&self) -> Self::CodecStartResponseFut
fn codec_stop(&self) -> Self::CodecStopResponseFut
fn reset(&self) -> Self::ResetResponseFut
Source§impl Debug for ControlProxy
impl Debug for ControlProxy
Source§impl Proxy for ControlProxy
impl Proxy for ControlProxy
Source§type Protocol = ControlMarker
type Protocol = ControlMarker
Proxy controls.