gstreamer_editing_services/auto/image_source.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, Extractable, MetaContainer, Source, TimelineElement, TrackElement, VideoSource};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 /// This won't be used anymore and has been replaced by
11 /// `GESUriSource` instead which now plugs an `imagefreeze` element when
12 /// `ges_uri_source_asset_is_image` returns [`true`].
13 /// Outputs the video stream from a given file as a still frame. The frame chosen
14 /// will be determined by the in-point property on the track element. For image
15 /// files, do not set the in-point property.
16 ///
17 /// ## Properties
18 ///
19 ///
20 /// #### `uri`
21 /// The location of the file/resource to use.
22 ///
23 /// Readable | Writeable | Construct Only
24 /// <details><summary><h4>TrackElement</h4></summary>
25 ///
26 ///
27 /// #### `active`
28 /// Whether the effect of the element should be applied in its
29 /// [`track`][struct@crate::TrackElement#track]. If set to [`false`], it will not be used in
30 /// the output of the track.
31 ///
32 /// Readable | Writeable
33 ///
34 ///
35 /// #### `auto-clamp-control-sources`
36 /// Whether the control sources on the element (see
37 /// [`TrackElementExt::set_control_source()`][crate::prelude::TrackElementExt::set_control_source()]) will be automatically
38 /// updated whenever the [`in-point`][struct@crate::TimelineElement#in-point] or out-point of the
39 /// element change in value.
40 ///
41 /// See [`TrackElementExt::clamp_control_source()`][crate::prelude::TrackElementExt::clamp_control_source()] for how this is done
42 /// per control source.
43 ///
44 /// Default value: [`true`]
45 ///
46 /// Readable | Writeable
47 ///
48 ///
49 /// #### `has-internal-source`
50 /// This property is used to determine whether the 'internal time'
51 /// properties of the element have any meaning. In particular, unless
52 /// this is set to [`true`], the [`in-point`][struct@crate::TimelineElement#in-point] and
53 /// [`max-duration`][struct@crate::TimelineElement#max-duration] can not be set to any value other
54 /// than the default 0 and `GST_CLOCK_TIME_NONE`, respectively.
55 ///
56 /// If an element has some *internal* *timed* source [`gst::Element`][crate::gst::Element] that it
57 /// reads stream data from as part of its function in a [`Track`][crate::Track], then
58 /// you'll likely want to set this to [`true`] to allow the
59 /// [`in-point`][struct@crate::TimelineElement#in-point] and [`max-duration`][struct@crate::TimelineElement#max-duration] to
60 /// be set.
61 ///
62 /// The default value is determined by the `GESTrackElementClass`
63 /// `default_has_internal_source` class property. For most
64 /// `GESSourceClass`-es, this will be [`true`], with the exception of those
65 /// that have a potentially *static* source, such as `GESImageSourceClass`
66 /// and `GESTitleSourceClass`. Otherwise, this will usually be [`false`].
67 ///
68 /// For most [`Operation`][crate::Operation]-s you will likely want to leave this set to
69 /// [`false`]. The exception may be for an operation that reads some stream
70 /// data from some private internal source as part of manipulating the
71 /// input data from the usual linked upstream [`TrackElement`][crate::TrackElement].
72 ///
73 /// For example, you may want to set this to [`true`] for a
74 /// [`TrackType::VIDEO`][crate::TrackType::VIDEO] operation that wraps a `textoverlay` that reads
75 /// from a subtitle file and places its text on top of the received video
76 /// data. The [`in-point`][struct@crate::TimelineElement#in-point] of the element would be used
77 /// to shift the initial seek time on the `textoverlay` away from 0, and
78 /// the [`max-duration`][struct@crate::TimelineElement#max-duration] could be set to reflect the
79 /// time at which the subtitle file runs out of data.
80 ///
81 /// Note that GES can not support track elements that have both internal
82 /// content and manipulate the timing of their data streams (time
83 /// effects).
84 ///
85 /// Readable | Writeable
86 ///
87 ///
88 /// #### `track`
89 /// The track that this element belongs to, or [`None`] if it does not
90 /// belong to a track.
91 ///
92 /// Readable
93 ///
94 ///
95 /// #### `track-type`
96 /// The track type of the element, which determines the type of track the
97 /// element can be added to (see [`track-type`][struct@crate::Track#track-type]). This should
98 /// correspond to the type of data that the element can produce or
99 /// process.
100 ///
101 /// Readable | Writeable | Construct
102 /// </details>
103 /// <details><summary><h4>TimelineElement</h4></summary>
104 ///
105 ///
106 /// #### `duration`
107 /// The duration that the element is in effect for in the timeline (a
108 /// time difference in nanoseconds using the time coordinates of the
109 /// timeline). For example, for a source element, this would determine
110 /// for how long it should output its internal content for. For an
111 /// operation element, this would determine for how long its effect
112 /// should be applied to any source content.
113 ///
114 /// Readable | Writeable
115 ///
116 ///
117 /// #### `in-point`
118 /// The initial offset to use internally when outputting content (in
119 /// nanoseconds, but in the time coordinates of the internal content).
120 ///
121 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
122 /// file, the "internal content" is the media file data, and the
123 /// in-point would correspond to some timestamp in the media file.
124 /// When playing the timeline, and when the element is first reached at
125 /// timeline-time [`start`][struct@crate::TimelineElement#start], it will begin outputting the
126 /// data from the timestamp in-point **onwards**, until it reaches the
127 /// end of its [`duration`][struct@crate::TimelineElement#duration] in the timeline.
128 ///
129 /// For elements that have no internal content, this should be kept
130 /// as 0.
131 ///
132 /// Readable | Writeable
133 ///
134 ///
135 /// #### `max-duration`
136 /// The full duration of internal content that is available (a time
137 /// difference in nanoseconds using the time coordinates of the internal
138 /// content).
139 ///
140 /// This will act as a cap on the [`in-point`][struct@crate::TimelineElement#in-point] of the
141 /// element (which is in the same time coordinates), and will sometimes
142 /// be used to limit the [`duration`][struct@crate::TimelineElement#duration] of the element in
143 /// the timeline.
144 ///
145 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
146 /// file, this would be the length of the media file.
147 ///
148 /// For elements that have no internal content, or whose content is
149 /// indefinite, this should be kept as `GST_CLOCK_TIME_NONE`.
150 ///
151 /// Readable | Writeable | Construct
152 ///
153 ///
154 /// #### `name`
155 /// The name of the element. This should be unique within its timeline.
156 ///
157 /// Readable | Writeable | Construct
158 ///
159 ///
160 /// #### `parent`
161 /// The parent container of the element.
162 ///
163 /// Readable | Writeable
164 ///
165 ///
166 /// #### `priority`
167 /// The priority of the element.
168 ///
169 /// Readable | Writeable
170 ///
171 ///
172 /// #### `serialize`
173 /// Whether the element should be serialized.
174 ///
175 /// Readable | Writeable
176 ///
177 ///
178 /// #### `start`
179 /// The starting position of the element in the timeline (in nanoseconds
180 /// and in the time coordinates of the timeline). For example, for a
181 /// source element, this would determine the time at which it should
182 /// start outputting its internal content. For an operation element, this
183 /// would determine the time at which it should start applying its effect
184 /// to any source content.
185 ///
186 /// Readable | Writeable
187 ///
188 ///
189 /// #### `timeline`
190 /// The timeline that the element lies within.
191 ///
192 /// Readable | Writeable
193 /// </details>
194 ///
195 /// # Implements
196 ///
197 /// [`ImageSourceExt`][trait@crate::prelude::ImageSourceExt], [`VideoSourceExt`][trait@crate::prelude::VideoSourceExt], [`SourceExt`][trait@crate::prelude::SourceExt], [`TrackElementExt`][trait@crate::prelude::TrackElementExt], [`TimelineElementExt`][trait@crate::prelude::TimelineElementExt], [`trait@glib::ObjectExt`], [`ExtractableExt`][trait@crate::prelude::ExtractableExt], [`MetaContainerExt`][trait@crate::prelude::MetaContainerExt], [`TimelineElementExtManual`][trait@crate::prelude::TimelineElementExtManual]
198 #[doc(alias = "GESImageSource")]
199 pub struct ImageSource(Object<ffi::GESImageSource, ffi::GESImageSourceClass>) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
200
201 match fn {
202 type_ => || ffi::ges_image_source_get_type(),
203 }
204}
205
206impl ImageSource {
207 pub const NONE: Option<&'static ImageSource> = None;
208}
209
210/// Trait containing all [`struct@ImageSource`] methods.
211///
212/// # Implementors
213///
214/// [`ImageSource`][struct@crate::ImageSource]
215pub trait ImageSourceExt: IsA<ImageSource> + 'static {
216 /// The location of the file/resource to use.
217 fn uri(&self) -> Option<glib::GString> {
218 ObjectExt::property(self.as_ref(), "uri")
219 }
220}
221
222impl<O: IsA<ImageSource>> ImageSourceExt for O {}