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 68 69
// 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 [`AudioTrack`][crate::AudioTrack] is a default audio [`Track`][crate::Track], with a
/// [`TrackType::AUDIO`][crate::TrackType::AUDIO] [`track-type`][struct@crate::Track#track-type] and "audio/x-raw(ANY)"
/// [`caps`][struct@crate::Track#caps].
///
/// By default, an audio track will have its [`restriction-caps`][struct@crate::Track#restriction-caps]
/// set to "audio/x-raw" with the following properties:
///
/// - format: "S32LE"
/// - channels: 2
/// - rate: 44100
/// - layout: "interleaved"
///
/// 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 = "GESAudioTrack")]
pub struct AudioTrack(Object<ffi::GESAudioTrack, ffi::GESAudioTrackClass>) @extends Track, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer;
match fn {
type_ => || ffi::ges_audio_track_get_type(),
}
}
impl AudioTrack {
pub const NONE: Option<&'static AudioTrack> = None;
/// Creates a new audio track, with a [`TrackType::AUDIO`][crate::TrackType::AUDIO]
/// [`track-type`][struct@crate::Track#track-type], "audio/x-raw(ANY)" [`caps`][struct@crate::Track#caps], and
/// "audio/x-raw" [`restriction-caps`][struct@crate::Track#restriction-caps] with the properties:
///
/// - format: "S32LE"
/// - channels: 2
/// - rate: 44100
/// - layout: "interleaved"
///
/// 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 audio track.
#[doc(alias = "ges_audio_track_new")]
pub fn new() -> AudioTrack {
assert_initialized_main_thread!();
unsafe { from_glib_none(ffi::ges_audio_track_new()) }
}
}
impl Default for AudioTrack {
fn default() -> Self {
Self::new()
}
}