mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-19 22:50:36 +00:00
4ebec84f5e
Allows us to set all the crates in the main workspace file, so changing their versions or branch is much simpler and reduce the amount of noise in the diff Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
49 lines
1.5 KiB
Rust
49 lines
1.5 KiB
Rust
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
#[cfg(feature = "v1_16")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
|
use glib::translate::*;
|
|
|
|
#[cfg(feature = "v1_16")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
|
use crate::VideoCaptionType;
|
|
#[cfg(feature = "v1_20")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
|
use crate::VideoOrientationMethod;
|
|
|
|
#[cfg(feature = "v1_16")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
|
impl VideoCaptionType {
|
|
#[doc(alias = "gst_video_caption_type_from_caps")]
|
|
pub fn from_caps(caps: &gst::CapsRef) -> VideoCaptionType {
|
|
skip_assert_initialized!();
|
|
unsafe { from_glib(crate::ffi::gst_video_caption_type_from_caps(caps.as_ptr())) }
|
|
}
|
|
}
|
|
|
|
#[cfg(feature = "v1_20")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
|
impl VideoOrientationMethod {
|
|
#[cfg(feature = "v1_20")]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
|
#[doc(alias = "gst_video_orientation_from_tag")]
|
|
pub fn from_tag(taglist: &gst::TagListRef) -> Option<VideoOrientationMethod> {
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
|
use std::mem;
|
|
|
|
let mut method = mem::MaybeUninit::uninit();
|
|
let ret = from_glib(crate::ffi::gst_video_orientation_from_tag(
|
|
mut_override(taglist.as_ptr()),
|
|
method.as_mut_ptr(),
|
|
));
|
|
if ret {
|
|
Some(from_glib(method.assume_init()))
|
|
} else {
|
|
None
|
|
}
|
|
}
|
|
}
|
|
}
|