pub enum PacketStreamSinkRequest {
PutPacket {
payload: PacketStreamSinkPutPacketRequest,
responder: PacketStreamSinkPutPacketResponder,
},
FlushPackets {
responder: PacketStreamSinkFlushPacketsResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: PacketStreamSinkControlHandle,
method_type: MethodType,
},
}Expand description
The protocol for streaming packet-based audio data. This protocol functions as a data sink. The “server” of this protocol consumes packets, and the “client” produces packets.
This protocol can be used in two directions:
- Output (Client -> Driver): The Driver implements
PacketStreamSink. The Client (App) callsPutPacket. - Input (Driver -> Client): The Client (App) implements
PacketStreamSink. The Driver callsPutPacket.
Variants§
PutPacket
Submits a packet to be processed by the server.
The client may queue multiple packets by calling PutPacket repeatedly.
Packets are processed in the order they were submitted. This call
blocks until the payload is processed. When this call returns, the
buffer region is guaranteed to be available for reuse.
Returns ZX_ERR_BAD_STATE if the stream is not started or configured.
Returns ZX_ERR_CANCELED if FlushPackets was called.
Returns ZX_ERR_INVALID_ARGS if the packet is invalid. This includes:
- The payload is missing.
inline_datais used butsupported_buffer_typesdoes not includeINLINE.vmo_transferis used butsupported_buffer_typesdoes not includeCLIENT_OWNEDorDRIVER_OWNED.vmo_idis unrecognized, orvmo_offset+payload_sizeexceeds the VMO size.
Note: The server is not required to detect if a VMO region is currently in use by a previous pending packet. Clients are responsible for managing buffer usage.
FlushPackets
Flushes all packets currently pending without processing them. This call waits until all pending packets are completed or canceled.
Note: A packet may be partially processed (e.g. if it contains multiple audio frames, or if the data does not align with encoded frame boundaries) before it is canceled.
Fields
responder: PacketStreamSinkFlushPacketsResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: PacketStreamSinkControlHandlemethod_type: MethodTypeImplementations§
Source§impl PacketStreamSinkRequest
impl PacketStreamSinkRequest
pub fn into_put_packet( self, ) -> Option<(PacketStreamSinkPutPacketRequest, PacketStreamSinkPutPacketResponder)>
pub fn into_flush_packets(self) -> Option<PacketStreamSinkFlushPacketsResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL