gstreamer_editing_services/auto/effect_clip.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::{
7 ffi, BaseEffectClip, Clip, Container, Extractable, MetaContainer, OperationClip,
8 TimelineElement,
9};
10use glib::{prelude::*, translate::*};
11
12glib::wrapper! {
13 /// The effect will be applied on the sources that have lower priorities
14 /// (higher number) between the inpoint and the end of it.
15 ///
16 /// The asset ID of an effect clip is in the form:
17 ///
18 /// ```text
19 /// "audio ! bin ! description || video ! bin ! description"
20 /// ```
21 ///
22 /// ## Properties
23 ///
24 ///
25 /// #### `audio-bin-description`
26 /// The description of the audio track of the effect bin with a gst-launch-style
27 /// pipeline description. This should be used for test purposes.
28 ///
29 /// Example: "audiopanorama panorama=1.0"
30 ///
31 /// Readable | Writeable | Construct Only
32 ///
33 ///
34 /// #### `video-bin-description`
35 /// The description of the video track of the effect bin with a gst-launch-style
36 /// pipeline description. This should be used for test purposes.
37 ///
38 /// Example: "videobalance saturation=1.5 hue=+0.5"
39 ///
40 /// Readable | Writeable | Construct Only
41 /// <details><summary><h4>Clip</h4></summary>
42 ///
43 ///
44 /// #### `duration-limit`
45 /// The maximum [`duration`][struct@crate::TimelineElement#duration] that can be *currently* set
46 /// for the clip, taking into account the [`in-point`][struct@crate::TimelineElement#in-point],
47 /// [`max-duration`][struct@crate::TimelineElement#max-duration], [`active`][struct@crate::TrackElement#active], and
48 /// [`track`][struct@crate::TrackElement#track] properties of its children, as well as any
49 /// time effects. If there is no limit, this will be set to
50 /// `GST_CLOCK_TIME_NONE`.
51 ///
52 /// Note that whilst a clip has no children in any tracks, the limit will
53 /// be unknown, and similarly set to `GST_CLOCK_TIME_NONE`.
54 ///
55 /// If the duration-limit would ever go below the current
56 /// [`duration`][struct@crate::TimelineElement#duration] of the clip due to a change in the above
57 /// variables, its [`duration`][struct@crate::TimelineElement#duration] will be set to the new
58 /// limit.
59 ///
60 /// Readable
61 ///
62 ///
63 /// #### `layer`
64 /// The layer this clip lies in.
65 ///
66 /// If you want to connect to this property's [`notify`][struct@crate::glib::Object#notify] signal,
67 /// you should connect to it with `g_signal_connect_after()` since the
68 /// signal emission may be stopped internally.
69 ///
70 /// Readable
71 ///
72 ///
73 /// #### `supported-formats`
74 /// The [`TrackType`][crate::TrackType]-s that the clip supports, which it can create
75 /// [`TrackElement`][crate::TrackElement]-s for. Note that this can be a combination of
76 /// [`TrackType`][crate::TrackType] flags to indicate support for several
77 /// [`track-type`][struct@crate::TrackElement#track-type] elements.
78 ///
79 /// Readable | Writeable | Construct
80 /// </details>
81 /// <details><summary><h4>Container</h4></summary>
82 ///
83 ///
84 /// #### `height`
85 /// The span of the container's children's [`priority`][struct@crate::TimelineElement#priority]
86 /// values, which is the number of integers that lie between (inclusive)
87 /// the minimum and maximum priorities found amongst the container's
88 /// children (maximum - minimum + 1).
89 ///
90 /// Readable
91 /// </details>
92 /// <details><summary><h4>TimelineElement</h4></summary>
93 ///
94 ///
95 /// #### `duration`
96 /// The duration that the element is in effect for in the timeline (a
97 /// time difference in nanoseconds using the time coordinates of the
98 /// timeline). For example, for a source element, this would determine
99 /// for how long it should output its internal content for. For an
100 /// operation element, this would determine for how long its effect
101 /// should be applied to any source content.
102 ///
103 /// Readable | Writeable
104 ///
105 ///
106 /// #### `in-point`
107 /// The initial offset to use internally when outputting content (in
108 /// nanoseconds, but in the time coordinates of the internal content).
109 ///
110 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
111 /// file, the "internal content" is the media file data, and the
112 /// in-point would correspond to some timestamp in the media file.
113 /// When playing the timeline, and when the element is first reached at
114 /// timeline-time [`start`][struct@crate::TimelineElement#start], it will begin outputting the
115 /// data from the timestamp in-point **onwards**, until it reaches the
116 /// end of its [`duration`][struct@crate::TimelineElement#duration] in the timeline.
117 ///
118 /// For elements that have no internal content, this should be kept
119 /// as 0.
120 ///
121 /// Readable | Writeable
122 ///
123 ///
124 /// #### `max-duration`
125 /// The full duration of internal content that is available (a time
126 /// difference in nanoseconds using the time coordinates of the internal
127 /// content).
128 ///
129 /// This will act as a cap on the [`in-point`][struct@crate::TimelineElement#in-point] of the
130 /// element (which is in the same time coordinates), and will sometimes
131 /// be used to limit the [`duration`][struct@crate::TimelineElement#duration] of the element in
132 /// the timeline.
133 ///
134 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
135 /// file, this would be the length of the media file.
136 ///
137 /// For elements that have no internal content, or whose content is
138 /// indefinite, this should be kept as `GST_CLOCK_TIME_NONE`.
139 ///
140 /// Readable | Writeable | Construct
141 ///
142 ///
143 /// #### `name`
144 /// The name of the element. This should be unique within its timeline.
145 ///
146 /// Readable | Writeable | Construct
147 ///
148 ///
149 /// #### `parent`
150 /// The parent container of the element.
151 ///
152 /// Readable | Writeable
153 ///
154 ///
155 /// #### `priority`
156 /// The priority of the element.
157 ///
158 /// Readable | Writeable
159 ///
160 ///
161 /// #### `serialize`
162 /// Whether the element should be serialized.
163 ///
164 /// Readable | Writeable
165 ///
166 ///
167 /// #### `start`
168 /// The starting position of the element in the timeline (in nanoseconds
169 /// and in the time coordinates of the timeline). For example, for a
170 /// source element, this would determine the time at which it should
171 /// start outputting its internal content. For an operation element, this
172 /// would determine the time at which it should start applying its effect
173 /// to any source content.
174 ///
175 /// Readable | Writeable
176 ///
177 ///
178 /// #### `timeline`
179 /// The timeline that the element lies within.
180 ///
181 /// Readable | Writeable
182 /// </details>
183 ///
184 /// # Implements
185 ///
186 /// [`EffectClipExt`][trait@crate::prelude::EffectClipExt], [`BaseEffectClipExt`][trait@crate::prelude::BaseEffectClipExt], [`OperationClipExt`][trait@crate::prelude::OperationClipExt], [`ClipExt`][trait@crate::prelude::ClipExt], [`GESContainerExt`][trait@crate::prelude::GESContainerExt], [`TimelineElementExt`][trait@crate::prelude::TimelineElementExt], [`trait@glib::ObjectExt`], [`ExtractableExt`][trait@crate::prelude::ExtractableExt], [`MetaContainerExt`][trait@crate::prelude::MetaContainerExt], [`TimelineElementExtManual`][trait@crate::prelude::TimelineElementExtManual]
187 #[doc(alias = "GESEffectClip")]
188 pub struct EffectClip(Object<ffi::GESEffectClip, ffi::GESEffectClipClass>) @extends BaseEffectClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
189
190 match fn {
191 type_ => || ffi::ges_effect_clip_get_type(),
192 }
193}
194
195impl EffectClip {
196 pub const NONE: Option<&'static EffectClip> = None;
197
198 /// Creates a new [`EffectClip`][crate::EffectClip] from the description of the bin.
199 /// ## `video_bin_description`
200 /// The gst-launch like bin description of the effect
201 /// ## `audio_bin_description`
202 /// The gst-launch like bin description of the effect
203 ///
204 /// # Returns
205 ///
206 /// a newly created [`EffectClip`][crate::EffectClip], or
207 /// [`None`] if something went wrong.
208 #[doc(alias = "ges_effect_clip_new")]
209 pub fn new(
210 video_bin_description: Option<&str>,
211 audio_bin_description: Option<&str>,
212 ) -> Option<EffectClip> {
213 assert_initialized_main_thread!();
214 unsafe {
215 from_glib_none(ffi::ges_effect_clip_new(
216 video_bin_description.to_glib_none().0,
217 audio_bin_description.to_glib_none().0,
218 ))
219 }
220 }
221}
222
223/// Trait containing all [`struct@EffectClip`] methods.
224///
225/// # Implementors
226///
227/// [`EffectClip`][struct@crate::EffectClip]
228pub trait EffectClipExt: IsA<EffectClip> + 'static {
229 /// The description of the audio track of the effect bin with a gst-launch-style
230 /// pipeline description. This should be used for test purposes.
231 ///
232 /// Example: "audiopanorama panorama=1.0"
233 #[doc(alias = "audio-bin-description")]
234 fn audio_bin_description(&self) -> Option<glib::GString> {
235 ObjectExt::property(self.as_ref(), "audio-bin-description")
236 }
237
238 /// The description of the video track of the effect bin with a gst-launch-style
239 /// pipeline description. This should be used for test purposes.
240 ///
241 /// Example: "videobalance saturation=1.5 hue=+0.5"
242 #[doc(alias = "video-bin-description")]
243 fn video_bin_description(&self) -> Option<glib::GString> {
244 ObjectExt::property(self.as_ref(), "video-bin-description")
245 }
246}
247
248impl<O: IsA<EffectClip>> EffectClipExt for O {}