class PacketStreamSink
Defined at line 17130 of file fidling/gen/sdk/fidl/fuchsia.hardware.audio/fuchsia.hardware.audio/hlcpp/fuchsia/hardware/audio/cpp/fidl.h
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:
1. **Output (Client -> Driver)**: The Driver implements `PacketStreamSink`. The Client (App)
calls `PutPacket`.
2. **Input (Driver -> Client)**: The Client (App) implements `PacketStreamSink`. The Driver
calls `PutPacket`.
Public Methods
void ~PacketStreamSink ()
void PutPacket (::fuchsia::hardware::audio::PacketStreamSinkPutPacketRequest PacketStreamSinkPutPacketRequest, PutPacketCallback callback)
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_data` is used but `supported_buffer_types` does not include `INLINE`.
* `vmo_transfer` is used but `supported_buffer_types` does not include `CLIENT_OWNED` or
`DRIVER_OWNED`.
* `vmo_id` is unrecognized, or `vmo_offset` + `payload_size` exceeds 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.
void FlushPackets (FlushPacketsCallback callback)
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.
Protected Methods
void handle_unknown_method (uint64_t ordinal, bool method_has_response)
Friends
class PacketStreamSink_Stub