pub struct PacketStreamSinkProxy { /* private fields */ }Implementations§
Source§impl PacketStreamSinkProxy
impl PacketStreamSinkProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.audio/PacketStreamSink.
Sourcepub fn take_event_stream(&self) -> PacketStreamSinkEventStream
pub fn take_event_stream(&self) -> PacketStreamSinkEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn put_packet(
&self,
payload: PacketStreamSinkPutPacketRequest,
) -> QueryResponseFut<PacketStreamSinkPutPacketResult, DefaultFuchsiaResourceDialect>
pub fn put_packet( &self, payload: PacketStreamSinkPutPacketRequest, ) -> QueryResponseFut<PacketStreamSinkPutPacketResult, DefaultFuchsiaResourceDialect>
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.
Sourcepub fn flush_packets(
&self,
) -> QueryResponseFut<PacketStreamSinkFlushPacketsResult, DefaultFuchsiaResourceDialect>
pub fn flush_packets( &self, ) -> QueryResponseFut<PacketStreamSinkFlushPacketsResult, DefaultFuchsiaResourceDialect>
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.
Trait Implementations§
Source§impl Clone for PacketStreamSinkProxy
impl Clone for PacketStreamSinkProxy
Source§fn clone(&self) -> PacketStreamSinkProxy
fn clone(&self) -> PacketStreamSinkProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PacketStreamSinkProxy
impl Debug for PacketStreamSinkProxy
Source§impl PacketStreamSinkProxyInterface for PacketStreamSinkProxy
impl PacketStreamSinkProxyInterface for PacketStreamSinkProxy
type PutPacketResponseFut = QueryResponseFut<Result<PacketStreamSinkPutPacketResponse, i32>>
type FlushPacketsResponseFut = QueryResponseFut<Result<(), i32>>
fn put_packet( &self, payload: PacketStreamSinkPutPacketRequest, ) -> Self::PutPacketResponseFut
fn flush_packets(&self) -> Self::FlushPacketsResponseFut
Source§impl Proxy for PacketStreamSinkProxy
impl Proxy for PacketStreamSinkProxy
Source§type Protocol = PacketStreamSinkMarker
type Protocol = PacketStreamSinkMarker
Proxy controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
Source§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
PEER_CLOSED signal.