pub struct Caps { /* private fields */ }
Implementations§
source§impl Caps
impl Caps
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GstCaps) -> &Self
pub unsafe fn from_glib_none(ptr: *const GstCaps) -> Self
pub unsafe fn from_glib_full(ptr: *const GstCaps) -> Self
pub unsafe fn from_glib_borrow(ptr: *const GstCaps) -> Borrowed<Self>
pub unsafe fn replace_ptr(&mut self, ptr: *mut GstCaps)
pub fn make_mut(&mut self) -> &mut CapsRef
pub fn get_mut(&mut self) -> Option<&mut CapsRef>
pub fn is_writable(&self) -> bool
pub fn upcast(self) -> MiniObject
source§impl Caps
impl Caps
pub fn builder(name: impl IntoGStr) -> Builder<NoFeature>
pub fn builder_full() -> BuilderFull<SomeFeatures>
pub fn builder_full_with_features( features: CapsFeatures, ) -> BuilderFull<SomeFeatures>
pub fn builder_full_with_any_features() -> BuilderFull<AnyFeatures>
sourcepub fn new_empty_simple(name: impl IntoGStr) -> Self
pub fn new_empty_simple(name: impl IntoGStr) -> Self
sourcepub fn fixate(&mut self)
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
sourcepub fn merge(&mut self, other: Self)
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.
sourcepub fn merge_structure(&mut self, structure: Structure)
pub fn merge_structure(&mut self, structure: Structure)
sourcepub fn merge_structure_full(
&mut self,
structure: Structure,
features: Option<CapsFeatures>,
)
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.
sourcepub fn normalize(&mut self)
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
sourcepub fn simplify(&mut self)
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.
sourcepub fn truncate(&mut self)
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>§
pub fn as_ptr(&self) -> *const GstCaps
pub fn as_mut_ptr(&self) -> *mut GstCaps
pub fn copy(&self) -> Caps
pub fn upcast_ref(&self) -> &MiniObjectRef
pub fn structure(&self, idx: usize) -> Option<&StructureRef>
pub fn features(&self, idx: usize) -> Option<&CapsFeaturesRef>
pub fn size(&self) -> usize
pub fn len(&self) -> usize
pub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter_with_features(&self) -> IterFeatures<'_> ⓘ
pub fn can_intersect(&self, other: &Self) -> bool
pub fn intersect(&self, other: &Self) -> Caps
pub fn intersect_with_mode(&self, other: &Self, mode: CapsIntersectMode) -> Caps
pub fn is_always_compatible(&self, other: &Self) -> bool
pub fn is_any(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_fixed(&self) -> bool
pub fn is_equal_fixed(&self, other: &Self) -> bool
pub fn is_strictly_equal(&self, other: &Self) -> bool
pub fn is_subset(&self, superset: &Self) -> bool
pub fn is_subset_structure(&self, structure: &StructureRef) -> bool
pub fn is_subset_structure_full( &self, structure: &StructureRef, features: Option<&CapsFeaturesRef>, ) -> bool
pub fn subtract(&self, other: &Self) -> Caps
pub fn serialize(&self, flags: SerializeFlags) -> GString
pub fn foreach<F: FnMut(&CapsFeaturesRef, &StructureRef) -> ControlFlow<()>>( &self, func: F, ) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Caps
impl<'de> Deserialize<'de> for Caps
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl Extend<Caps> for CapsRef
impl Extend<Caps> for CapsRef
source§fn extend<T: IntoIterator<Item = Caps>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Caps>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<(Structure, CapsFeatures)> for Caps
impl FromIterator<(Structure, CapsFeatures)> for Caps
source§fn from_iter<T: IntoIterator<Item = (Structure, CapsFeatures)>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = (Structure, CapsFeatures)>>(iter: T) -> Self
source§impl FromIterator<(Structure, Option<CapsFeatures>)> for Caps
impl FromIterator<(Structure, Option<CapsFeatures>)> for Caps
source§fn from_iter<T: IntoIterator<Item = (Structure, Option<CapsFeatures>)>>(
iter: T,
) -> Self
fn from_iter<T: IntoIterator<Item = (Structure, Option<CapsFeatures>)>>( iter: T, ) -> Self
source§impl FromIterator<Caps> for Caps
impl FromIterator<Caps> for Caps
source§impl FromIterator<Structure> for Caps
impl FromIterator<Structure> for Caps
source§impl<'a> FromValue<'a> for &'a Caps
impl<'a> FromValue<'a> for &'a Caps
§type Checker = GenericValueTypeOrNoneChecker<&'a Caps>
type Checker = GenericValueTypeOrNoneChecker<&'a Caps>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl<'a> FromValue<'a> for Caps
impl<'a> FromValue<'a> for Caps
§type Checker = GenericValueTypeOrNoneChecker<Caps>
type Checker = GenericValueTypeOrNoneChecker<Caps>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl HasParamSpec for Caps
impl HasParamSpec for Caps
source§impl IntoGlibPtr<*mut GstCaps> for Caps
impl IntoGlibPtr<*mut GstCaps> for Caps
source§unsafe fn into_glib_ptr(self) -> *mut GstCaps
unsafe fn into_glib_ptr(self) -> *mut GstCaps
source§impl PartialEq<Caps> for CapsRef
impl PartialEq<Caps> for CapsRef
source§impl PartialEq<CapsRef> for Caps
impl PartialEq<CapsRef> for Caps
source§impl PartialEq for Caps
impl PartialEq for Caps
source§impl StaticType for Caps
impl StaticType for Caps
source§fn static_type() -> Type
fn static_type() -> Type
Self
.source§impl<'a> ToGlibContainerFromSlice<'a, *const *mut GstCaps> for Caps
impl<'a> ToGlibContainerFromSlice<'a, *const *mut GstCaps> for Caps
type Storage = (PhantomData<&'a [Caps]>, Option<Vec<*mut GstCaps>>)
fn to_glib_none_from_slice( t: &'a [Caps], ) -> (*const *mut GstCaps, Self::Storage)
fn to_glib_container_from_slice( _: &'a [Caps], ) -> (*const *mut GstCaps, Self::Storage)
fn to_glib_full_from_slice(_: &[Caps]) -> *const *mut GstCaps
source§impl<'a> ToGlibContainerFromSlice<'a, *mut *mut GstCaps> for Caps
impl<'a> ToGlibContainerFromSlice<'a, *mut *mut GstCaps> for Caps
type Storage = (PhantomData<&'a [Caps]>, Option<Vec<*mut GstCaps>>)
fn to_glib_none_from_slice(t: &'a [Caps]) -> (*mut *mut GstCaps, Self::Storage)
fn to_glib_container_from_slice( t: &'a [Caps], ) -> (*mut *mut GstCaps, Self::Storage)
fn to_glib_full_from_slice(t: &[Caps]) -> *mut *mut GstCaps
source§impl ToValueOptional for Caps
impl ToValueOptional for Caps
impl Eq for Caps
impl Send for Caps
impl Sync for Caps
impl TransparentPtrType for Caps
impl ValueTypeOptional for Caps
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>
source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moresource§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.