gstreamer_pbutils::element_properties

Struct ElementPropertiesMapItem

Source
pub struct ElementPropertiesMapItem(/* private fields */);
Expand description

Wrapper around gst::Structure for element-properties-map map item.

§Examples

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

Implementations§

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 set(&mut self, name: impl IntoGStr, value: impl Into<Value> + Send)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_with_static( &mut self, name: impl AsRef<GStr> + 'static, value: impl Into<Value> + Send, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_with_id( &mut self, name: impl AsRef<IdStr>, value: impl Into<Value> + Send, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_if( &mut self, name: impl IntoGStr, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_with_static_if( &mut self, name: impl AsRef<GStr> + 'static, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_with_id_if( &mut self, name: impl AsRef<IdStr>, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_if_some( &mut self, name: impl IntoGStr, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_with_static_if_some( &mut self, name: impl AsRef<GStr> + 'static, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_with_id_if_some( &mut self, name: impl AsRef<IdStr>, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_from_iter<V>( &mut self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_with_static_from_iter<V>( &mut self, name: impl AsRef<GStr> + 'static, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_with_id_from_iter<V>( &mut self, name: impl AsRef<IdStr>, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_if_not_empty<V>( &mut self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_with_static_if_not_empty<V>( &mut self, name: impl AsRef<GStr> + 'static, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_with_id_if_not_empty<V>( &mut self, name: impl AsRef<IdStr>, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_value(&mut self, name: impl IntoGStr, value: SendValue)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_with_static( &mut self, name: impl AsRef<GStr> + 'static, value: SendValue, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_with_id(&mut self, name: impl AsRef<IdStr>, value: SendValue)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_if( &mut self, name: impl IntoGStr, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_static_if( &mut self, name: impl AsRef<GStr> + 'static, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_id_if( &mut self, name: impl AsRef<IdStr>, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_if_some( &mut self, name: impl IntoGStr, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_static_if_some( &mut self, name: impl AsRef<GStr> + 'static, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_id_if_some( &mut self, name: impl AsRef<IdStr>, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_by_quark(&mut self, name: Quark, value: impl Into<Value> + Send)

👎Deprecated: use set_by_id() instead
Source

pub fn set_by_quark_if_some( &mut self, name: Quark, value: Option<impl Into<Value> + Send>, )

👎Deprecated: use set_by_id_if_some() instead
Source

pub fn set_value_by_quark(&mut self, name: Quark, value: SendValue)

👎Deprecated: use set_by_id_value() instead
Source

pub fn set_value_by_quark_if_some( &mut self, name: Quark, value: Option<SendValue>, )

👎Deprecated: use set_by_id_value_if_some() 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 set_name(&mut self, name: impl IntoGStr)

Source

pub fn set_name_from_static(&mut self, name: impl AsRef<GStr> + 'static)

Source

pub fn set_name_from_id(&mut self, name: impl AsRef<IdStr>)

Source

pub fn set_name_if_some(&mut self, name: Option<impl IntoGStr>)

Source

pub fn set_name_from_static_if_some( &mut self, name: Option<impl AsRef<GStr> + 'static>, )

Source

pub fn set_name_from_id_if_some(&mut self, name: Option<impl AsRef<IdStr>>)

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 remove_field(&mut self, field: impl IntoGStr)

Source

pub fn remove_fields(&mut self, fields: impl IntoIterator<Item = impl IntoGStr>)

Source

pub fn remove_field_by_id(&mut self, field: impl AsRef<IdStr>)

Source

pub fn remove_field_by_ids( &mut self, fields: impl IntoIterator<Item = impl AsRef<IdStr>>, )

Source

pub fn remove_all_fields(&mut self)

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 fixate(&mut self)

Source

pub fn fixate_field(&mut self, name: impl IntoGStr) -> bool

Source

pub fn fixate_field_bool(&mut self, name: impl IntoGStr, target: bool) -> bool

Source

pub fn fixate_field_str( &mut self, name: impl IntoGStr, target: impl IntoGStr, ) -> bool

Source

pub fn fixate_field_nearest_double( &mut self, name: impl IntoGStr, target: f64, ) -> bool

Source

pub fn fixate_field_nearest_fraction( &mut self, name: impl IntoGStr, target: impl Into<Fraction>, ) -> bool

Source

pub fn fixate_field_nearest_int( &mut self, name: impl IntoGStr, target: i32, ) -> 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
Source

pub fn map_in_place_by_id<F>(&mut self, func: F)
where F: FnMut(&IdStr, &mut Value) -> ControlFlow<()>,

Executes the provided func on each field, possibly modifying the value.

Source

pub fn filter_map_in_place_by_id<F>(&mut self, func: F)
where F: FnMut(&IdStr, Value) -> Option<Value>,

Executes the provided func on each field with an owned value.

  • If func returns Some(value), the field’s value is replaced with value.
  • If func returns None, the field is removed.
Source

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

Executes the provided func on each field, possibly modifying the value, as long as ControlFlow::Continue(()) is returned.

Using Quarks is deprecated, however this method is kept because there are no other means to achieve this pre-GStreamer-1.26. With feature v1_26, use map_in_place_by_id instead.

§Returns:
  • ControlFlow::Continue(()) if func returned this for all fields,
  • ControlFlow::Break(()) otherwise.
Source

pub fn filter_map_in_place<F>(&mut self, func: F)
where F: FnMut(Quark, Value) -> Option<Value>,

Executes the provided func on each field with an owned value.

  • If func returns Some(value), the field’s value is replaced with value.
  • If func returns None, the field is removed.

Using Quarks is deprecated, however this method is kept because there are no other means to achieve this pre-GStreamer-1.26. With feature v1_26, use filter_map_in_place_by_id instead.

Trait Implementations§

Source§

impl Clone for ElementPropertiesMapItem

Source§

fn clone(&self) -> ElementPropertiesMapItem

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 ElementPropertiesMapItem

Source§

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

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

impl Deref for ElementPropertiesMapItem

Source§

type Target = StructureRef

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for ElementPropertiesMapItem

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<ElementPropertiesMapItem> for Structure

Source§

fn from(e: ElementPropertiesMapItem) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ElementPropertiesMapItem

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for ElementPropertiesMapItem

Source§

impl StructuralPartialEq for ElementPropertiesMapItem

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, dst: *mut u8)

🔬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<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.