Struct gstreamer::caps::Caps

source ·
pub struct Caps { /* private fields */ }

Implementations§

source§

impl Caps

source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GstCaps) -> &Self

source

pub unsafe fn from_glib_none(ptr: *const GstCaps) -> Self

source

pub unsafe fn from_glib_full(ptr: *const GstCaps) -> Self

source

pub unsafe fn from_glib_borrow(ptr: *const GstCaps) -> Borrowed<Self>

source

pub unsafe fn replace_ptr(&mut self, ptr: *mut GstCaps)

source

pub fn make_mut(&mut self) -> &mut CapsRef

source

pub fn get_mut(&mut self) -> Option<&mut CapsRef>

source

pub fn is_writable(&self) -> bool

source

pub fn upcast(self) -> MiniObject

source§

impl Caps

source

pub fn builder(name: impl IntoGStr) -> Builder<NoFeature>

source

pub fn builder_full() -> BuilderFull<SomeFeatures>

source

pub fn builder_full_with_features( features: CapsFeatures, ) -> BuilderFull<SomeFeatures>

source

pub fn builder_full_with_any_features() -> BuilderFull<AnyFeatures>

source

pub fn new_empty() -> Self

Creates a new Caps that is empty. That is, the returned Caps contains no media formats. The Caps is guaranteed to be writable.

§Returns

the new Caps

source

pub fn new_any() -> Self

Creates a new Caps that indicates that it is compatible with any media format.

§Returns

the new Caps

source

pub fn new_empty_simple(name: impl IntoGStr) -> Self

Creates a new Caps that contains one Structure with name media_type.

§media_type

the media type of the structure

§Returns

the new Caps

source

pub fn fixate(&mut self)

Modifies the given self into a representation with only fixed values. First the caps will be truncated and then the first structure will be fixated with gst_structure_fixate().

This function takes ownership of self and will call gst_caps_make_writable() on it so you must not use self afterwards unless you keep an additional reference to it with gst_caps_ref().

Note that it is not guaranteed that the returned caps have exactly one structure. If self are empty caps then the returned caps will be the empty too and contain no structure at all.

Calling this function with ANY caps is not allowed.

§Returns

the fixated caps

source

pub fn merge(&mut self, other: Self)

Appends the structures contained in caps2 to self if they are not yet expressed by self. The structures in caps2 are not copied – they are transferred to a writable copy of self, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

§caps2

the Caps to merge in

§Returns

the merged caps.

source

pub fn merge_structure(&mut self, structure: Structure)

Appends structure to self if it is not already expressed by self.

§structure

the Structure to merge

§Returns

the merged caps.

source

pub fn merge_structure_full( &mut self, structure: Structure, features: Option<CapsFeatures>, )

Appends structure with features to self if its not already expressed by self.

§structure

the Structure to merge

§features

the CapsFeatures to merge

§Returns

the merged caps.

source

pub fn normalize(&mut self)

Returns a Caps that represents the same set of formats as self, but contains no lists. Each list is expanded into separate Structure.

This function takes ownership of self and will call gst_caps_make_writable() on it so you must not use self afterwards unless you keep an additional reference to it with gst_caps_ref().

§Returns

the normalized Caps

source

pub fn simplify(&mut self)

Converts the given self into a representation that represents the same set of formats, but in a simpler form. Component structures that are identical are merged. Component structures that have values that can be merged are also merged.

This function takes ownership of self and will call gst_caps_make_writable() on it if necessary, so you must not use self afterwards unless you keep an additional reference to it with gst_caps_ref().

This method does not preserve the original order of self.

§Returns

The simplified caps.

source

pub fn truncate(&mut self)

Discards all but the first structure from self. Useful when fixating.

This function takes ownership of self and will call gst_caps_make_writable() on it if necessary, so you must not use self afterwards unless you keep an additional reference to it with gst_caps_ref().

Note that it is not guaranteed that the returned caps have exactly one structure. If self is any or empty caps then the returned caps will be the same and contain no structure at all.

§Returns

truncated caps

Methods from Deref<Target = CapsRef>§

