Struct gstreamer_video::VideoInfo

source ·
pub struct VideoInfo(/* private fields */);
Expand description

Information describing image properties. This information can be filled in from GstCaps with from_caps(). The information is also used to store the specific video info when mapping a video frame with VideoFrame::from_buffer_readable().

Use the provided macros to access the info in this structure.

Implementations§

source§

impl VideoInfo

source

pub fn builder<'a>( format: VideoFormat, width: u32, height: u32, ) -> VideoInfoBuilder<'a>

source

pub fn is_valid(&self) -> bool

source

pub fn from_caps(caps: &CapsRef) -> Result<Self, BoolError>

Parse caps to generate a VideoInfo.

§caps

a gst::Caps

§Returns

A VideoInfo, or None if caps couldn’t be parsed

source

pub fn to_caps(&self) -> Result<Caps, BoolError>

Convert the values of self into a gst::Caps.

§Returns

a new gst::Caps containing the info of self.

source

pub fn format(&self) -> VideoFormat

source

pub fn format_info(&self) -> VideoFormatInfo

source

pub fn name<'a>(&self) -> &'a str

source

pub fn width(&self) -> u32

source

pub fn height(&self) -> u32

source

pub fn field_height(&self) -> u32

source

pub fn interlace_mode(&self) -> VideoInterlaceMode

source

pub fn flags(&self) -> VideoFlags

source

pub fn size(&self) -> usize

source

pub fn views(&self) -> u32

source

pub fn chroma_site(&self) -> VideoChromaSite

source

pub fn colorimetry(&self) -> VideoColorimetry

source

pub fn comp_depth(&self, component: u8) -> u32

source

pub fn comp_height(&self, component: u8) -> u32

source

pub fn comp_width(&self, component: u8) -> u32

source

pub fn comp_offset(&self, component: u8) -> usize

source

pub fn comp_plane(&self, component: u8) -> u32

source

pub fn comp_poffset(&self, component: u8) -> u32

source

pub fn comp_pstride(&self, component: u8) -> i32

source

pub fn comp_stride(&self, component: u8) -> i32

source

pub fn par(&self) -> Fraction

source

pub fn fps(&self) -> Fraction

source

pub fn field_rate(&self) -> Fraction

source

pub fn offset(&self) -> &[usize]

source

pub fn stride(&self) -> &[i32]

source

pub fn multiview_mode(&self) -> VideoMultiviewMode

source

pub fn multiview_flags(&self) -> VideoMultiviewFlags

source

pub fn field_order(&self) -> VideoFieldOrder

source

pub fn has_alpha(&self) -> bool

source

pub fn is_gray(&self) -> bool

source

pub fn is_rgb(&self) -> bool

source

pub fn is_yuv(&self) -> bool

source

pub fn is_interlaced(&self) -> bool

source

pub fn n_planes(&self) -> u32

source

pub fn n_components(&self) -> u32

source

pub fn convert<U: SpecificFormattedValueFullRange>( &self, src_val: impl FormattedValue, ) -> Option<U>

Converts among various gst::Format types. This function handles GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For raw video, GST_FORMAT_DEFAULT corresponds to video frames. This function can be used to handle pad queries of the type GST_QUERY_CONVERT.

§src_format

gst::Format of the src_value

§src_value

value to convert

§dest_format

gst::Format of the dest_value

§Returns

TRUE if the conversion was successful.

§dest_value

pointer to destination value

source

pub fn convert_generic( &self, src_val: impl FormattedValue, dest_fmt: Format, ) -> Option<GenericFormattedValue>

source

pub fn align(&mut self, align: &mut VideoAlignment) -> Result<(), BoolError>

Adjust the offset and stride fields in self so that the padding and stride alignment in align is respected.

Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

§align

alignment parameters

§Returns

false if alignment could not be applied, e.g. because the size of a frame can’t be represented as a 32 bit integer (Since: 1.12)

source

pub fn align_full( &mut self, align: &mut VideoAlignment, ) -> Result<[usize; 4], BoolError>

Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

This variant of align() provides the updated size, in bytes, of each video plane after the alignment, including all horizontal and vertical paddings.

In case of GST_VIDEO_INTERLACE_MODE_ALTERNATE info, the returned sizes are the ones used to hold a single field, not the full frame.

§align

alignment parameters

§Returns

false if alignment could not be applied, e.g. because the size of a frame can’t be represented as a 32 bit integer

§plane_size

array used to store the plane sizes

source

pub fn range_offsets(&self, range: VideoColorRange) -> ([i32; 4], [i32; 4])

Trait Implementations§

source§

impl Clone for VideoInfo

source§

fn clone(&self) -> VideoInfo

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 VideoInfo

source§

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

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

impl PartialEq for VideoInfo

source§

fn eq(&self, other: &Self) -> 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 StaticType for VideoInfo

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl<'a> TryFrom<&'a VideoInfo> for VideoVBIEncoder

§

type Error = VideoVBIError

The type returned in the event of a conversion error.
source§

fn try_from(info: &'a VideoInfo) -> Result<VideoVBIEncoder, VideoVBIError>

Performs the conversion.
source§

impl<'a> TryFrom<&'a VideoInfo> for VideoVBIParser

§

type Error = VideoVBIError

The type returned in the event of a conversion error.
source§

fn try_from(info: &'a VideoInfo) -> Result<VideoVBIParser, VideoVBIError>

Performs the conversion.
source§

impl ValueType for VideoInfo

§

type Type = VideoInfo

Type to get the Type from. Read more
source§

impl Eq for VideoInfo

source§

impl Send for VideoInfo

source§

impl Sync for VideoInfo

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§

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> 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, 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<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,