Skip to main content

ElementProperties

Struct ElementProperties 

Source
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_by_id<'a, T>( &'a self, name: impl AsRef<IdStr>, ) -> 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 get_optional_by_id<'a, T>( &'a self, name: impl AsRef<IdStr>, ) -> 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 value_by_id( &self, name: impl AsRef<IdStr>, ) -> 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>,

👎Deprecated:

use get_by_id() instead

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>,

👎Deprecated:

use get_optional_by_id() instead

Source

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

👎Deprecated:

use value_by_id() instead

Source

pub fn name(&self) -> &GStr

Source

pub fn name_id(&self) -> &IdStr

Source

pub fn name_quark(&self) -> Quark

👎Deprecated:

use name() instead, or name_id() with feature v1_26

Source

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

Source

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

Source

pub fn has_field_by_id(&self, field: impl AsRef<IdStr>) -> bool

Source

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

Source

pub fn has_field_with_type_by_id( &self, field: impl AsRef<IdStr>, type_: Type, ) -> bool

Source

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

👎Deprecated:

use has_field_by_id()

Source

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

👎Deprecated:

use has_field_with_type_by_id()

Source

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

Source

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

Source

pub fn field_ids(&self) -> FieldIdIterator<'_>

Source

pub fn id_iter(&self) -> IdIter<'_>

Source

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

Source

pub fn nth_field_by_id(&self, idx: usize) -> Option<&IdStr>

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<()>,

👎Deprecated:

Use iter() instead, or id_iter() with feature v1_26

Trait Implementations§

Source§

impl Clone for ElementProperties

Source§

fn clone(&self) -> ElementProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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

Source§

type Target = StructureRef

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Eq for ElementProperties

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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>,

Source§

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.