1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::{ffi, MetaContainer, Track};
use glib::translate::*;
glib::wrapper! {
/// A [`VideoTrack`][crate::VideoTrack] is a default video [`Track`][crate::Track], with a
/// [`TrackType::VIDEO`][crate::TrackType::VIDEO] [`track-type`][struct@crate::Track#track-type] and "video/x-raw(ANY)"
/// [`caps`][struct@crate::Track#caps].
///
/// By default, a video track will have its [`restriction-caps`][struct@crate::Track#restriction-caps]
/// set to "video/x-raw" with the following properties:
///
/// - width: 1280
/// - height: 720
/// - framerate: 30/1
///
/// These fields are needed for negotiation purposes, but you can change
/// their values if you wish. It is advised that you do so using
/// [`GESTrackExt::update_restriction_caps()`][crate::prelude::GESTrackExt::update_restriction_caps()] with new values for the fields you
/// wish to change, and any additional fields you may want to add. Unlike
/// using [`GESTrackExt::set_restriction_caps()`][crate::prelude::GESTrackExt::set_restriction_caps()], this will ensure that these
/// default fields will at least have some value set.
///
/// # Implements
///
/// [`GESTrackExt`][trait@crate::prelude::GESTrackExt], [`trait@gst::prelude::BinExt`], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::GstObjectExt`], [`trait@glib::ObjectExt`], [`trait@gst::prelude::ChildProxyExt`], [`MetaContainerExt`][trait@crate::prelude::MetaContainerExt]
#[doc(alias = "GESVideoTrack")]
pub struct VideoTrack(Object<ffi::GESVideoTrack, ffi::GESVideoTrackClass>) @extends Track, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer;
match fn {
type_ => || ffi::ges_video_track_get_type(),
}
}
impl VideoTrack {
pub const NONE: Option<&'static VideoTrack> = None;
/// Creates a new video track, with a [`TrackType::VIDEO`][crate::TrackType::VIDEO]
/// [`track-type`][struct@crate::Track#track-type] and "video/x-raw(ANY)" [`caps`][struct@crate::Track#caps], and
/// "video/x-raw" [`restriction-caps`][struct@crate::Track#restriction-caps] with the properties:
///
/// - width: 1280
/// - height: 720
/// - framerate: 30/1
///
/// You should use [`GESTrackExt::update_restriction_caps()`][crate::prelude::GESTrackExt::update_restriction_caps()] if you wish to
/// modify these fields, or add additional ones.
///
/// # Returns
///
/// The newly created video track.
#[doc(alias = "ges_video_track_new")]
pub fn new() -> VideoTrack {
assert_initialized_main_thread!();
unsafe { from_glib_none(ffi::ges_video_track_new()) }
}
}
impl Default for VideoTrack {
fn default() -> Self {
Self::new()
}
}