source

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

source

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

source

pub fn copy(&self) -> Caps

source

pub fn upcast_ref(&self) -> &MiniObjectRef

source

pub fn structure(&self, idx: usize) -> Option<&StructureRef>

source

pub fn features(&self, idx: usize) -> Option<&CapsFeaturesRef>

source

pub fn size(&self) -> usize

source

pub fn len(&self) -> usize

source

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

source

pub fn iter_with_features(&self) -> IterFeatures<'_>

source

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

source

pub fn intersect(&self, other: &Self) -> Caps

source

pub fn intersect_with_mode(&self, other: &Self, mode: CapsIntersectMode) -> Caps

source

pub fn is_always_compatible(&self, other: &Self) -> bool

source

pub fn is_any(&self) -> bool

source

pub fn is_empty(&self) -> bool

source

pub fn is_fixed(&self) -> bool

source

pub fn is_equal_fixed(&self, other: &Self) -> bool

source

pub fn is_strictly_equal(&self, other: &Self) -> bool

source

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

source

pub fn is_subset_structure(&self, structure: &StructureRef) -> bool

source

pub fn is_subset_structure_full( &self, structure: &StructureRef, features: Option<&CapsFeaturesRef>, ) -> bool

source

pub fn subtract(&self, other: &Self) -> Caps

source

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

source

pub fn foreach<F: FnMut(&CapsFeaturesRef, &StructureRef) -> ControlFlow<()>>( &self, func: F, ) -> bool

Trait Implementations§

source§

impl AsRef<CapsRef> for Caps

source§

fn as_ref(&self) -> &CapsRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<CapsRef> for Caps

source§

fn borrow(&self) -> &CapsRef

Immutably borrows from an owned value. Read more
source§

impl Clone for Caps

source§

fn clone(&self) -> Self

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 Caps

source§

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

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

impl Deref for Caps

§

type Target = CapsRef

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'de> Deserialize<'de> for Caps

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Caps

source§

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

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

impl Drop for Caps

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Extend<Caps> for CapsRef

source§

fn extend<T: IntoIterator<Item = Caps>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<const N: usize> From<[(Structure, CapsFeatures); N]> for Caps

source§

fn from(v: [(Structure, CapsFeatures); N]) -> Caps

Converts to this type from the input type.
source§

impl<const N: usize> From<[(Structure, Option<CapsFeatures>); N]> for Caps

source§

fn from(v: [(Structure, Option<CapsFeatures>); N]) -> Caps

Converts to this type from the input type.
source§

impl<const N: usize> From<[Structure; N]> for Caps

source§

fn from(v: [Structure; N]) -> Caps

Converts to this type from the input type.
source§

impl From<(Structure, CapsFeatures)> for Caps

source§

fn from(v: (Structure, CapsFeatures)) -> Caps

Converts to this type from the input type.
source§

impl From<Caps> for Value

source§

fn from(v: Caps) -> Value

Converts to this type from the input type.
source§

impl From<Structure> for Caps

source§

fn from(v: Structure) -> Caps

Converts to this type from the input type.
source§

impl FromGlibContainerAsVec<*mut GstCaps, *const *mut GstCaps> for Caps

source§

impl FromGlibContainerAsVec<*mut GstCaps, *mut *mut GstCaps> for Caps

source§

impl FromGlibPtrArrayContainerAsVec<*mut GstCaps, *const *mut GstCaps> for Caps

source§

impl FromGlibPtrArrayContainerAsVec<*mut GstCaps, *mut *mut GstCaps> for Caps

source§

impl FromGlibPtrBorrow<*const GstCaps> for Caps

source§

impl FromGlibPtrBorrow<*mut GstCaps> for Caps

source§

impl FromGlibPtrFull<*const GstCaps> for Caps

source§

unsafe fn from_glib_full(ptr: *const GstCaps) -> Self

Safety Read more
source§

impl FromGlibPtrFull<*mut GstCaps> for Caps

source§

unsafe fn from_glib_full(ptr: *mut GstCaps) -> Self

Safety Read more
source§

