Debian Codegraph @

gstreamer/gstreamermm/ghostpad.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/ghostpad.h>
7 #include <gstreamermm/private/ghostpad_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 <sstream>
30 #include <gst/gst.h>
31 #include <gstreamermm/padtemplate.h>
32 #include <gstreamermm/handle_error.h>
33
34
35 namespace Gst
36 {
37
38 GhostPad::GhostPad(const Glib::RefPtr<Gst::Pad>& target,
39 const Glib::ustring& name)
40 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
41 Glib::ObjectBase(nullptr),
42 Pad(Glib::ConstructParams(ghostpad_class_.init(), "name",(name.empty() ? static_cast<char*>(0) : name.c_str()),"direction",(target ? ((GstPadDirection) target->get_direction()) : GST_PAD_UNKNOWN), nullptr))
43 {
44 if(!target)
45 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
46 " const Glib::RefPtr<Gst::Pad>&): "
47 "Failed to construct ghost pad (name = " + name + ") from null target.");
48
49 if(!gst_ghost_pad_construct(gobj()) ||
50 !gst_ghost_pad_set_target(gobj(), target->gobj()))
51 {
52 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
53 " const Glib::RefPtr<Gst::Pad>&): "
54 "Unsuccessful construction of ghost pad (name = " + name +
55 ", target = " + target->get_name() + ").");
56 }
57 }
58
59 GhostPad::GhostPad( PadDirection direction, const Glib::ustring& name)
60 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
61 Glib::ObjectBase(nullptr),
62 Pad(Glib::ConstructParams(ghostpad_class_.init(), "name",(name.empty() ? static_cast<char*>(0) : name.c_str()),"direction",static_cast<GstPadDirection>(direction), nullptr))
63 {
64 if(!gst_ghost_pad_construct(gobj()))
65 {
66 std::stringstream int_conv_stream;
67 int_conv_stream << direction;
68
69 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&, "
70 "PadDirection): Unsuccessful construction of ghost pad (name = " +
71 name + ", direction = " + int_conv_stream.str() + ").");
72 }
73 }
74
75 GhostPad::GhostPad( const Glib::RefPtr<Gst::Pad>& target,
76 const Glib::RefPtr<Gst::PadTemplate>& templ,
77 const Glib::ustring& name)
78 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
79 Glib::ObjectBase(nullptr),
80 Pad(Glib::ConstructParams(ghostpad_class_.init(), "name",(name.empty() ? static_cast<char*>(0) : name.c_str()),"direction",(target ? static_cast<GstPadDirection>(target->get_direction()) : GST_PAD_UNKNOWN),"template",Glib::unwrap(templ), nullptr))
81 {
82 if(!target || !templ)
83 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
84 " const Glib::RefPtr<Gst::Pad>&, const Glib::RefPtr<Gst::PadTemplate>&):"
85 " Failed to construct ghost pad (name = " + name + ") from null "
86 "target or template.");
87
88 if(!gst_ghost_pad_construct(gobj()) ||
89 !gst_ghost_pad_set_target(gobj(), target->gobj()))
90 {
91 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
92 " const Glib::RefPtr<Gst::Pad>&, const Glib::RefPtr<Gst::PadTemplate>&):"
93 " Unsuccessful construction of ghost pad (name = " + name +
94 ", target = " + target->get_name() + ", templ = " +
95 templ->get_name_template() + ").");
96 }
97 }
98
99 GhostPad::GhostPad( const Glib::RefPtr<Gst::PadTemplate>& templ,
100 const Glib::ustring& name)
101 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
102 Glib::ObjectBase(nullptr),
103 Pad(Glib::ConstructParams(ghostpad_class_.init(), "name",(name.empty() ? static_cast<char*>(0) : name.c_str()),"direction",(templ ? static_cast<GstPadDirection>(templ->get_direction()) : GST_PAD_UNKNOWN),"template",Glib::unwrap(templ), nullptr))
104 {
105 if(!templ)
106 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
107 " const Glib::RefPtr<Gst::PadTemplate>&): "
108 "Failed to construct ghost pad (name = " + name +
109 ") from null template.");
110
111 if(!gst_ghost_pad_construct(gobj()))
112 {
113 gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&,"
114 " const Glib::RefPtr<Gst::PadTemplate>&): "
115 "Unsuccessful construction of ghost pad (name = " + name +
116 ", templ = " + templ->get_name_template() + ").");
117 }
118 }
119
120 } //namespace Gst
121
122 namespace
123 {
124 } // anonymous namespace
125
126
127 namespace Glib
128 {
129
130 Glib::RefPtr<Gst::GhostPad> wrap(GstGhostPad* object, bool take_copy)
131 {
132 return Glib::RefPtr<Gst::GhostPad>( dynamic_cast<Gst::GhostPad*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
133 //We use dynamic_cast<> in case of multiple inheritance.
134 }
135
136 } /* namespace Glib */
137
138
139 namespace Gst
140 {
141
142
143 /* The *_Class implementation: */
144
145 const Glib::Class& GhostPad_Class::init()
146 {
147 if(!gtype_) // create the GType if necessary
148 {
149 // Glib::Class has to know the class init function to clone custom types.
150 class_init_func_ = &GhostPad_Class::class_init_function;
151
152 // This is actually just optimized away, apparently with no harm.
153 // Make sure that the parent type has been created.
154 //CppClassParent::CppObjectType::get_type();
155
156 // Create the wrapper type, with the same class/instance size as the base type.
157 register_derived_type(gst_ghost_pad_get_type());
158
159 // Add derived versions of interfaces, if the C type implements any interfaces:
160
161 }
162
163 return *this;
164 }
165
166
167 void GhostPad_Class::class_init_function(void* g_class, void* class_data)
168 {
169 const auto klass = static_cast<BaseClassType*>(g_class);
170 CppClassParent::class_init_function(klass, class_data);
171
172
173 }
174
175
176 Glib::ObjectBase* GhostPad_Class::wrap_new(GObject* object)
177 {
178 return new GhostPad((GstGhostPad*)object);
179 }
180
181
182 /* The implementation: */
183
184 GstGhostPad* GhostPad::gobj_copy()
185 {
186 reference();
187 return gobj();
188 }
189
190 GhostPad::GhostPad(const Glib::ConstructParams& construct_params)
191 :
192 Pad(construct_params)
193 {
194
195 }
196
197 GhostPad::GhostPad(GstGhostPad* castitem)
198 :
199 Pad((GstPad*)(castitem))
200 {}
201
202
203 GhostPad::GhostPad(GhostPad&& src) noexcept
204 : Pad(std::move(src))
205 {}
206
207 GhostPad& GhostPad::operator=(GhostPad&& src) noexcept
208 {
209 Pad::operator=(std::move(src));
210 return *this;
211 }
212
213
214 GhostPad::~GhostPad() noexcept
215 {}
216
217
218 GhostPad::CppClassType GhostPad::ghostpad_class_; // initialize static member
219
220 GType GhostPad::get_type()
221 {
222 return ghostpad_class_.init().get_type();
223 }
224
225
226 GType GhostPad::get_base_type()
227 {
228 return gst_ghost_pad_get_type();
229 }
230
231
232 Glib::RefPtr<GhostPad> GhostPad::create(const Glib::RefPtr<Gst::Pad>& target, const Glib::ustring& name)
233 {
234 return Glib::RefPtr<GhostPad>( new GhostPad(target, name) );
235 }
236
237 Glib::RefPtr<GhostPad> GhostPad::create(PadDirection dir, const Glib::ustring& name)
238 {
239 return Glib::RefPtr<GhostPad>( new GhostPad(dir, name) );
240 }
241
242 Glib::RefPtr<GhostPad> GhostPad::create(const Glib::RefPtr<Gst::Pad>& target, const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name)
243 {
244 return Glib::RefPtr<GhostPad>( new GhostPad(target, templ, name) );
245 }
246
247 Glib::RefPtr<GhostPad> GhostPad::create(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name)
248 {
249 return Glib::RefPtr<GhostPad>( new GhostPad(templ, name) );
250 }
251
252 bool GhostPad::set_target(const Glib::RefPtr<Gst::Pad>& newtarget)
253 {
254 return gst_ghost_pad_set_target(gobj(), Glib::unwrap(newtarget));
255 }
256
257 Glib::RefPtr<Gst::Pad> GhostPad::get_target()
258 {
259 return Glib::wrap(gst_ghost_pad_get_target(gobj()));
260 }
261
262 Glib::RefPtr<const Gst::Pad> GhostPad::get_target() const
263 {
264 return const_cast<GhostPad*>(this)->get_target();
265 }
266
267
268 } // namespace Gst
269
270