class Packet
Defined at line 26 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.h
Intermediate representation of a fuchsia.audio.Packet.
Public Methods
void Packet (std::shared_ptr<MemoryMappedBuffer> buffer, fuchsia_media2::wire::PayloadRange payload_range, void * payload)
Packets have the following properties:
* `buffer` is the VMO which contains this packet.
* `payload_range` contains the offset and size of the packet within `buffer`.
* `payload` is a pointer to the start of the packet within `buffer`.
Defined at line 9 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc
void Recycle (StreamConverter stream_converter, std::optional<int64_t> timestamp)
Recycles this packet for reuse. After recycling, the packet's write pointer is reset to the
start of the payload range, the timestamp is reset (as described below), and all further
calls to Append* and FramesRemaining will interpret source data using `stream_converter`.
`timestamp` is the media timestamp of the first frame in the packet. This is either an
explicit int64_t value or the special value `std::nullopt`, which means "continuous with the
prior packet".
Defined at line 17 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc
int64_t AppendData (int64_t frame_count, const void * data)
Appends data to this packet, advancing the packet's write pointer by up to `frame_count`.
Returns the number of frames appended, or zero if full.
REQUIRED: Must call Recycle at least once before appending any data.
Defined at line 24 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc
int64_t AppendSilence (int64_t frame_count)
Defined at line 36 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc
int64_t FramesRemaining ()
Reports the number of frames that can be appended to this packet.
REQUIRED: Must call Recycle at least once before calling this method.
Defined at line 47 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc
fuchsia_audio::wire::Packet ToFidl (fidl::AnyArena & arena)
Conversion to a FIDL object that can be passed to PutPacket.
Defined at line 51 of file ../../src/media/audio/services/mixer/mix/stream_sink_consumer_writer.cc