Struct gstreamer_video::VideoTimeCode
source · pub struct VideoTimeCode { /* private fields */ }
Expand description
field_count
must be 0 for progressive video and 1 or 2 for interlaced.
A representation of a SMPTE time code.
hours
must be positive and less than 24. Will wrap around otherwise.
minutes
and seconds
must be positive and less than 60.
frames
must be less than or equal to config
/ config
These values are NOT automatically normalized.
GLib type: Inline allocated boxed type with stack copy semantics.
Implementations§
source§impl VideoTimeCode
impl VideoTimeCode
pub fn as_ptr(&self) -> *mut GstVideoTimeCode
sourcepub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const GstVideoTimeCode) -> &'a Self
pub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const GstVideoTimeCode) -> &'a Self
Borrows the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow_mut<'a>(
ptr: *mut GstVideoTimeCode,
) -> &'a mut Self
pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut GstVideoTimeCode, ) -> &'a mut Self
Borrows the underlying C value mutably.
source§impl VideoTimeCode
impl VideoTimeCode
sourcepub fn new_empty() -> Self
pub fn new_empty() -> Self
§Returns
a new empty, invalid VideoTimeCode
sourcepub fn new(
fps: Fraction,
latest_daily_jam: Option<&DateTime>,
flags: VideoTimeCodeFlags,
hours: u32,
minutes: u32,
seconds: u32,
frames: u32,
field_count: u32,
) -> Self
pub fn new( fps: Fraction, latest_daily_jam: Option<&DateTime>, flags: VideoTimeCodeFlags, hours: u32, minutes: u32, seconds: u32, frames: u32, field_count: u32, ) -> Self
field_count
is 0 for progressive, 1 or 2 for interlaced.
latest_daiy_jam
reference is stolen from caller.
§fps_n
Numerator of the frame rate
§fps_d
Denominator of the frame rate
§latest_daily_jam
The latest daily jam of the VideoTimeCode
§flags
§hours
the hours field of VideoTimeCode
§minutes
the minutes field of VideoTimeCode
§seconds
the seconds field of VideoTimeCode
§frames
the frames field of VideoTimeCode
§field_count
Interlaced video field count
§Returns
a new VideoTimeCode
with the given values.
The values are not checked for being in a valid range. To see if your
timecode actually has valid content, use is_valid()
.
sourcepub fn from_date_time(
fps: Fraction,
dt: &DateTime,
flags: VideoTimeCodeFlags,
field_count: u32,
) -> Result<Self, BoolError>
pub fn from_date_time( fps: Fraction, dt: &DateTime, flags: VideoTimeCodeFlags, field_count: u32, ) -> Result<Self, BoolError>
The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.
This might return a completely invalid timecode, use
[from_date_time_full()
][Self::from_date_time_full()] to ensure
that you would get None
instead in that case.
§fps_n
Numerator of the frame rate
§fps_d
Denominator of the frame rate
§dt
glib::DateTime
to convert
§flags
§field_count
Interlaced video field count
§Returns
the VideoTimeCode
representation of dt
.
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
§Returns
whether self
is a valid timecode (supported frame rate,
hours/minutes/seconds/frames not overflowing)
pub fn set_fps(&mut self, fps: Fraction)
pub fn set_flags(&mut self, flags: VideoTimeCodeFlags)
pub fn set_hours(&mut self, hours: u32)
pub fn set_minutes(&mut self, minutes: u32)
pub fn set_seconds(&mut self, seconds: u32)
pub fn set_frames(&mut self, frames: u32)
pub fn set_field_count(&mut self, field_count: u32)
source§impl VideoTimeCode
impl VideoTimeCode
pub fn hours(&self) -> u32
pub fn minutes(&self) -> u32
pub fn seconds(&self) -> u32
pub fn frames(&self) -> u32
pub fn field_count(&self) -> u32
pub fn fps(&self) -> Fraction
pub fn flags(&self) -> VideoTimeCodeFlags
pub fn latest_daily_jam(&self) -> Option<DateTime>
pub fn set_latest_daily_jam(&mut self, latest_daily_jam: Option<DateTime>)
Trait Implementations§
source§impl Clone for VideoTimeCode
impl Clone for VideoTimeCode
source§impl Debug for VideoTimeCode
impl Debug for VideoTimeCode
source§impl Display for VideoTimeCode
impl Display for VideoTimeCode
source§impl Drop for VideoTimeCode
impl Drop for VideoTimeCode
source§impl From<ValidVideoTimeCode> for VideoTimeCode
impl From<ValidVideoTimeCode> for VideoTimeCode
source§fn from(v: ValidVideoTimeCode) -> Self
fn from(v: ValidVideoTimeCode) -> Self
source§impl FromStr for VideoTimeCode
impl FromStr for VideoTimeCode
source§impl HasParamSpec for VideoTimeCode
impl HasParamSpec for VideoTimeCode
type ParamSpec = ParamSpecBoxed
§type SetValue = VideoTimeCode
type SetValue = VideoTimeCode
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, VideoTimeCode>
fn param_spec_builder() -> Self::BuilderFn
source§impl StaticType for VideoTimeCode
impl StaticType for VideoTimeCode
source§fn static_type() -> Type
fn static_type() -> Type
Self
.source§impl TryFrom<VideoTimeCode> for ValidVideoTimeCode
impl TryFrom<VideoTimeCode> for ValidVideoTimeCode
§type Error = VideoTimeCode
type Error = VideoTimeCode
source§fn try_from(v: VideoTimeCode) -> Result<Self, VideoTimeCode>
fn try_from(v: VideoTimeCode) -> Result<Self, VideoTimeCode>
impl Send for VideoTimeCode
impl Sync for VideoTimeCode
Auto Trait Implementations§
impl Freeze for VideoTimeCode
impl RefUnwindSafe for VideoTimeCode
impl Unpin for VideoTimeCode
impl UnwindSafe for VideoTimeCode
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
.