pub struct VideoMeta(/* private fields */);
Expand description
Extra buffer metadata describing image properties
This meta can also be used by downstream elements to specifiy their buffer layout requirements for upstream. Upstream should try to fit those requirements, if possible, in order to prevent buffer copies.
This is done by passing a custom gst::Structure
to
[gst::Query::add_allocation_meta()
][crate::gst::Query::add_allocation_meta()] when handling the ALLOCATION query.
This structure should be named ‘video-meta’ and can have the following
fields:
- padding-top (uint): extra pixels on the top
- padding-bottom (uint): extra pixels on the bottom
- padding-left (uint): extra pixels on the left side
- padding-right (uint): extra pixels on the right side
- stride-align0 (uint): stride align requirements for plane 0
- stride-align1 (uint): stride align requirements for plane 1
- stride-align2 (uint): stride align requirements for plane 2
- stride-align3 (uint): stride align requirements for plane 3
The padding and stride-align fields have the same semantic as
GstVideoMeta.alignment
and so represent the paddings and stride-align requested on produced video buffers.
Since 1.24 it can be serialized using gst_meta_serialize()
and
gst_meta_deserialize()
.
Implementations§
Source§impl VideoMeta
impl VideoMeta
pub fn add( buffer: &mut BufferRef, video_frame_flags: VideoFrameFlags, format: VideoFormat, width: u32, height: u32, ) -> Result<MetaRefMut<'_, Self, Standalone>, BoolError>
pub fn add_full<'a>( buffer: &'a mut BufferRef, video_frame_flags: VideoFrameFlags, format: VideoFormat, width: u32, height: u32, offset: &[usize], stride: &[i32], ) -> Result<MetaRefMut<'a, Self, Standalone>, BoolError>
pub fn video_frame_flags(&self) -> VideoFrameFlags
pub fn format(&self) -> VideoFormat
pub fn id(&self) -> i32
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn n_planes(&self) -> u32
pub fn offset(&self) -> &[usize]
pub fn stride(&self) -> &[i32]
pub fn alignment(&self) -> VideoAlignment
Sourcepub fn plane_height(&self) -> Result<[u32; 4], BoolError>
pub fn plane_height(&self) -> Result<[u32; 4], BoolError>
Compute the padded height of each plane from self
(padded size
divided by stride).
It is not valid to call this function with a meta associated to a TILED video format.
§Returns
true
if self
’s alignment is valid and plane_height
has been
updated, false
otherwise
§plane_height
array used to store the plane height
Sourcepub fn set_alignment(
&mut self,
alignment: &VideoAlignment,
) -> Result<(), BoolError>
pub fn set_alignment( &mut self, alignment: &VideoAlignment, ) -> Result<(), BoolError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VideoMeta
impl RefUnwindSafe for VideoMeta
impl Unpin for VideoMeta
impl UnwindSafe for VideoMeta
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> 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 more