pub struct RingBufferProperties {
pub needs_cache_flush_or_invalidate: Option<bool>,
pub turn_on_delay: Option<i64>,
pub driver_transfer_bytes: Option<u32>,
/* private fields */
}
Expand description
Properties of the ring buffer. These values don’t change once the ring buffer is created.
Fields§
§needs_cache_flush_or_invalidate: Option<bool>
When set to true, indicates that the ring buffer runs in a different cache coherency domain, and thus clients must ensure that their data writes are flushed all the way to main memory (during playback), or that their view of the ring buffer must be invalidated before any reads (during capture). This is because there may be hardware external to the CPUs that reads/writes main memory, bypassing the CPUs.
When set to false, indicates that the ring buffer runs in the same cache coherency domain as the CPUs, hence the driver is not required to flush/invalidate the ring buffer. Note that in this case, the driver and client still must synchronize their data access, for instance by inserting the appropriate acquire fences before reading and releasing fences after writing, or (more commonly) by obeying the Producer/Consumer pattern described in Ring Buffer Behavior.
Required.
turn_on_delay: Option<i64>
The driver’s best estimate of the time needed for the hardware to emit (during playback) or
accept (during capture) frames, after a channel is activated by SetActiveChannels
.
The driver estimates that after SetActiveChannels(channel)->(set_time)
enables a channel,
its data will resume flowing at approximately set_time
+ turn_on_delay
.
Hardware can take time to become fully operational (e.g. due to a power state change, or
communication delays between a Bluetooth driver’s multiple hardware entities). The client
must take this delay into account, if it is unacceptable to drop the actual audio frames
and instead play/capture silence during this interval.
If not included, turn_on_delay
is unknown.
Optional.
driver_transfer_bytes: Option<u32>
Size (in bytes) of the temporary buffers or FIFOs used by the driver when consuming or generating the ring buffer contents.
The driver_transfer_bytes
field is covered extensively in
Ring Buffer Behavior.
driver_transfer_bytes
must not include the impact of delays caused by hardware or software
processing abstracted by the driver. Those delays are communicated by internal_delay
and
external_delay
fields in DelayInfo
; they are orthogonal to this value.
Required.
Trait Implementations§
Source§impl Clone for RingBufferProperties
impl Clone for RingBufferProperties
Source§fn clone(&self) -> RingBufferProperties
fn clone(&self) -> RingBufferProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RingBufferProperties
impl Debug for RingBufferProperties
Source§impl<D> Decode<RingBufferProperties, D> for RingBufferPropertieswhere
D: ResourceDialect,
impl<D> Decode<RingBufferProperties, D> for RingBufferPropertieswhere
D: ResourceDialect,
Source§fn new_empty() -> RingBufferProperties
fn new_empty() -> RingBufferProperties
Self
. The specific value does not matter,
since it will be overwritten by decode
.Source§impl Default for RingBufferProperties
impl Default for RingBufferProperties
Source§fn default() -> RingBufferProperties
fn default() -> RingBufferProperties
Source§impl<D> Encode<RingBufferProperties, D> for &RingBufferPropertieswhere
D: ResourceDialect,
impl<D> Encode<RingBufferProperties, D> for &RingBufferPropertieswhere
D: ResourceDialect,
Source§impl PartialEq for RingBufferProperties
impl PartialEq for RingBufferProperties
Source§impl TypeMarker for RingBufferProperties
impl TypeMarker for RingBufferProperties
Source§type Owned = RingBufferProperties
type Owned = RingBufferProperties
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for RingBufferProperties
impl ValueTypeMarker for RingBufferProperties
Source§type Borrowed<'a> = &'a RingBufferProperties
type Borrowed<'a> = &'a RingBufferProperties
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreSource§fn borrow(
value: &<RingBufferProperties as TypeMarker>::Owned,
) -> <RingBufferProperties as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<RingBufferProperties as TypeMarker>::Owned, ) -> <RingBufferProperties as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.