impl FromGlibPtrNone<*const GstCaps> for Caps

source§

unsafe fn from_glib_none(ptr: *const GstCaps) -> Self

Safety Read more
source§

impl FromGlibPtrNone<*mut GstCaps> for Caps

source§

unsafe fn from_glib_none(ptr: *mut GstCaps) -> Self

Safety Read more
source§

impl FromIterator<(Structure, CapsFeatures)> for Caps

source§

fn from_iter<T: IntoIterator<Item = (Structure, CapsFeatures)>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<(Structure, Option<CapsFeatures>)> for Caps

source§

fn from_iter<T: IntoIterator<Item = (Structure, Option<CapsFeatures>)>>( iter: T, ) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<Caps> for Caps

source§

fn from_iter<T: IntoIterator<Item = Caps>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<Structure> for Caps

source§

fn from_iter<T: IntoIterator<Item = Structure>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromStr for Caps

§

type Err = BoolError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<'a> FromValue<'a> for &'a Caps

§

type Checker = GenericValueTypeOrNoneChecker<&'a Caps>

Value type checker.
source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
source§

impl<'a> FromValue<'a> for Caps

§

type Checker = GenericValueTypeOrNoneChecker<Caps>

Value type checker.
source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
source§

impl GlibPtrDefault for Caps

source§

impl HasParamSpec for Caps

§

type ParamSpec = ParamSpecBoxed

§

type SetValue = Caps

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, Caps>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl IntoGlibPtr<*mut GstCaps> for Caps

source§

unsafe fn into_glib_ptr(self) -> *mut GstCaps

Transfer: full.
source§

impl IsMiniObject for Caps

source§

impl PartialEq<Caps> for CapsRef

source§

fn eq(&self, other: &Caps) -> 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 PartialEq<CapsRef> for Caps

source§

fn eq(&self, other: &CapsRef) -> 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 PartialEq for Caps

source§

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

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl StaticType for Caps

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl<'a> ToGlibContainerFromSlice<'a, *const *mut GstCaps> for Caps

source§

impl<'a> ToGlibContainerFromSlice<'a, *mut *mut GstCaps> for Caps

source§

impl<'a> ToGlibPtr<'a, *const GstCaps> for Caps

§

type Storage = PhantomData<&'a Caps>

source§

fn to_glib_none(&'a self) -> Stash<'a, *const GstCaps, Self>

Transfer: none. Read more
source§

fn to_glib_full(&self) -> *const GstCaps

Transfer: full. Read more
source§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container. Read more
source§

impl<'a> ToGlibPtr<'a, *mut GstCaps> for Caps

§

type Storage = PhantomData<&'a Caps>

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut GstCaps, Self>

Transfer: none. Read more
source§

fn to_glib_full(&self) -> *mut GstCaps

Transfer: full. Read more
source§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container. Read more
source§

impl<'a> ToGlibPtrMut<'a, *mut GstCaps> for Caps

§

type Storage = PhantomData<&'a mut Caps>

source§

fn to_glib_none_mut(&'a mut self) -> StashMut<'_, *mut GstCaps, Self>

Transfer: none. Read more
source§

impl ToValue for Caps

source§

fn to_value(&self) -> Value

Convert a value to a Value.
source§

fn value_type(&self) -> Type

Returns the type identifier of self. Read more
source§

impl ToValueOptional for Caps

source§

fn to_value_optional(s: Option<&Self>) -> Value

Convert an Option to a Value.
source§

impl ValueType for Caps

§

type Type = Caps

Type to get the Type from. Read more
source§

impl Eq for Caps

source§

impl Send for Caps

source§

impl Sync for Caps

source§

impl TransparentPtrType for Caps

source§

impl ValueTypeOptional for Caps

Auto Trait Implementations§

§

impl Freeze for Caps

§

impl RefUnwindSafe for Caps

§

impl Unpin for Caps

§

impl UnwindSafe for Caps

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> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

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> IntoClosureReturnValue for T
where T: Into<Value>,

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> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
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> ToSendValue for T
where T: Send + ToValue + ?Sized,

source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TransparentType for T

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,