Debian Codegraph @

gstreamer/gstreamermm/typefind.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/typefind.h>
7 #include <gstreamermm/private/typefind_p.h>
8
9 #include <cstring> // std::memset()
10
11 /* gstreamermm - a C++ wrapper for gstreamer
12 *
13 * Copyright 2009 The gstreamermm Development Team
14 *
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30 #include <gst/gst.h>
31 #include <gstreamermm/caps.h>
32 #include <gstreamermm/plugin.h>
33
34 namespace
35 {
36
37 extern "C"
38 {
39
40 static void TypeFind_Find_gstreamermm_callback(GstTypeFind*, void* data)
41 {
42 Gst::TypeFind::SlotFind& slot_find = *static_cast<Gst::TypeFind::SlotFind*>(data);
43
44 try
45 {
46 slot_find();
47 }
48 catch (...)
49 {
50 Glib::exception_handlers_invoke();
51 }
52 }
53
54 static void TypeFind_Find_gstreamermm_callback_destroy(void* data)
55 {
56 delete static_cast<Gst::TypeFind::SlotFind*>(data);
57 }
58
59 } // extern "C"
60
61 } // anonymous namespace
62
63 namespace Gst
64 {
65
66 bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
67 const Glib::ustring& name, guint rank, const SlotFind& find_slot,
68 const Glib::StringArrayHandle& extensions,
69 const Glib::RefPtr<const Gst::Caps>& caps)
70 {
71 SlotFind* slot_copy = new SlotFind(find_slot);
72 return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
73 &TypeFind_Find_gstreamermm_callback,
74 (gchar*)extensions.data(), const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy,
75 &TypeFind_Find_gstreamermm_callback_destroy);
76 }
77
78 bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
79 const Glib::ustring& name, guint rank, const SlotFind& find_slot,
80 const Glib::RefPtr<const Gst::Caps>& caps)
81 {
82 SlotFind* slot_copy = new SlotFind(find_slot);
83 return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
84 &TypeFind_Find_gstreamermm_callback, nullptr, const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy,
85 &TypeFind_Find_gstreamermm_callback_destroy);
86 }
87
88 bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
89 const Glib::ustring& name, guint rank, const SlotFind& find_slot,
90 const Glib::StringArrayHandle& extensions)
91 {
92 SlotFind* slot_copy = new SlotFind(find_slot);
93 return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
94 &TypeFind_Find_gstreamermm_callback,
95 (gchar*)extensions.data(), nullptr, slot_copy,
96 &TypeFind_Find_gstreamermm_callback_destroy);
97 }
98
99 bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
100 const Glib::ustring& name, guint rank, const SlotFind& find_slot)
101 {
102 SlotFind* slot_copy = new SlotFind(find_slot);
103 return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
104 &TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy,
105 &TypeFind_Find_gstreamermm_callback_destroy);
106 }
107
108 bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
109 const SlotFind& find_slot, const Glib::StringArrayHandle& extensions,
110 const Glib::RefPtr<const Gst::Caps>& caps)
111 {
112 SlotFind* slot_copy = new SlotFind(find_slot);
113 return gst_type_find_register(nullptr, name.c_str(), rank,
114 &TypeFind_Find_gstreamermm_callback,
115 (gchar*)extensions.data(), const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy,
116 &TypeFind_Find_gstreamermm_callback_destroy);
117 }
118
119 bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
120 const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps)
121 {
122 SlotFind* slot_copy = new SlotFind(find_slot);
123 return gst_type_find_register(nullptr, name.c_str(), rank,
124 &TypeFind_Find_gstreamermm_callback, nullptr, const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy,
125 &TypeFind_Find_gstreamermm_callback_destroy);
126 }
127
128 bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
129 const SlotFind& find_slot, const Glib::StringArrayHandle& extensions)
130 {
131 SlotFind* slot_copy = new SlotFind(find_slot);
132 return gst_type_find_register(nullptr, name.c_str(), rank,
133 &TypeFind_Find_gstreamermm_callback,
134 (gchar*)extensions.data(), nullptr, slot_copy,
135 &TypeFind_Find_gstreamermm_callback_destroy);
136 }
137
138 bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
139 const SlotFind& find_slot)
140 {
141 SlotFind* slot_copy = new SlotFind(find_slot);
142 return gst_type_find_register(nullptr, name.c_str(), rank,
143 &TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy,
144 &TypeFind_Find_gstreamermm_callback_destroy);
145 }
146
147 } // namespace Gst
148
149 namespace
150 {
151 } // anonymous namespace
152
153 // static
154 GType Glib::Value<Gst::TypeFindProbability>::value_type()
155 {
156 return gst_type_find_probability_get_type();
157 }
158
159
160 namespace Glib
161 {
162
163 Gst::TypeFind& wrap(GstTypeFind* object)
164 {
165 return *reinterpret_cast<Gst::TypeFind*>(object);
166 }
167
168 const Gst::TypeFind& wrap(const GstTypeFind* object)
169 {
170 return *reinterpret_cast<const Gst::TypeFind*>(object);
171 }
172
173 } // namespace Glib
174
175
176 namespace Gst
177 {
178
179
180 TypeFind::TypeFind(const TypeFind& other) noexcept
181 :
182 gobject_(other.gobject_)
183 {
184 }
185
186 TypeFind& TypeFind::operator=(const TypeFind& other) noexcept
187 {
188 gobject_ = other.gobject_;
189 return *this;
190 }
191
192 TypeFind::TypeFind(TypeFind&& other) noexcept
193 :
194 gobject_(std::move(other.gobject_))
195 {
196 //We could wipe other.gobject_ via memset,
197 //but that is not really necessary:
198 //other.gobject_ = nullptr;
199 }
200
201 TypeFind& TypeFind::operator=(TypeFind&& other) noexcept
202 {
203 gobject_ = std::move(other.gobject_);
204 return *this;
205 }
206
207 // static
208 GType TypeFind::get_type()
209 {
210 return gst_type_find_get_type();
211 }
212
213 TypeFind::TypeFind()
214 {
215 std::memset(&gobject_, 0, sizeof(GstTypeFind));
216 }
217
218 TypeFind::TypeFind(const GstTypeFind* gobject)
219 {
220 if(gobject)
221 gobject_ = *gobject;
222 else
223 std::memset(&gobject_, 0, sizeof(GstTypeFind));
224 }
225
226
227 std::vector<guint8> TypeFind::peek(gint64 offset, guint size) const
228 {
229 return Glib::ArrayHandler<guint8>::array_to_vector(gst_type_find_peek(const_cast<GstTypeFind*>(gobj()), offset, size), Glib::OWNERSHIP_NONE);
230 }
231
232 void TypeFind::suggest(guint probability, const Glib::RefPtr<const Gst::Caps>& caps) const
233 {
234 gst_type_find_suggest(const_cast<GstTypeFind*>(gobj()), probability, const_cast<GstCaps*>(Glib::unwrap(caps)));
235 }
236
237 guint64 TypeFind::get_length() const
238 {
239 return gst_type_find_get_length(const_cast<GstTypeFind*>(gobj()));
240 }
241
242
243 } // namespace Gst
244
245