pub struct ElementProperties(/* private fields */);
Expand description

Wrapper around gst::Structure for element-properties property of EncodingProfile.

§Examples

ElementProperties::builder_general()
    .field("threads", 16)
    .build();
ElementProperties::builder_map()
    .item(
        ElementPropertiesMapItem::builder("vp8enc")
            .field("max-quantizer", 17)
            .field("buffer-size", 20000)
            .field("threads", 16)
            .build(),
    )
    .build();

Implementations§

source§

impl ElementProperties

source

pub fn builder_general() -> ElementPropertiesGeneralBuilder

Creates an ElementProperties builder that build into something similar to the following:

[element-properties, boolean-prop=true, string-prop=“hi”]

source

pub fn builder_map() -> ElementPropertiesMapBuilder

Creates an ElementProperties builder that build into something similar to the following:

element-properties-map, map = { [openh264enc, gop-size=32, ], [x264enc, key-int-max=32, tune=zerolatency], }

source

pub fn is_general(&self) -> bool

Returns true if self is built with ElementPropertiesGeneralBuilder.

source

pub fn is_map(&self) -> bool

Returns true if self is built with ElementPropertiesMapBuilder.

source

pub fn map(&self) -> Option<Vec<ElementPropertiesMapItem>>

Returns the inner vec of ElementPropertiesMapItem if self is_map() or None if self is_general().

source

pub fn into_inner(self) -> Structure

Methods from Deref<Target = StructureRef>§

source

pub fn as_ptr(&self) -> *const GstStructure

source

pub fn as_mut_ptr(&self) -> *mut GstStructure

source

pub fn get<'a, T>( &'a self, name: impl IntoGStr, ) -> Result<T, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>
where T: FromValue<'a>,

source

pub fn get_optional<'a, T>( &'a self, name: impl IntoGStr, ) -> Result<Option<T>, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>
where T: FromValue<'a>,

source

pub fn value( &self, name: impl IntoGStr, ) -> Result<&SendValue, GetError<Infallible>>

source

pub fn get_by_quark<'a, T>( &'a self, name: Quark, ) -> Result<T, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>
where T: FromValue<'a>,

source

pub fn get_optional_by_quark<'a, T>( &'a self, name: Quark, ) -> Result<Option<T>, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>
where T: FromValue<'a>,

source

pub fn value_by_quark( &self, name: Quark, ) -> Result<&SendValue, GetError<Infallible>>

source

pub fn name<'a>(&self) -> &'a GStr

source

pub fn name_quark(&self) -> Quark

source

pub fn has_name(&self, name: &str) -> bool

source

pub fn has_field(&self, field: impl IntoGStr) -> bool

source

pub fn has_field_with_type(&self, field: impl IntoGStr, type_: Type) -> bool

source

pub fn has_field_by_quark(&self, field: Quark) -> bool

source

pub fn has_field_with_type_by_quark(&self, field: Quark, type_: Type) -> bool

source

pub fn fields(&self) -> FieldIterator<'_>

source

pub fn iter(&self) -> Iter<'_>

source

pub fn nth_field_name<'a>(&self, idx: usize) -> Option<&'a GStr>

source

pub fn n_fields(&self) -> usize

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn can_intersect(&self, other: &StructureRef) -> bool

source

pub fn intersect(&self, other: &StructureRef) -> Option<Structure>

source

pub fn is_subset(&self, superset: &StructureRef) -> bool

source

pub fn serialize(&self, flags: SerializeFlags) -> GString

source

pub fn serialize_strict( &self, flags: SerializeFlags, ) -> Result<GString, BoolError>

source

pub fn foreach<F>(&self, func: F) -> bool
where F: FnMut(Quark, &Value) -> ControlFlow<()>,

Trait Implementations§

source§

impl Clone for ElementProperties

source§

fn clone(&self) -> ElementProperties

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 ElementProperties

source§

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

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

impl Default for ElementProperties

source§

fn default() -> Self

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

impl Deref for ElementProperties

§

type Target = StructureRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<ElementProperties> for Structure

source§

fn from(e: ElementProperties) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ElementProperties

source§

fn eq(&self, other: &ElementProperties) -> 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 Eq for ElementProperties

source§

impl StructuralPartialEq for ElementProperties

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
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
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.