Debian Codegraph @

gstreamer/gstreamermm/padtemplate.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_PADTEMPLATE_H
3 #define _GSTREAMERMM_PADTEMPLATE_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2008-2016 The gstreamermm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28 #include <gst/gst.h>
29 #include <gstreamermm/object.h>
30 #include <gstreamermm/pad.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 using GstPadTemplate = struct _GstPadTemplate;
35 using GstPadTemplateClass = struct _GstPadTemplateClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 namespace Gst
41 { class PadTemplate_Class; } // namespace Gst
42 #endif //DOXYGEN_SHOULD_SKIP_THIS
43
44 namespace Gst
45 {
46
47 /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */
48
49 /**
50 * @var PadTemplateFlags PAD_TEMPLATE_FLAG_LAST
51 * First flag that can be used by subclasses.
52 *
53 * @enum PadTemplateFlags
54 *
55 * Flags for the padtemplate
56 *
57 * @ingroup gstreamermmEnums
58 * @par Bitwise operators:
59 * <tt>%PadTemplateFlags operator|(PadTemplateFlags, PadTemplateFlags)</tt><br>
60 * <tt>%PadTemplateFlags operator&(PadTemplateFlags, PadTemplateFlags)</tt><br>
61 * <tt>%PadTemplateFlags operator^(PadTemplateFlags, PadTemplateFlags)</tt><br>
62 * <tt>%PadTemplateFlags operator~(PadTemplateFlags)</tt><br>
63 * <tt>%PadTemplateFlags& operator|=(PadTemplateFlags&, PadTemplateFlags)</tt><br>
64 * <tt>%PadTemplateFlags& operator&=(PadTemplateFlags&, PadTemplateFlags)</tt><br>
65 * <tt>%PadTemplateFlags& operator^=(PadTemplateFlags&, PadTemplateFlags)</tt><br>
66 */
67 enum PadTemplateFlags
68 {
69 PAD_TEMPLATE_FLAG_LAST = 0x100
70 };
71
72 /** @ingroup gstreamermmEnums */
73 inline PadTemplateFlags operator|(PadTemplateFlags lhs, PadTemplateFlags rhs)
74 { return static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
75
76 /** @ingroup gstreamermmEnums */
77 inline PadTemplateFlags operator&(PadTemplateFlags lhs, PadTemplateFlags rhs)
78 { return static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
79
80 /** @ingroup gstreamermmEnums */
81 inline PadTemplateFlags operator^(PadTemplateFlags lhs, PadTemplateFlags rhs)
82 { return static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
83
84 /** @ingroup gstreamermmEnums */
85 inline PadTemplateFlags operator~(PadTemplateFlags flags)
86 { return static_cast<PadTemplateFlags>(~static_cast<unsigned>(flags)); }
87
88 /** @ingroup gstreamermmEnums */
89 inline PadTemplateFlags& operator|=(PadTemplateFlags& lhs, PadTemplateFlags rhs)
90 { return (lhs = static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
91
92 /** @ingroup gstreamermmEnums */
93 inline PadTemplateFlags& operator&=(PadTemplateFlags& lhs, PadTemplateFlags rhs)
94 { return (lhs = static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
95
96 /** @ingroup gstreamermmEnums */
97 inline PadTemplateFlags& operator^=(PadTemplateFlags& lhs, PadTemplateFlags rhs)
98 { return (lhs = static_cast<PadTemplateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
99
100 } // namespace Gst
101
102 #ifndef DOXYGEN_SHOULD_SKIP_THIS
103 namespace Glib
104 {
105
106 template <>
107 class Value<Gst::PadTemplateFlags> : public Glib::Value_Flags<Gst::PadTemplateFlags>
108 {
109 public:
110 static GType value_type() G_GNUC_CONST;
111 };
112
113 } // namespace Glib
114 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
115
116 namespace Gst
117 {
118
119 /**
120 * @var PadPresence PAD_ALWAYS
121 * The pad is always available.
122 *
123 * @var PadPresence PAD_SOMETIMES
124 * The pad will become available depending on the media stream.
125 *
126 * @var PadPresence PAD_REQUEST
127 * The pad is only available on request with
128 * Gst::Element::request_pad().
129 *
130 * @enum PadPresence
131 *
132 * Indicates when this pad will become available.
133 *
134 * @ingroup gstreamermmEnums
135 */
136 enum PadPresence
137 {
138 PAD_ALWAYS,
139 PAD_SOMETIMES,
140 PAD_REQUEST
141 };
142
143 } // namespace Gst
144
145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
146 namespace Glib
147 {
148
149 template <>
150 class Value<Gst::PadPresence> : public Glib::Value_Enum<Gst::PadPresence>
151 {
152 public:
153 static GType value_type() G_GNUC_CONST;
154 };
155
156 } // namespace Glib
157 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
158
159 namespace Gst
160 {
161
162
163 class Caps;
164 class Pad;
165
166 /** A class that describes the media type of a pad.
167 * Padtemplates describe the possible media types a pad or an elementfactory
168 * can handle. This allows for both inspection of handled types before loading
169 * the element plugin as well as identifying pads on elements that are not yet
170 * created (request or sometimes pads).
171 *
172 * Gst::Pad and PadTemplates have Gst::Caps attached to it to describe the
173 * media type they are capable of dealing with. get_caps() is used to get the
174 * caps of a padtemplate. It's not possible to modify the caps of a padtemplate
175 * after creation.
176 *
177 * PadTemplates have a Gst::PadPresence property which identifies the lifetime
178 * of the pad and that can be retrieved with get_presence(). Also the direction
179 * of the pad can be retrieved from the GstPadTemplate with get_direction().
180 *
181 * The get_name_template() method is important for Gst::PAD_REQUEST pads
182 * because it has to be used as the name in the
183 * Gst::Element::get_request_pad() call to instantiate a pad from this
184 * template.
185 *
186 * Padtemplates can be created with create().
187
188 * A padtemplate can be used to create a pad (see Gst::Pad::create() methods).
189 *
190 * Last reviewed on 2016-06-06 (1.8.0)
191 */
192
193 class PadTemplate : public Object
194 {
195
196 #ifndef DOXYGEN_SHOULD_SKIP_THIS
197
198 public:
199 using CppObjectType = PadTemplate;
200 using CppClassType = PadTemplate_Class;
201 using BaseObjectType = GstPadTemplate;
202 using BaseClassType = GstPadTemplateClass;
203
204 // noncopyable
205 PadTemplate(const PadTemplate&) = delete;
206 PadTemplate& operator=(const PadTemplate&) = delete;
207
208 private: friend class PadTemplate_Class;
209 static CppClassType padtemplate_class_;
210
211 protected:
212 explicit PadTemplate(const Glib::ConstructParams& construct_params);
213 explicit PadTemplate(GstPadTemplate* castitem);
214
215 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
216
217 public:
218
219 PadTemplate(PadTemplate&& src) noexcept;
220 PadTemplate& operator=(PadTemplate&& src) noexcept;
221
222 ~PadTemplate() noexcept override;
223
224 /** Get the GType for this class, for use with the underlying GObject type system.
225 */
226 static GType get_type() G_GNUC_CONST;
227
228 #ifndef DOXYGEN_SHOULD_SKIP_THIS
229
230
231 static GType get_base_type() G_GNUC_CONST;
232 #endif
233
234 ///Provides access to the underlying C GObject.
235 GstPadTemplate* gobj() { return reinterpret_cast<GstPadTemplate*>(gobject_); }
236
237 ///Provides access to the underlying C GObject.
238 const GstPadTemplate* gobj() const { return reinterpret_cast<GstPadTemplate*>(gobject_); }
239
240 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
241 GstPadTemplate* gobj_copy();
242
243 private:
244
245
246 protected:
247 explicit PadTemplate(const Glib::ustring& name_template, PadDirection direction, PadPresence presence, const Glib::RefPtr<Gst::Caps>& caps);
248
249
250 public:
251 /** Creates a new pad template with a name according to the given template
252 * and with the given arguments. This functions takes ownership of the
253 * provided caps, so be sure to not use them afterwards.
254 *
255 * @param name_template The name template.
256 * @param direction The Gst::PadDirection of the template.
257 * @param presence The Gst::PadPresence of the pad.
258 * @param caps A Gst::Caps set for the template. The caps are taken ownership
259 * of.
260 * @return A new Gst::PadTemplate.
261 */
262
263 static Glib::RefPtr<PadTemplate> create(const Glib::ustring& name_template, PadDirection direction, PadPresence presence, const Glib::RefPtr<Gst::Caps>& caps);
264
265
266 /** Gets the capabilities of the pad template.
267 *
268 * @return The Gst::Caps of the pad template.
269 * Unref after usage.
270 */
271 Glib::RefPtr<Gst::Caps> get_caps();
272
273 /** Gets the capabilities of the pad template.
274 *
275 * @return The Gst::Caps of the pad template.
276 * Unref after usage.
277 */
278 Glib::RefPtr<const Gst::Caps> get_caps() const;
279
280 /** Get the nametemplate of the padtemplate.
281 */
282 Glib::ustring get_name_template() const;
283
284 /** Get the Gst::PadDirection of the padtemplate.
285 */
286 PadDirection get_direction() const;
287
288 /** Get the Gst::PadPresence of the padtemplate.
289 */
290 PadPresence get_presence() const;
291
292 /** The capabilities of the pad described by the pad template.
293 *
294 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
295 * or receive notification when the value of the property changes.
296 */
297 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> > property_caps() const;
298
299
300 /** The direction of the pad described by the pad template.
301 *
302 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
303 * or receive notification when the value of the property changes.
304 */
305 Glib::PropertyProxy_ReadOnly< Gst::PadDirection > property_direction() const;
306
307
308 /** The name template of the pad template.
309 *
310 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
311 * or receive notification when the value of the property changes.
312 */
313 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name_template() const;
314
315
316 /** When the pad described by the pad template will become available.
317 *
318 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
319 * or receive notification when the value of the property changes.
320 */
321 Glib::PropertyProxy_ReadOnly< Gst::PadPresence > property_presence() const;
322
323
324 /**
325 * @par Slot Prototype:
326 * <tt>void on_my_%pad_created(const Glib::RefPtr<Gst::Pad>& pad)</tt>
327 *
328 * This signal is fired when an element creates a pad from this template.
329 *
330 * @param pad The pad that was created.
331 */
332
333 Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& > signal_pad_created();
334
335
336 //gst_pad_template_pad_created emits the "pad-created" signal. It seems
337 //internal to C API (it is not found in API docs) so ignore it.
338
339
340 public:
341
342 public:
343 //C++ methods used to invoke GTK+ virtual functions:
344
345 protected:
346 //GTK+ Virtual Functions (override these to change behaviour):
347
348 //Default Signal Handlers::
349 /// This is a default handler for the signal signal_pad_created().
350 virtual void on_pad_created(const Glib::RefPtr<Gst::Pad>& pad);
351
352
353 };
354
355
356 class StaticPadTemplate
357 {
358 public:
359 #ifndef DOXYGEN_SHOULD_SKIP_THIS
360 using CppObjectType = StaticPadTemplate;
361 using BaseObjectType = GstStaticPadTemplate;
362 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
363
364 StaticPadTemplate(const StaticPadTemplate& other) noexcept;
365 StaticPadTemplate& operator=(const StaticPadTemplate& other) noexcept;
366
367 StaticPadTemplate(StaticPadTemplate&& other) noexcept;
368 StaticPadTemplate& operator=(StaticPadTemplate&& other) noexcept;
369
370 /** Get the GType for this class, for use with the underlying GObject type system.
371 */
372 static GType get_type() G_GNUC_CONST;
373
374 StaticPadTemplate();
375
376 explicit StaticPadTemplate(const GstStaticPadTemplate* gobject); // always takes a copy
377
378 ///Provides access to the underlying C instance.
379 GstStaticPadTemplate* gobj() { return &gobject_; }
380
381 ///Provides access to the underlying C instance.
382 const GstStaticPadTemplate* gobj() const { return &gobject_; }
383
384 protected:
385 GstStaticPadTemplate gobject_;
386
387 private:
388
389
390 public:
391
392
393 /** Gets the capabilities of the static pad template.
394 *
395 * @return The Gst::Caps of the static pad template.
396 * Unref after usage. Since the core holds an additional
397 * ref to the returned caps, use gst_caps_make_writable()
398 * on the returned caps to modify it.
399 */
400 Glib::RefPtr<Gst::Caps> get_caps();
401
402 /** Gets the capabilities of the static pad template.
403 *
404 * @return The Gst::Caps of the static pad template.
405 * Unref after usage. Since the core holds an additional
406 * ref to the returned caps, use gst_caps_make_writable()
407 * on the returned caps to modify it.
408 */
409 Glib::RefPtr<const Gst::Caps> get_caps() const;
410
411
412 /** Converts a Gst::StaticPadTemplate into a Gst::PadTemplate.
413 *
414 * @return A new Gst::PadTemplate.
415 */
416 Glib::RefPtr<Gst::PadTemplate> get();
417
418 /** Get the nametemplate of the padtemplate.
419 */
420 Glib::ustring get_name_template() const;
421
422 /** Get the Gst::PadDirection of the padtemplate.
423 */
424 PadDirection get_direction() const;
425
426 /** Get the Gst::PadPresence of the padtemplate.
427 */
428 PadPresence get_presence() const;
429
430
431 };
432
433 #ifndef DOXYGEN_SHOULD_SKIP_THIS
434 struct StaticPadTemplateTraits
435 {
436 typedef const Gst::StaticPadTemplate CppType;
437 typedef const GstStaticPadTemplate * CType;
438 typedef GstStaticPadTemplate * CTypeNonConst;
439
440 static CType to_c_type (CppType& obj) { return obj.gobj(); }
441 static CType to_c_type (CType ptr) { return ptr; }
442 static CppType to_cpp_type (CType ptr)
443 {
444 return CppType(const_cast<CTypeNonConst>(ptr));
445 }
446
447 static void release_c_type (CType)
448 {
449 }
450 };
451 #endif //DOXYGEN_SHOULD_SKIP_THIS
452
453 } //namespace Gst
454
455
456 namespace Glib
457 {
458 /** A Glib::wrap() method for this object.
459 *
460 * @param object The C instance.
461 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
462 * @result A C++ instance that wraps this C instance.
463 *
464 * @relates Gst::PadTemplate
465 */
466 Glib::RefPtr<Gst::PadTemplate> wrap(GstPadTemplate* object, bool take_copy = false);
467 }
468
469
470 namespace Glib
471 {
472
473 /** @relates Gst::StaticPadTemplate
474 * @param object The C instance
475 * @result A C++ instance that wraps this C instance.
476 */
477 Gst::StaticPadTemplate& wrap(GstStaticPadTemplate* object);
478
479 /** @relates Gst::StaticPadTemplate
480 * @param object The C instance
481 * @result A C++ instance that wraps this C instance.
482 */
483 const Gst::StaticPadTemplate& wrap(const GstStaticPadTemplate* object);
484
485 #ifndef DOXYGEN_SHOULD_SKIP_THIS
486 template <>
487 class Value<Gst::StaticPadTemplate> : public Glib::Value_Boxed<Gst::StaticPadTemplate>
488 {};
489 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
490
491 } // namespace Glib
492
493
494 #endif /* _GSTREAMERMM_PADTEMPLATE_H */
495