Debian Codegraph @

gstreamer/gstreamermm/plugin.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/plugin.h>
7 #include <gstreamermm/private/plugin_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 #include <gstreamermm/structure.h>
31
32
33 namespace
34 {
35
36 extern "C"
37 {
38
39 gboolean Plugin_Init_gstreamermm_callback(GstPlugin* plugin, void* data)
40 {
41 Gst::Plugin::SlotInit* the_slot = static_cast<Gst::Plugin::SlotInit*>(data);
42 bool result = false;
43
44 try
45 {
46 result = (*the_slot)(Glib::wrap(plugin, true));
47 delete the_slot;
48 return result;
49 }
50 catch(...)
51 {
52 Glib::exception_handlers_invoke();
53 }
54
55 return false;
56 }
57
58 } // extern "C"
59
60 } // anonymous namespace
61
62 namespace Gst
63 {
64
65 bool Plugin::register_static(int major_version, int minor_version,
66 const Glib::ustring& name, const Glib::ustring& description,
67 const SlotInit& init_slot, const Glib::ustring& version,
68 const Glib::ustring& license, const Glib::ustring& source,
69 const Glib::ustring& package, const Glib::ustring& origin)
70 {
71 SlotInit* slot_copy = new SlotInit(init_slot);
72
73 return gst_plugin_register_static_full(major_version, minor_version,
74 name.c_str(), const_cast<char*>(description.c_str()),
75 &Plugin_Init_gstreamermm_callback, version.c_str(), license.c_str(),
76 source.c_str(), package.c_str(), origin.c_str(), slot_copy);
77 }
78
79 } //namespace Gst
80
81 namespace
82 {
83 } // anonymous namespace
84
85 // static
86 GType Glib::Value<Gst::PluginDependencyFlags>::value_type()
87 {
88 return gst_plugin_dependency_flags_get_type();
89 }
90
91 // static
92 GType Glib::Value<Gst::PluginFlags>::value_type()
93 {
94 return gst_plugin_flags_get_type();
95 }
96
97
98 Gst::PluginError::PluginError(Gst::PluginError::Code error_code, const Glib::ustring& error_message)
99 :
100 Glib::Error (GST_PLUGIN_ERROR, error_code, error_message)
101 {}
102
103 Gst::PluginError::PluginError(GError* gobject)
104 :
105 Glib::Error (gobject)
106 {}
107
108 Gst::PluginError::Code Gst::PluginError::code() const
109 {
110 return static_cast<Code>(Glib::Error::code());
111 }
112
113 void Gst::PluginError::throw_func(GError* gobject)
114 {
115 throw Gst::PluginError(gobject);
116 }
117
118 // static
119 GType Glib::Value<Gst::PluginError::Code>::value_type()
120 {
121 return gst_plugin_error_get_type();
122 }
123
124
125 namespace Glib
126 {
127
128 Glib::RefPtr<Gst::Plugin> wrap(GstPlugin* object, bool take_copy)
129 {
130 return Glib::RefPtr<Gst::Plugin>( dynamic_cast<Gst::Plugin*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
131 //We use dynamic_cast<> in case of multiple inheritance.
132 }
133
134 } /* namespace Glib */
135
136
137 namespace Gst
138 {
139
140
141 /* The *_Class implementation: */
142
143 const Glib::Class& Plugin_Class::init()
144 {
145 if(!gtype_) // create the GType if necessary
146 {
147 // Glib::Class has to know the class init function to clone custom types.
148 class_init_func_ = &Plugin_Class::class_init_function;
149
150 // This is actually just optimized away, apparently with no harm.
151 // Make sure that the parent type has been created.
152 //CppClassParent::CppObjectType::get_type();
153
154 // Create the wrapper type, with the same class/instance size as the base type.
155 register_derived_type(gst_plugin_get_type());
156
157 // Add derived versions of interfaces, if the C type implements any interfaces:
158
159 }
160
161 return *this;
162 }
163
164
165 void Plugin_Class::class_init_function(void* g_class, void* class_data)
166 {
167 const auto klass = static_cast<BaseClassType*>(g_class);
168 CppClassParent::class_init_function(klass, class_data);
169
170
171 }
172
173
174 Glib::ObjectBase* Plugin_Class::wrap_new(GObject* object)
175 {
176 return new Plugin((GstPlugin*)object);
177 }
178
179
180 /* The implementation: */
181
182 GstPlugin* Plugin::gobj_copy()
183 {
184 reference();
185 return gobj();
186 }
187
188 Plugin::Plugin(const Glib::ConstructParams& construct_params)
189 :
190 Object(construct_params)
191 {
192
193 }
194
195 Plugin::Plugin(GstPlugin* castitem)
196 :
197 Object((GstObject*)(castitem))
198 {}
199
200
201 Plugin::Plugin(Plugin&& src) noexcept
202 : Object(std::move(src))
203 {}
204
205 Plugin& Plugin::operator=(Plugin&& src) noexcept
206 {
207 Object::operator=(std::move(src));
208 return *this;
209 }
210
211
212 Plugin::~Plugin() noexcept
213 {}
214
215
216 Plugin::CppClassType Plugin::plugin_class_; // initialize static member
217
218 GType Plugin::get_type()
219 {
220 return plugin_class_.init().get_type();
221 }
222
223
224 GType Plugin::get_base_type()
225 {
226 return gst_plugin_get_type();
227 }
228
229
230 Glib::QueryQuark Plugin::error_quark()
231 {
232 return Glib::QueryQuark(gst_plugin_error_quark());
233 }
234
235 Glib::ustring Plugin::get_name() const
236 {
237 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_name(const_cast<GstPlugin*>(gobj())));
238 }
239
240 Glib::ustring Plugin::get_description() const
241 {
242 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_description(const_cast<GstPlugin*>(gobj())));
243 }
244
245 Glib::ustring Plugin::get_filename() const
246 {
247 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_filename(const_cast<GstPlugin*>(gobj())));
248 }
249
250 Glib::ustring Plugin::get_license() const
251 {
252 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_license(const_cast<GstPlugin*>(gobj())));
253 }
254
255 Glib::ustring Plugin::get_package() const
256 {
257 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_package(const_cast<GstPlugin*>(gobj())));
258 }
259
260 Glib::ustring Plugin::get_origin() const
261 {
262 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_origin(const_cast<GstPlugin*>(gobj())));
263 }
264
265 Glib::ustring Plugin::get_source() const
266 {
267 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_source(const_cast<GstPlugin*>(gobj())));
268 }
269
270 Glib::ustring Plugin::get_version() const
271 {
272 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_version(const_cast<GstPlugin*>(gobj())));
273 }
274
275 Glib::ustring Plugin::get_release_date_string() const
276 {
277 return Glib::convert_const_gchar_ptr_to_ustring(gst_plugin_get_release_date_string(const_cast<GstPlugin*>(gobj())));
278 }
279
280 bool Plugin::is_loaded() const
281 {
282 return gst_plugin_is_loaded(const_cast<GstPlugin*>(gobj()));
283 }
284
285 Gst::Structure Plugin::get_cache_data() const
286 {
287 return Glib::wrap(const_cast<GstStructure*>(gst_plugin_get_cache_data(const_cast<GstPlugin*>(gobj()))), true);
288 }
289
290 void Plugin::set_cache_data(Gst::Structure& cache_data)
291 {
292 gst_plugin_set_cache_data(gobj(), cache_data.gobj());
293 }
294
295 Glib::RefPtr<Gst::Plugin> Plugin::load_file(const Glib::ustring& filename)
296 {
297 GError* gerror = nullptr;
298 Glib::RefPtr<Gst::Plugin> retvalue = Glib::wrap(gst_plugin_load_file(filename.c_str(), &(gerror)));
299 if(gerror)
300 ::Glib::Error::throw_exception(gerror);
301 return retvalue;
302 }
303
304 Glib::RefPtr<Gst::Plugin> Plugin::load()
305 {
306 return Glib::wrap(gst_plugin_load(gobj()));
307 }
308
309 Glib::RefPtr<Gst::Plugin> Plugin::load_by_name(const Glib::ustring& name)
310 {
311 return Glib::wrap(gst_plugin_load_by_name(name.c_str()));
312 }
313
314 void Plugin::add_dependency(const Glib::StringArrayHandle& env_vars, const Glib::StringArrayHandle& paths, const Glib::StringArrayHandle& names, Gst::PluginDependencyFlags flags)
315 {
316 gst_plugin_add_dependency(gobj(), const_cast<const char**>(env_vars.data()), const_cast<const char**>(paths.data()), const_cast<const char**>(names.data()), ((GstPluginDependencyFlags)(flags)));
317 }
318
319 void Plugin::add_dependency(const Glib::ustring& env_vars, const Glib::ustring& paths, const Glib::ustring& names, Gst::PluginDependencyFlags flags)
320 {
321 gst_plugin_add_dependency_simple(gobj(), env_vars.c_str(), paths.c_str(), names.c_str(), ((GstPluginDependencyFlags)(flags)));
322 }
323
324
325 } // namespace Gst
326
327