class Packet

Defined at line 9287 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

A Packet represents a chunk of input or output data to or from a stream

processor.

stream processor output:

While the Packet is outstanding with the client via OnOutputPacket(), the

stream processor will avoid modifying the referenced output data. After the

client calls RecycleOutputPacket(packet_index), the stream processor is

notified that the client is again ok with the referenced data changing.

stream processor input:

The client initially has all packet_index(es) available to fill, and later

gets packet_index(s) that are again ready to fill via OnFreeInputPacket().

The client must not modify the referenced data in between QueueInputPacket()

and OnFreeInputPacket().

Public Members

static const fidl_type_t * FidlType

Public Methods

bool IsEmpty ()

Returns whether no field is set.

Packet & set_header (::fuchsia::media::PacketHeader _value)
Packet & set_buffer_index (uint32_t _value)
Packet & set_stream_lifetime_ordinal (uint64_t _value)
Packet & set_start_offset (uint32_t _value)
Packet & set_valid_length_bytes (uint32_t _value)
Packet & set_timestamp_ish (uint64_t _value)
Packet & set_start_access_unit (bool _value)
Packet & set_known_end_access_unit (bool _value)
Packet & set_key_frame (bool _value)
void Packet ()
void Packet (Packet && other)
void ~Packet ()
Packet & operator= (Packet && other)
::std::unique_ptr<Packet> New ()
void Encode (::fidl::Encoder * _encoder, size_t _offset, std::optional< ::fidl::HandleInformation> maybe_handle_info)
void Decode (::fidl::Decoder * _decoder, Packet * _value, size_t _offset)
zx_status_t Clone (Packet * _result)
const ::fuchsia::media::PacketHeader & header ()

Defined at line 9293 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_header ()

Defined at line 9297 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

::fuchsia::media::PacketHeader * mutable_header ()

Defined at line 9301 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_header ()

Defined at line 9309 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const uint32_t & buffer_index ()

Which buffer this packet refers to. For single-buffer mode this will

always be 0, but for multi-buffer mode, a given in-flight interval of a

packet can refer to any buffer. The packet has an associated buffer only

while the packet is in-flight, not while the packet is free.

The default value makes accidental inappropriate use of index 0 less

likely (will tend to complain in an obvious way if not filled out

instead of a non-obvious data corruption when decoding buffer 0

repeatedly instead of the correct buffers).

TODO(dustingreen): Try to make FIDL table defaults have meaning, and not

complain about !has when accessing the field. For now the default

specified here does nothing.

Defined at line 9330 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_buffer_index ()

Defined at line 9334 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

uint32_t * mutable_buffer_index ()

Which buffer this packet refers to. For single-buffer mode this will

always be 0, but for multi-buffer mode, a given in-flight interval of a

packet can refer to any buffer. The packet has an associated buffer only

while the packet is in-flight, not while the packet is free.

The default value makes accidental inappropriate use of index 0 less

likely (will tend to complain in an obvious way if not filled out

instead of a non-obvious data corruption when decoding buffer 0

repeatedly instead of the correct buffers).

TODO(dustingreen): Try to make FIDL table defaults have meaning, and not

complain about !has when accessing the field. For now the default

specified here does nothing.

Defined at line 9351 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_buffer_index ()

Defined at line 9359 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const uint64_t & stream_lifetime_ordinal ()

The value 1 is the lowest permitted value after stream processor

creation. Values sent by the client must be odd. Values must only

increase.

A stream_lifetime_ordinal represents the lifetime of a stream. All

messages that are specific to a stream have the stream_lifetime_ordinal

value and the value is the same for all messages relating to a given

stream.

Defined at line 9375 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_stream_lifetime_ordinal ()

Defined at line 9379 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

uint64_t * mutable_stream_lifetime_ordinal ()

The value 1 is the lowest permitted value after stream processor

creation. Values sent by the client must be odd. Values must only

increase.

A stream_lifetime_ordinal represents the lifetime of a stream. All

messages that are specific to a stream have the stream_lifetime_ordinal

value and the value is the same for all messages relating to a given

stream.

Defined at line 9391 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_stream_lifetime_ordinal ()

Defined at line 9399 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const uint32_t & start_offset ()

Which part of the relevant buffer is this packet using. These are valid

for input data that's in-flight to the stream processor, and are valid

for output data from the stream processor.

For compressed formats and uncompressed audio, the data in

[start_offset, start_offset + valid_length_bytes) is the contiguously

valid data referred to by this packet.

For uncompressed video frames, FormatDetails is the primary means of

determining which bytes are relevant. The offsets in FormatDetails

are relative to the start_offset here. The valid_length_bytes must be

large enough to include the full last line of pixel data, including the

full line stride of the last line (not just the width in pixels of the

last line).

Despite these being filled out, some uncompressed video buffers are of

types that are not readable by the CPU. These fields being here don't

imply there's any way for the CPU to read an uncompressed frame.

Defined at line 9425 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_start_offset ()

Defined at line 9429 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

uint32_t * mutable_start_offset ()

Which part of the relevant buffer is this packet using. These are valid

for input data that's in-flight to the stream processor, and are valid

for output data from the stream processor.

For compressed formats and uncompressed audio, the data in

[start_offset, start_offset + valid_length_bytes) is the contiguously

valid data referred to by this packet.

For uncompressed video frames, FormatDetails is the primary means of

determining which bytes are relevant. The offsets in FormatDetails

are relative to the start_offset here. The valid_length_bytes must be

large enough to include the full last line of pixel data, including the

full line stride of the last line (not just the width in pixels of the

last line).

Despite these being filled out, some uncompressed video buffers are of

types that are not readable by the CPU. These fields being here don't

imply there's any way for the CPU to read an uncompressed frame.

Defined at line 9451 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_start_offset ()

Defined at line 9459 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const uint32_t & valid_length_bytes ()

This must be > 0.

The semantics for valid data per packet vary depending on data type as

follows.

uncompressed video - A video frame can't be split across packets. Each

packet is one video frame.

uncompressed audio - Regardless of float or int, linear or uLaw, or

number of channels, a packet must contain an non-negative number of

complete audio frames, where a single audio frame consists of data for

all the channels for the same single point in time. Any

stream-processor-specific internal details re. lower rate sampling for

LFE channel or the like should be hidden by the StreamProcessor server

implementation.

compressed data input - A packet must contain at least one byte of data.

See also stream_input_bytes_min. Splitting AUs at arbitrary byte

boundaries is permitted, including at boundaries that are in AU headers.

compressed data output - The stream processor is not required to fully

fill each output packet's buffer.

Defined at line 9489 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_valid_length_bytes ()

Defined at line 9493 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

uint32_t * mutable_valid_length_bytes ()

This must be > 0.

The semantics for valid data per packet vary depending on data type as

follows.

uncompressed video - A video frame can't be split across packets. Each

packet is one video frame.

uncompressed audio - Regardless of float or int, linear or uLaw, or

number of channels, a packet must contain an non-negative number of

complete audio frames, where a single audio frame consists of data for

all the channels for the same single point in time. Any

stream-processor-specific internal details re. lower rate sampling for

LFE channel or the like should be hidden by the StreamProcessor server

implementation.

compressed data input - A packet must contain at least one byte of data.

See also stream_input_bytes_min. Splitting AUs at arbitrary byte

boundaries is permitted, including at boundaries that are in AU headers.

compressed data output - The stream processor is not required to fully

fill each output packet's buffer.

Defined at line 9519 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_valid_length_bytes ()

Defined at line 9527 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const uint64_t & timestamp_ish ()

This value is not strictly speaking a timestamp. It is an arbitrary

unsigned 64-bit number that, under some circumstances, will be passed by

a stream processor unmodified from an input packet to the

exactly-corresponding output packet.

For timestamp_ish values to be propagated from input to output the

following conditions must be true:

* promise_separate_access_units_on_input must be true

* has_timestamp_ish must be true for a given input packet, to have that

timestamp_ish value (potentially) propagate through to an output

* the StreamProcessor instance itself decides (async) that the input

packet generates an output packet - if a given input never generates

an output packet then the timestamp_ish value on the input will never

show up on any output packet - depending on the characteristics of the

input and output formats, and whether a decoder is willing to join

mid-stream, etc this can be more or less likely to occur, but clients

should be written to accommodate timestamp_ish values that are fed on

input but never show up on output, at least to a reasonable degree

(not crashing, not treating as an error).

Defined at line 9554 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_timestamp_ish ()

Defined at line 9558 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

uint64_t * mutable_timestamp_ish ()

This value is not strictly speaking a timestamp. It is an arbitrary

unsigned 64-bit number that, under some circumstances, will be passed by

a stream processor unmodified from an input packet to the

exactly-corresponding output packet.

For timestamp_ish values to be propagated from input to output the

following conditions must be true:

* promise_separate_access_units_on_input must be true

* has_timestamp_ish must be true for a given input packet, to have that

timestamp_ish value (potentially) propagate through to an output

* the StreamProcessor instance itself decides (async) that the input

packet generates an output packet - if a given input never generates

an output packet then the timestamp_ish value on the input will never

show up on any output packet - depending on the characteristics of the

input and output formats, and whether a decoder is willing to join

mid-stream, etc this can be more or less likely to occur, but clients

should be written to accommodate timestamp_ish values that are fed on

input but never show up on output, at least to a reasonable degree

(not crashing, not treating as an error).

Defined at line 9581 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_timestamp_ish ()

Defined at line 9589 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const bool & start_access_unit ()

If promise_separate_access_units_on_input (TODO(dustingreen): or any

similar mode for output) is true, this bool must be set appropriately

depending on whether byte 0 _is_ or _is not_ the start of an access

unit. The client is required to know, and required to set this boolean

properly. The server is allowed to infer that when this boolean is

false, byte 0 is the first byte of a continuation of a

previously-started AU. (The byte at start_offset is "byte 0".)

If promise_separate_access_units_on_input is false, this boolean is

ignored.

Defined at line 9607 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_start_access_unit ()

Defined at line 9611 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool * mutable_start_access_unit ()

If promise_separate_access_units_on_input (TODO(dustingreen): or any

similar mode for output) is true, this bool must be set appropriately

depending on whether byte 0 _is_ or _is not_ the start of an access

unit. The client is required to know, and required to set this boolean

properly. The server is allowed to infer that when this boolean is

false, byte 0 is the first byte of a continuation of a

previously-started AU. (The byte at start_offset is "byte 0".)

If promise_separate_access_units_on_input is false, this boolean is

ignored.

Defined at line 9625 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_start_access_unit ()

Defined at line 9633 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const bool & known_end_access_unit ()

A client is never required to set this boolean to true.

If promise_separate_access_units_on_input is true, for input data, this

boolean must be false if the last byte of this packet is not the last

byte of an AU, and this boolean _may_ be true if the last byte of this

packet is the last byte of an AU. A client delivering one AU at a time

that's interested in the lowest possible latency via the decoder should

set this boolean to true when it can be set to true.

If promise_separate_access_units_on_input is false, this boolean is

ignored.

Defined at line 9652 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_known_end_access_unit ()

Defined at line 9656 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool * mutable_known_end_access_unit ()

A client is never required to set this boolean to true.

If promise_separate_access_units_on_input is true, for input data, this

boolean must be false if the last byte of this packet is not the last

byte of an AU, and this boolean _may_ be true if the last byte of this

packet is the last byte of an AU. A client delivering one AU at a time

that's interested in the lowest possible latency via the decoder should

set this boolean to true when it can be set to true.

If promise_separate_access_units_on_input is false, this boolean is

ignored.

Defined at line 9671 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_known_end_access_unit ()

Defined at line 9679 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

const bool & key_frame ()

Used for compressed video packets. If not present should be assumed to

be unknown. If false, indicates the packet is not part of a key frame. If

true, indicates the packet is part of a key frame.

Defined at line 9690 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool has_key_frame ()

Defined at line 9694 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

bool * mutable_key_frame ()

Used for compressed video packets. If not present should be assumed to

be unknown. If false, indicates the packet is not part of a key frame. If

true, indicates the packet is part of a key frame.

Defined at line 9701 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h

void clear_key_frame ()

Defined at line 9709 of file fidling/gen/sdk/fidl/fuchsia.media/fuchsia.media/hlcpp/fuchsia/media/cpp/fidl.h