Debian Codegraph @

gstreamer/gstreamermm/audioinfo.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/audioinfo.h>
7 #include <gstreamermm/private/audioinfo_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 <gstreamermm/caps.h>
30 #include <gstreamermm/handle_error.h>
31
32 namespace Gst
33 {
34
35 AudioInfo::AudioInfo(const Glib::RefPtr<const Gst::Caps>& caps)
36 : AudioInfo()
37 {
38 if (!from_caps(caps))
39 {
40 gstreamermm_handle_error(
41 "Gst::AudioInfo::AudioInfo(const Glib::RefPtr<const Gst::Caps>&): "
42 "Failed to construct Gst::AudioInfo from caps: " + caps->to_string());
43
44 }
45 }
46
47 }
48
49 namespace
50 {
51 } // anonymous namespace
52
53 // static
54 GType Glib::Value<Gst::AudioFlags>::value_type()
55 {
56 return gst_audio_flags_get_type();
57 }
58
59 // static
60 GType Glib::Value<Gst::AudioLayout>::value_type()
61 {
62 return gst_audio_layout_get_type();
63 }
64
65
66 namespace Glib
67 {
68
69 Gst::AudioInfo wrap(GstAudioInfo* object, bool take_copy)
70 {
71 return Gst::AudioInfo(object, take_copy);
72 }
73
74 } // namespace Glib
75
76
77 namespace Gst
78 {
79
80
81 // static
82 GType AudioInfo::get_type()
83 {
84 return gst_audio_info_get_type();
85 }
86
87 AudioInfo::AudioInfo()
88 :
89 gobject_ (gst_audio_info_new())
90 {}
91
92 AudioInfo::AudioInfo(const AudioInfo& other)
93 :
94 gobject_ ((other.gobject_) ? gst_audio_info_copy(other.gobject_) : nullptr)
95 {}
96
97 AudioInfo::AudioInfo(AudioInfo&& other) noexcept
98 :
99 gobject_(other.gobject_)
100 {
101 other.gobject_ = nullptr;
102 }
103
104 AudioInfo& AudioInfo::operator=(AudioInfo&& other) noexcept
105 {
106 AudioInfo temp (other);
107 swap(temp);
108 return *this;
109 }
110
111 AudioInfo::AudioInfo(GstAudioInfo* 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_audio_info_copy(gobject) : gobject)
117 {}
118
119 AudioInfo& AudioInfo::operator=(const AudioInfo& other)
120 {
121 AudioInfo temp (other);
122 swap(temp);
123 return *this;
124 }
125
126 AudioInfo::~AudioInfo() noexcept
127 {
128 if(gobject_)
129 gst_audio_info_free(gobject_);
130 }
131
132 void AudioInfo::swap(AudioInfo& other) noexcept
133 {
134 std::swap(gobject_, other.gobject_);
135 }
136
137 GstAudioInfo* AudioInfo::gobj_copy() const
138 {
139 return gst_audio_info_copy(gobject_);
140 }
141
142
143 bool AudioInfo::is_equal(const Gst::AudioInfo& other) const
144 {
145 return gst_audio_info_is_equal(const_cast<GstAudioInfo*>(gobj()), other.gobj());
146 }
147
148 void AudioInfo::init()
149 {
150 gst_audio_info_init(gobj());
151 }
152
153 bool AudioInfo::from_caps(const Glib::RefPtr<const Gst::Caps>& caps)
154 {
155 return gst_audio_info_from_caps(gobj(), Glib::unwrap(caps));
156 }
157
158 Glib::RefPtr<Gst::Caps> AudioInfo::to_caps() const
159 {
160 return Glib::wrap(gst_audio_info_to_caps(const_cast<GstAudioInfo*>(gobj())));
161 }
162
163 bool AudioInfo::convert(Gst::Format fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val) const
164 {
165 return gst_audio_info_convert(const_cast<GstAudioInfo*>(gobj()), ((GstFormat)(fmt)), src_val, ((GstFormat)(dest_fmt)), &(dest_val));
166 }
167
168 void AudioInfo::set_format(Gst::AudioFormat format, int rate, int channels, const Gst::AudioChannelPosition * position)
169 {
170 gst_audio_info_set_format(gobj(), ((GstAudioFormat)(format)), rate, channels, reinterpret_cast<const GstAudioChannelPosition*>(position));
171 }
172
173 Gst::AudioFlags AudioInfo::get_flags() const
174 {
175 return ((Gst::AudioFlags)(gobj()->flags));
176 }
177
178 void AudioInfo::set_flags(const Gst::AudioFlags& value)
179 {
180 gobj()->flags = ((GstAudioFlags)(value));
181 }
182
183 Gst::AudioLayout AudioInfo::get_layout() const
184 {
185 return ((Gst::AudioLayout)(gobj()->layout));
186 }
187
188 void AudioInfo::set_layout(const Gst::AudioLayout& value)
189 {
190 gobj()->layout = ((GstAudioLayout)(value));
191 }
192
193 int AudioInfo::get_rate() const
194 {
195 return gobj()->rate;
196 }
197
198 void AudioInfo::set_rate(const int& value)
199 {
200 gobj()->rate = value;
201 }
202
203 int AudioInfo::get_channels() const
204 {
205 return gobj()->channels;
206 }
207
208 void AudioInfo::set_channels(const int& value)
209 {
210 gobj()->channels = value;
211 }
212
213 int AudioInfo::get_bpf() const
214 {
215 return gobj()->bpf;
216 }
217
218 void AudioInfo::set_bpf(const int& value)
219 {
220 gobj()->bpf = value;
221 }
222
223 const Gst::AudioFormatInfo AudioInfo::get_finfo() const
224 {
225 return Gst::AudioFormatInfo(gobj()->finfo);
226 }
227
228
229 } // namespace Gst
230
231