pub struct CreateDecoderParams {
    pub input_details: Option<FormatDetails>,
    pub promise_separate_access_units_on_input: Option<bool>,
    pub require_can_stream_bytes_input: Option<bool>,
    pub require_can_find_start: Option<bool>,
    pub require_can_re_sync: Option<bool>,
    pub require_report_all_detected_errors: Option<bool>,
    pub require_hw: Option<bool>,
    pub permit_lack_of_split_header_handling: Option<bool>,
    pub secure_output_mode: Option<SecureMemoryMode>,
    pub secure_input_mode: Option<SecureMemoryMode>,
    pub require_sw: Option<bool>,
    /* private fields */
}

Fields§

§input_details: Option<FormatDetails>

Input mime type for a decoder.

The recognized mime types for now: video/h264 video/vp9 audio/aac input_details.oob_bytes must be an AudioSpecificConfig() as defined by AAC spec. audio/sbc input_details.oob_bytes must be Codec Specific Information Elements for SBC as defined by the A2DP spec.

§promise_separate_access_units_on_input: Option<bool>

This must be true in order for the client to be permitted to put a timestamp on an input packet, which is in turn required to get any timestamps on any output packets.

It is always legal to provide separate Access Units (henceforth AUs) to a decoder, but this boolean must be true for a decoder to accept and propagate timestamp values.

This must be true when creating a video encoder, or the CodecFactory channel will close.

If not set, interpreted as false.

§require_can_stream_bytes_input: Option<bool>

Require that the selected codec be capable of accepting input where AUs are not separated into separate packets.

This does not imply that the decoder can find the start of the first AU; for that see require_can_find_start. This does not imply that the decoder can re-sync on its own if the stream data is damaged; for that see require_can_re_sync.

If both promise_separate_access_units_on_input and require_can_stream_bytes_input are true, the CodecFactory channel will close.

If this is false, the client must feed separate AUs on the fuchsia.ui.input. This must be false for a video encoder, and if true the CodecFactory channel will close.

Unless a client demands a decoder capable of taking concatenated AUs (require_can_stream_bytes_input true), the client must feed a decoder separate AUs. This means the client cannot have parts of two separate AUs in the same packet, unless require_can_stream_bytes_input is true.

If not set, interpreted as false.

§require_can_find_start: Option<bool>

A decoder is allowed to be capable of streaming bytes but not capable of searching for the start of the first usable AU. To require both, set both require_can_stream_bytes_input and require_can_find_start. Setting require_can_find_start without require_can_stream_bytes_input is invalid.

With require_can_stream_bytes_input true but require_can_find_start false, the client must start the first packet with the start of an AU, but can send a stream of bytes after that.

If not set, interpreted as false.

§require_can_re_sync: Option<bool>

On problematic input data, all decoders are expected to at least be able to close the channel rather than getting stuck in a failed and/or broken state.

A decoder returned from a request with require_can_re_sync is potentially able to handle damaged input without closing the Codec channel. Such a Codec is encouraged, but not required, to also satisfy requirements of require_report_all_detected_errors.

If not set, interpreted as false.

§require_report_all_detected_errors: Option<bool>

Sometimes a client would rather fail an overall use of a decoder than fail to notice data corruption. For such scenarios, the client can specify require_report_all_detected_errors. For any codec returned from a request with require_report_all_detected_errors set, on detection of any input data corruption the codec will report in one or more of these ways:

  • closing the Codec channel
  • OnStreamFailed()
  • error_detected_before
  • error_detected_during

If false, a codec may silently skip past corrupted input data.

No decoder can detect all corruption, because some corruption can look like valid stream data. This requirement is only to request a codec that is written to attempt to detect and report input stream corruption.

This flag is not intended to be 100% bulletproof. If a client needs robust assurance that all detectable stream corruption is always detected, this flag is not enough of a guarantee to achieve that. Since some stream corruption is inherently non-detectable in any case, such a client should consider using stronger techniques upstream to ensure that corruption can be detected with the needed probability very close to 1.

This flag being true doesn’t imply anything about whether the codec will discard damaged data vs. producing corresponding damaged output. Only that the codec will set error_detected_* bools to true when appropriate.

Regardless of this setting, not all timestamp_ish values provided on input are guaranteed to show up on output.

If not set, interpreted as false.

§require_hw: Option<bool>

If true, require that the returned codec is HW-accelerated. See also require_sw.

If not set, interpreted as false.

§permit_lack_of_split_header_handling: Option<bool>

permit_lack_of_split_header_handling

This field is a temporary field that will be going away.

TODO(dustingreen): Remove this field once we’re down to zero codecs with problems handling split headers.

