pub enum DeviceRequest {
GetFormat {
responder: DeviceGetFormatResponder,
},
GetGain {
responder: DeviceGetGainResponder,
},
GetBuffer {
responder: DeviceGetBufferResponder,
},
SetNotificationFrequency {
notifications_per_ring: u32,
responder: DeviceSetNotificationFrequencyResponder,
},
GetPosition {
responder: DeviceGetPositionResponder,
},
ChangePlugState {
plug_change_time: i64,
plugged: bool,
responder: DeviceChangePlugStateResponder,
},
AdjustClockRate {
ppm_from_monotonic: i32,
responder: DeviceAdjustClockRateResponder,
},
}
Expand description
This protocol represents the base functionality of active audio devices. A device is active until this protocol is closed, at which point the device is automatically removed.
Variants§
GetFormat
Returns the format selected by the client, or NO_RING_BUFFER
if the
client has not yet selected a ring buffer format.
Fields
responder: DeviceGetFormatResponder
GetGain
Returns the current gain state for this device.
Fields
responder: DeviceGetGainResponder
GetBuffer
Returns details about the ring buffer. Returns NO_RING_BUFFER
if the
client has not yet created the ring buffer.
Fields
responder: DeviceGetBufferResponder
SetNotificationFrequency
Overrides the position notification frequency for this stream.
This affects the frequency of OnPositionNotify
events only. It does
not affect the frequency of notification events sent through the audio
driver APIs.
GetPosition
Returns the current position (in bytes) within the ring buffer, along
with the time (per MONOTONIC clock) that corresponds with that position.
This can only be called after the ring buffer is established. Returns
NOT_STARTED
if the device has not yet Started streaming.
Fields
responder: DeviceGetPositionResponder
ChangePlugState
Hot-plugs or hot-unplugs an active virtual device, at the specified time.
AdjustClockRate
Immediately change the virtual device’s clock rate, as expressed in the timing and content of position notifications the driver emits. ‘ppm_monotonic’ cannot exceed [-1000,+1000]. Each rate change in rate is standalone; i.e. successive rate changes are not cumulative.
Implementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_get_format(self) -> Option<DeviceGetFormatResponder>
pub fn into_get_gain(self) -> Option<DeviceGetGainResponder>
pub fn into_get_buffer(self) -> Option<DeviceGetBufferResponder>
pub fn into_set_notification_frequency( self, ) -> Option<(u32, DeviceSetNotificationFrequencyResponder)>
pub fn into_get_position(self) -> Option<DeviceGetPositionResponder>
pub fn into_change_plug_state( self, ) -> Option<(i64, bool, DeviceChangePlugStateResponder)>
pub fn into_adjust_clock_rate( self, ) -> Option<(i32, DeviceAdjustClockRateResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL