template <>
class WireSyncBufferClientImpl
Defined at line 3042 of file fidling/gen/sdk/fidl/fuchsia.hardware.audio/fuchsia.hardware.audio/cpp/fidl/fuchsia.hardware.audio/cpp/wire_messaging.h
Public Methods
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::GetProperties> GetProperties ()
Accessor for top level static properties.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::AllocateVmos> AllocateVmos (::fuchsia_hardware_audio::wire::AllocateVmosConfig AllocateVmosConfig)
Request the driver to allocate VMOs for data transfer.
Returns the allocated VMOs and their assigned IDs.
The returned VMO handle must include ZX_RIGHT_TRANSFER, ZX_RIGHT_READ and ZX_RIGHT_MAP.
If the packet stream is an output stream, then the handle must also include
ZX_RIGHT_WRITE.
Returns `ZX_ERR_INVALID_ARGS` if `min_vmo_size` is zero or `vmo_count` is zero.
Returns `ZX_ERR_NO_MEMORY` if the driver cannot allocate the requested VMOs.
Returns `ZX_ERR_BAD_STATE` if VMOs are already allocated or registered, or if the
stream is already started. Call `DeallocateVmos` or `UnregisterVmos` first to
reconfigure.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::DeallocateVmos> DeallocateVmos ()
Releases all VMOs previously allocated via `AllocateVmos`.
This also occurs automatically when the `PacketStreamControl` channel is closed.
Returns `ZX_ERR_BAD_STATE` if VMOs are not currently allocated, or if the stream is
not stopped.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::RegisterVmos> RegisterVmos (::fuchsia_hardware_audio::wire::RegisterVmosConfig RegisterVmosConfig)
Registers client-allocated VMOs with the driver.
The registered VMO handle must include ZX_RIGHT_TRANSFER, ZX_RIGHT_READ and ZX_RIGHT_MAP.
If the packet stream is an input stream, then the handle must also include
ZX_RIGHT_WRITE.
Returns `ZX_ERR_INVALID_ARGS` if `vmo_infos` is empty, or if any VMO handle is invalid,
or if duplicate `vmo_id`s are found.
Returns `ZX_ERR_ACCESS_DENIED` if any VMO does not have the required rights.
Returns `ZX_ERR_BAD_STATE` if VMOs are already registered or allocated, or if the
stream is already started. Call `UnregisterVmos` or `DeallocateVmos` first to
reconfigure.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::UnregisterVmos> UnregisterVmos ()
Unregisters all VMOs previously registered via `RegisterVmos`.
This also occurs automatically when the `PacketStreamControl` channel is closed.
Returns `ZX_ERR_BAD_STATE` if VMOs are not currently registered, or if the stream is
not stopped.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::GetPacketStreamSink> GetPacketStreamSink ()
Connects to the data sink implemented by the driver.
This is used for audio **Output** where the driver consumes data.
Flow:
1. App writes audio data to a registered VMO.
2. App flushes the cache for the written region (if `needs_cache_flush_or_invalidate` is
true).
3. App calls `PacketStreamSink.PutPacket` with the location of the data.
4. Driver consumes the data.
If this method is called multiple times, the previous `PacketStreamSink` channel is closed,
and any pending requests on that channel are discarded. The new channel replaces the old
one.
Returns `ZX_ERR_NOT_SUPPORTED` if the stream is an input stream, or if the driver does
not support this method.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::SetPacketStreamSink> SetPacketStreamSink (::fuchsia_hardware_audio::wire::PacketStreamControlSetPacketStreamSinkRequest PacketStreamControlSetPacketStreamSinkRequest)
Provides a data sink to the driver.
This is used for audio **Input** where the driver produces data.
Flow:
1. Driver writes audio data to a registered VMO.
2. Driver calls `PacketStreamSink.PutPacket` with the location of the data.
3. App receives `PutPacket`.
4. App invalidates the cache for the region (if `needs_cache_flush_or_invalidate` is
true).
5. App reads the data.
If this method is called multiple times, the driver closes the previous `PacketStreamSink`
channel. The new channel replaces the old one.
Returns `ZX_ERR_NOT_SUPPORTED` if the stream is an output stream, or if the driver does
not support this method.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::Start> Start ()
Start the packet-stream.
Returns `ZX_ERR_BAD_STATE` if:
* Buffers have not been allocated (if `DRIVER_OWNED` was specified)
and/or registered (if `CLIENT_OWNED` was specified). This is not applicable if
`INLINE` is supported.
* The stream is already started.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.
::fidl::WireUnownedResult< ::fuchsia_hardware_audio::PacketStreamControl::Stop> Stop ()
Stop the packet-stream.
Once the response is received, the stream is halted.
Behavior depends on the stream direction:
* **Output**: The driver stops consuming packets. Any pending `PacketStreamSink.PutPacket`
requests will remain pending until `Start` is called again. Clients may call
`PacketStreamSink.FlushPackets` after `Stop` to discard these pending packets.
* **Input**: The driver stops producing packets. No further `PacketStreamSink.PutPacket`
calls will be made by the driver until `Start` is called again.
Note that since `PacketStreamSink` uses a separate channel, there is no strict ordering
guarantee between `Stop` and `PacketStreamSink.PutPacket`:
* For **Output**, some in-flight `PacketStreamSink.PutPacket` calls may
complete successfully after `Stop` has returned.
* For **Input**, some in-flight `PacketStreamSink.PutPacket` calls may
arrive at the client after `Stop` has returned.
Returns `ZX_ERR_BAD_STATE` if the stream is not started.
Caller provides the backing storage for FIDL message via an argument to `.buffer()`.