By default, a Codec instance is required to handle “split headers”, meaning that a client is allowed to deliver parts of an AU one byte at a time, including parts near the beginning of the AU, and the codec is required to tolerate and handle that properly. However, unfortunately not all codecs properly support split headers. If a client is willing to permit such a codec to be used, the client can set this to true. Clients are not encouraged to set this, but setting it may be necessary to find a codec for some formats for now. If a client sets this to true, the client should deliver data of each AU with many contiguous non-split bytes from the start of each AU. The client is not strictly required to deliver one AU at a time, only to ensure that either all the AU bytes are in a single packet or that many bytes at the start of each AU are in a single packet.

The specification for how a client should use this and how a client should behave if setting this to true is intentionally vague, because lack of support for header splitting is not ideal, and is expected to be temporary, and all codecs should handle split headers in the long run. The main intent of this field is to avoid giving an innocent client using default value of false here a codec that can’t properly handle split headers. This is not an attempt at a mechanism to fully work around a codec that doesn’t handle split headers.

If not set, interpreted as false.

§secure_output_mode: Option<SecureMemoryMode>

If set to ON, the decoder must support secure buffers on output, and must reject non-secure buffers on output.

If set to OFF or not set, the created decoder will reject secure buffers on output by closing the StreamProcessor channel.

If secure_input_mode ON, secure_output_mode must also be ON.

§secure_input_mode: Option<SecureMemoryMode>

If set to ON, the decoder must support secure buffers on input and must reject non-secure buffers on input.

If set to OFF or not set, the created decoder will reject secure buffers on input by closing the StreamProcessor channel.

If secure_input_mode ON, secure_output_mode must also be ON.

§require_sw: Option<bool>

If true, require that the returned codec is entirely SW-based, not HW-accelerated (other than possibly using vector CPU instructions). This can be useful for testing purposes or other special scenarios, but is not recommended for performance-sensitive scenarios. Also, some builds may lack a SW-based decoder for some formats. See also require_hw.

If not set, interpreted as false.

Trait Implementations§

source§

impl Clone for CreateDecoderParams

source§

fn clone(&self) -> CreateDecoderParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CreateDecoderParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode<CreateDecoderParams> for CreateDecoderParams

source§

fn new_empty() -> Self

Creates a valid instance of Self. The specific value does not matter, since it will be overwritten by decode.
source§

unsafe fn decode( &mut self, decoder: &mut Decoder<'_>, offset: usize, depth: Depth ) -> Result<()>

Decodes an object of type T from the decoder’s buffers into self. Read more
source§

impl Default for CreateDecoderParams

source§

fn default() -> CreateDecoderParams

Returns the “default value” for a type. Read more
source§

impl Encode<CreateDecoderParams> for &CreateDecoderParams

source§

unsafe fn encode( self, encoder: &mut Encoder<'_>, offset: usize, depth: Depth ) -> Result<()>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl PartialEq for CreateDecoderParams

source§

fn eq(&self, other: &CreateDecoderParams) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TypeMarker for CreateDecoderParams

§

type Owned = CreateDecoderParams

The owned Rust type which this FIDL type decodes into.
source§

fn inline_align(_context: Context) -> usize

Returns the minimum required alignment of the inline portion of the encoded object. It must be a (nonzero) power of two.
source§

fn inline_size(_context: Context) -> usize

Returns the size of the inline portion of the encoded object, including padding for alignment. Must be a multiple of inline_align.
§

fn encode_is_copy() -> bool

Returns true if the memory layout of Self::Owned matches the FIDL wire format and encoding requires no validation. When true, we can optimize encoding arrays and vectors of Self::Owned to a single memcpy. Read more
§

fn decode_is_copy() -> bool

Returns true if the memory layout of Self::Owned matches the FIDL wire format and decoding requires no validation. When true, we can optimize decoding arrays and vectors of Self::Owned to a single memcpy.
source§

impl ValueTypeMarker for CreateDecoderParams

§

type Borrowed<'a> = &'a CreateDecoderParams

The Rust type to use for encoding. This is a particular Encode<Self> type cheaply obtainable from &Self::Owned. There are three cases: Read more
source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

Cheaply converts from &Self::Owned to Self::Borrowed.
source§

impl Persistable for CreateDecoderParams

source§

impl StructuralPartialEq for CreateDecoderParams

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Body for T
where T: Persistable,

§

type MarkerAtTopLevel = T

The marker type to use when the body is at the top-level.
§

type MarkerInResultUnion = T

The marker type to use when the body is nested in a result union.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<E> ErrorType for E
where E: ValueTypeMarker<Owned = E> + Decode<E>,

§

type Marker = E

The marker type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more