pub struct Buffer { /* private fields */ }
Implementations§
source§impl Buffer
impl Buffer
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GstBuffer) -> &Self
pub unsafe fn from_glib_none(ptr: *const GstBuffer) -> Self
pub unsafe fn from_glib_full(ptr: *const GstBuffer) -> Self
pub unsafe fn from_glib_borrow(ptr: *const GstBuffer) -> Borrowed<Self>
pub unsafe fn replace_ptr(&mut self, ptr: *mut GstBuffer)
pub fn make_mut(&mut self) -> &mut BufferRef
pub fn get_mut(&mut self) -> Option<&mut BufferRef>
pub fn is_writable(&self) -> bool
pub fn upcast(self) -> MiniObject
source§impl Buffer
impl Buffer
pub fn with_size(size: usize) -> Result<Self, BoolError>
pub fn from_mut_slice<T: AsMut<[u8]> + Send + 'static>(slice: T) -> Self
pub fn from_slice<T: AsRef<[u8]> + Send + 'static>(slice: T) -> Self
sourcepub fn into_mapped_buffer_readable(self) -> Result<MappedBuffer<Readable>, Self>
pub fn into_mapped_buffer_readable(self) -> Result<MappedBuffer<Readable>, Self>
Fills info
with the GstMapInfo
of all merged memory blocks in self
.
flags
describe the desired access of the memory. When flags
is
GST_MAP_WRITE
, self
should be writable (as returned from
gst_buffer_is_writable()
).
When self
is writable but the memory isn’t, a writable copy will
automatically be created and returned. The readonly copy of the
buffer memory will then also be replaced with this writable copy.
The memory in info
should be unmapped with gst_buffer_unmap()
after
usage.
§flags
flags for the mapping
§Returns
true
if the map succeeded and info
contains valid data.
§info
info about the mapping
pub fn into_mapped_buffer_writable(self) -> Result<MappedBuffer<Writable>, Self>
pub fn into_cursor_readable(self) -> BufferCursor<Readable> ⓘ
pub fn into_cursor_writable(self) -> Result<BufferCursor<Writable>, BoolError>
Methods from Deref<Target = BufferRef>§
pub fn as_ptr(&self) -> *const GstBuffer
pub fn as_mut_ptr(&self) -> *mut GstBuffer
pub fn copy(&self) -> Buffer
pub fn upcast_ref(&self) -> &MiniObjectRef
pub fn map_readable(&self) -> Result<BufferMap<'_, Readable>, BoolError>
pub fn map_range_readable( &self, range: impl RangeBounds<usize>, ) -> Result<BufferMap<'_, Readable>, BoolError>
pub fn copy_region( &self, flags: BufferCopyFlags, range: impl RangeBounds<usize>, ) -> Result<Buffer, BoolError>
pub fn copy_into( &self, dest: &mut BufferRef, flags: BufferCopyFlags, range: impl RangeBounds<usize>, ) -> Result<(), BoolError>
pub fn copy_to_slice( &self, offset: usize, slice: &mut [u8], ) -> Result<(), usize>
pub fn copy_deep(&self) -> Result<Buffer, BoolError>
pub fn size(&self) -> usize
pub fn maxsize(&self) -> usize
pub fn offset(&self) -> u64
pub fn offset_end(&self) -> u64
pub fn pts(&self) -> Option<ClockTime>
pub fn dts(&self) -> Option<ClockTime>
pub fn dts_or_pts(&self) -> Option<ClockTime>
pub fn duration(&self) -> Option<ClockTime>
pub fn flags(&self) -> BufferFlags
pub fn meta<T: MetaAPI>(&self) -> Option<MetaRef<'_, T>>
pub fn iter_meta<T: MetaAPI>(&self) -> MetaIter<'_, T> ⓘ
pub fn foreach_meta<F: FnMut(MetaRef<'_, Meta>) -> ControlFlow<(), ()>>( &self, func: F, ) -> bool
pub fn find_memory( &self, range: impl RangeBounds<usize>, ) -> Option<(Range<usize>, usize)>
pub fn all_memory(&self) -> Option<Memory>
pub fn memory(&self, idx: usize) -> Option<Memory>
pub fn memory_range(&self, range: impl RangeBounds<usize>) -> Option<Memory>
pub fn is_all_memory_writable(&self) -> bool
pub fn is_memory_range_writable(&self, range: impl RangeBounds<usize>) -> bool
pub fn n_memory(&self) -> usize
pub fn peek_memory(&self, idx: usize) -> &MemoryRef
pub fn iter_memories(&self) -> Iter<'_> ⓘ
pub fn iter_memories_owned(&self) -> IterOwned<'_> ⓘ
pub fn as_cursor_readable(&self) -> BufferRefCursor<&BufferRef> ⓘ
pub fn dump(&self) -> Dump<'_>
pub fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump<'_>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Buffer
impl<'de> Deserialize<'de> for Buffer
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Extend<Buffer> for BufferListRef
impl Extend<Buffer> for BufferListRef
source§fn extend<T: IntoIterator<Item = Buffer>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Buffer>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
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)
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 From<Buffer> for BufferList
impl From<Buffer> for BufferList
source§impl FromIterator<Buffer> for BufferList
impl FromIterator<Buffer> for BufferList
source§impl FromIterator<Memory> for Buffer
impl FromIterator<Memory> for Buffer
source§impl<'a> FromValue<'a> for &'a Buffer
impl<'a> FromValue<'a> for &'a Buffer
§type Checker = GenericValueTypeOrNoneChecker<&'a Buffer>
type Checker = GenericValueTypeOrNoneChecker<&'a Buffer>
Value type checker.
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Get the contained value from a
Value
. Read moresource§impl<'a> FromValue<'a> for Buffer
impl<'a> FromValue<'a> for Buffer
§type Checker = GenericValueTypeOrNoneChecker<Buffer>
type Checker = GenericValueTypeOrNoneChecker<Buffer>
Value type checker.
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Get the contained value from a
Value
. Read moresource§impl HasParamSpec for Buffer
impl HasParamSpec for Buffer
source§impl IntoGlibPtr<*mut GstBuffer> for Buffer
impl IntoGlibPtr<*mut GstBuffer> for Buffer
source§unsafe fn into_glib_ptr(self) -> *mut GstBuffer
unsafe fn into_glib_ptr(self) -> *mut GstBuffer
Transfer: full.
source§impl PartialEq<Buffer> for BufferRef
impl PartialEq<Buffer> for BufferRef
source§impl PartialEq<BufferRef> for Buffer
impl PartialEq<BufferRef> for Buffer
source§impl PartialEq for Buffer
impl PartialEq for Buffer
source§impl StaticType for Buffer
impl StaticType for Buffer
source§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self
.source§impl<'a> ToGlibContainerFromSlice<'a, *const *mut GstBuffer> for Buffer
impl<'a> ToGlibContainerFromSlice<'a, *const *mut GstBuffer> for Buffer
type Storage = (PhantomData<&'a [Buffer]>, Option<Vec<*mut GstBuffer>>)
fn to_glib_none_from_slice( t: &'a [Buffer], ) -> (*const *mut GstBuffer, Self::Storage)
fn to_glib_container_from_slice( _: &'a [Buffer], ) -> (*const *mut GstBuffer, Self::Storage)
fn to_glib_full_from_slice(_: &[Buffer]) -> *const *mut GstBuffer
source§impl<'a> ToGlibContainerFromSlice<'a, *mut *mut GstBuffer> for Buffer
impl<'a> ToGlibContainerFromSlice<'a, *mut *mut GstBuffer> for Buffer
type Storage = (PhantomData<&'a [Buffer]>, Option<Vec<*mut GstBuffer>>)
fn to_glib_none_from_slice( t: &'a [Buffer], ) -> (*mut *mut GstBuffer, Self::Storage)
fn to_glib_container_from_slice( t: &'a [Buffer], ) -> (*mut *mut GstBuffer, Self::Storage)
fn to_glib_full_from_slice(t: &[Buffer]) -> *mut *mut GstBuffer
source§impl ToValueOptional for Buffer
impl ToValueOptional for Buffer
impl Eq for Buffer
impl Send for Buffer
impl Sync for Buffer
impl TransparentPtrType for Buffer
impl ValueTypeOptional for Buffer
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
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>
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 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>
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 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()
Ensures that the type has been registered with the type system.
source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a
SendValue
clone of self
.