Debian Codegraph @

gstreamer/gstreamermm/segment.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/segment.h>
7 #include <gstreamermm/private/segment_p.h>
8
9
10 /* gstreamermm - a C++ wrapper for gstreamer
11 *
12 * Copyright 2008-2016 The gstreamermm Development Team
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29 #include <gst/gst.h>
30
31 namespace Gst
32 {
33
34 void Segment::set_seek(double rate, Format format, SeekFlags flags,
35 SeekType start_type, gint64 start, SeekType stop_type, gint64 stop,
36 bool& update)
37 {
38 gboolean gst_update = 0;
39
40 gst_segment_do_seek(gobj(), rate, static_cast<GstFormat>(format),
41 static_cast<GstSeekFlags>(flags), static_cast<GstSeekType>(start_type),
42 start, static_cast<GstSeekType>(stop_type), stop, &gst_update);
43
44 update = gst_update;
45 }
46
47 } // namespace Gst
48
49 namespace
50 {
51 } // anonymous namespace
52
53 // static
54 GType Glib::Value<Gst::SeekFlags>::value_type()
55 {
56 return gst_seek_flags_get_type();
57 }
58
59 // static
60 GType Glib::Value<Gst::SeekType>::value_type()
61 {
62 return gst_seek_type_get_type();
63 }
64
65
66 namespace Glib
67 {
68
69 Gst::Segment wrap(GstSegment* object, bool take_copy)
70 {
71 return Gst::Segment(object, take_copy);
72 }
73
74 } // namespace Glib
75
76
77 namespace Gst
78 {
79
80
81 // static
82 GType Segment::get_type()
83 {
84 return gst_segment_get_type();
85 }
86
87 Segment::Segment()
88 :
89 gobject_ (gst_segment_new())
90 {}
91
92 Segment::Segment(const Segment& other)
93 :
94 gobject_ ((other.gobject_) ? gst_segment_copy(other.gobject_) : nullptr)
95 {}
96
97 Segment::Segment(Segment&& other) noexcept
98 :
99 gobject_(other.gobject_)
100 {
101 other.gobject_ = nullptr;
102 }
103
104 Segment& Segment::operator=(Segment&& other) noexcept
105 {
106 Segment temp (other);
107 swap(temp);
108 return *this;
109 }
110
111 Segment::Segment(GstSegment* gobject, bool make_a_copy)
112 :
113 // For BoxedType wrappers, make_a_copy is true by default. The static
114 // BoxedType wrappers must always take a copy, thus make_a_copy = true
115 // ensures identical behaviour if the default argument is used.
116 gobject_ ((make_a_copy && gobject) ? gst_segment_copy(gobject) : gobject)
117 {}
118
119 Segment& Segment::operator=(const Segment& other)
120 {
121 Segment temp (other);
122 swap(temp);
123 return *this;
124 }
125
126 Segment::~Segment() noexcept
127 {
128 if(gobject_)
129 gst_segment_free(gobject_);
130 }
131
132 void Segment::swap(Segment& other) noexcept
133 {
134 std::swap(gobject_, other.gobject_);
135 }
136
137 GstSegment* Segment::gobj_copy() const
138 {
139 return gst_segment_copy(gobject_);
140 }
141
142
143 bool Segment::clip(Format format, guint64 start, guint64 stop, guint64& clip_start, guint64& clip_stop) const
144 {
145 return gst_segment_clip(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), start, stop, &(clip_start), &(clip_stop));
146 }
147
148 void Segment::init(Format format)
149 {
150 gst_segment_init(gobj(), ((GstFormat)(format)));
151 }
152
153 guint64 Segment::to_running_time(Format format, guint64 position) const
154 {
155 return gst_segment_to_running_time(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), position);
156 }
157
158 int Segment::to_running_time(Format format, guint64 position, guint64& running_time) const
159 {
160 return gst_segment_to_running_time_full(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), position, &(running_time));
161 }
162
163 guint64 Segment::to_stream_time(Format format, guint64 position) const
164 {
165 return gst_segment_to_stream_time(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), position);
166 }
167
168 int Segment::to_stream_time(Format format, guint64 position, guint64& stream_time) const
169 {
170 return gst_segment_to_stream_time_full(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), position, &(stream_time));
171 }
172
173 guint64 Segment::to_position(Format format, guint64 running_time) const
174 {
175 return gst_segment_to_position(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), running_time);
176 }
177
178 bool Segment::set_running_time(Format format, guint64 running_time)
179 {
180 return gst_segment_set_running_time(gobj(), ((GstFormat)(format)), running_time);
181 }
182
183 guint64 Segment::position_from_running_time(Gst::Format format, guint64 running_time) const
184 {
185 return gst_segment_position_from_running_time(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), running_time);
186 }
187
188 int Segment::position_from_running_time(Gst::Format format, guint64 running_time, guint64& position) const
189 {
190 return gst_segment_position_from_running_time_full(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), running_time, &(position));
191 }
192
193 guint64 Segment::position_from_stream_time(Gst::Format format, guint64 stream_time) const
194 {
195 return gst_segment_position_from_stream_time(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), stream_time);
196 }
197
198 int Segment::position_from_stream_time(Gst::Format format, guint64 stream_time, guint64& position) const
199 {
200 return gst_segment_position_from_stream_time_full(const_cast<GstSegment*>(gobj()), ((GstFormat)(format)), stream_time, &(position));
201 }
202
203 bool Segment::offset_running_time(Gst::Format format, gint64 offset)
204 {
205 return gst_segment_offset_running_time(gobj(), ((GstFormat)(format)), offset);
206 }
207
208 bool Segment::is_equal(const Gst::Segment& s2) const
209 {
210 return gst_segment_is_equal(const_cast<GstSegment*>(gobj()), s2.gobj());
211 }
212
213
214 } // namespace Gst
215
216