gstreamer_editing_services/auto/
audio_track.rs

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