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
impl VideoInfo
pub fn builder<'a>( format: VideoFormat, width: u32, height: u32, ) -> VideoInfoBuilder<'a>
pub fn is_valid(&self) -> bool
pub fn format(&self) -> VideoFormat
pub fn format_info(&self) -> VideoFormatInfo
pub fn name<'a>(&self) -> &'a str
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn field_height(&self) -> u32
pub fn interlace_mode(&self) -> VideoInterlaceMode
pub fn flags(&self) -> VideoFlags
pub fn size(&self) -> usize
pub fn views(&self) -> u32
pub fn chroma_site(&self) -> VideoChromaSite
pub fn colorimetry(&self) -> VideoColorimetry
pub fn comp_depth(&self, component: u8) -> u32
pub fn comp_height(&self, component: u8) -> u32
pub fn comp_width(&self, component: u8) -> u32
pub fn comp_offset(&self, component: u8) -> usize
pub fn comp_plane(&self, component: u8) -> u32
pub fn comp_poffset(&self, component: u8) -> u32
pub fn comp_pstride(&self, component: u8) -> i32
pub fn comp_stride(&self, component: u8) -> i32
pub fn par(&self) -> Fraction
pub fn fps(&self) -> Fraction
pub fn field_rate(&self) -> Fraction
pub fn offset(&self) -> &[usize]
pub fn stride(&self) -> &[i32]
pub fn multiview_mode(&self) -> VideoMultiviewMode
pub fn multiview_flags(&self) -> VideoMultiviewFlags
pub fn field_order(&self) -> VideoFieldOrder
pub fn has_alpha(&self) -> bool
pub fn is_gray(&self) -> bool
pub fn is_rgb(&self) -> bool
pub fn is_yuv(&self) -> bool
pub fn is_interlaced(&self) -> bool
pub fn n_planes(&self) -> u32
pub fn n_components(&self) -> u32
sourcepub fn convert<U: SpecificFormattedValueFullRange>(
&self,
src_val: impl FormattedValue,
) -> Option<U>
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
pub fn convert_generic( &self, src_val: impl FormattedValue, dest_fmt: Format, ) -> Option<GenericFormattedValue>
sourcepub fn align(&mut self, align: &mut VideoAlignment) -> Result<(), BoolError>
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)
sourcepub fn align_full(
&mut self,
align: &mut VideoAlignment,
) -> Result<[usize; 4], BoolError>
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
pub fn range_offsets(&self, range: VideoColorRange) -> ([i32; 4], [i32; 4])
Trait Implementations§
source§impl StaticType for VideoInfo
impl StaticType for VideoInfo
source§fn static_type() -> Type
fn static_type() -> Type
Self
.source§impl<'a> TryFrom<&'a VideoInfo> for VideoVBIEncoder
impl<'a> TryFrom<&'a VideoInfo> for VideoVBIEncoder
§type Error = VideoVBIError
type Error = VideoVBIError
source§fn try_from(info: &'a VideoInfo) -> Result<VideoVBIEncoder, VideoVBIError>
fn try_from(info: &'a VideoInfo) -> Result<VideoVBIEncoder, VideoVBIError>
source§impl<'a> TryFrom<&'a VideoInfo> for VideoVBIParser
impl<'a> TryFrom<&'a VideoInfo> for VideoVBIParser
§type Error = VideoVBIError
type Error = VideoVBIError
source§fn try_from(info: &'a VideoInfo) -> Result<VideoVBIParser, VideoVBIError>
fn try_from(info: &'a VideoInfo) -> Result<VideoVBIParser, VideoVBIError>
impl Eq for VideoInfo
impl Send for VideoInfo
impl Sync for VideoInfo
Auto Trait Implementations§
impl Freeze for VideoInfo
impl RefUnwindSafe for VideoInfo
impl Unpin for VideoInfo
impl UnwindSafe for VideoInfo
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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> 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
.