Debian Codegraph @

gstreamer/src/urihandler.ccg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <gst/gst.h>
21 #include <gstreamermm/element.h>
22
23 namespace Gst
24 {
25
26 URIType URIHandler::get_type_vfunc()
27 {
28 BaseClassType *const base = static_cast<BaseClassType*>(
29 g_type_interface_peek_parent(
30 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type())
31 ) );
32
33 if(base && base->get_type)
34 {
35 return static_cast<URIType>((*base->get_type)(CppObjectType::get_type()));
36 }
37
38 return URIType();
39 }
40
41 GstURIType URIHandler_Class::get_type_vfunc_callback(GType type)
42 {
43 gpointer self = g_object_new(type, nullptr);
44 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
45 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
46
47 if(obj_base && obj_base->is_derived_())
48 {
49 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
50 if(obj)
51 {
52 #ifdef GLIBMM_EXCEPTIONS_ENABLED
53 try
54 {
55 #endif //GLIBMM_EXCEPTIONS_ENABLED
56 return static_cast<GstURIType>(obj->get_type_vfunc());
57 #ifdef GLIBMM_EXCEPTIONS_ENABLED
58 }
59 catch(...)
60 {
61 Glib::exception_handlers_invoke();
62 }
63 #endif //GLIBMM_EXCEPTIONS_ENABLED
64 }
65 }
66
67 BaseClassType *const base = static_cast<BaseClassType*>(
68 g_type_interface_peek_parent(
69 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type())
70 ) );
71
72 if(base && base->get_type)
73 {
74 return (*base->get_type)(type);
75 }
76
77 return GstURIType();
78 }
79
80 const gchar * const * URIHandler::get_protocols_vfunc() const
81 {
82 BaseClassType *const base = static_cast<BaseClassType*>(
83 g_type_interface_peek_parent(
84 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type())
85 ) );
86
87 if(base && base->get_protocols)
88 {
89 return (*base->get_protocols)(CppObjectType::get_type());
90 }
91 static const gchar* protocols[] = {nullptr};
92 return protocols;
93 }
94
95 const gchar * const * URIHandler_Class::get_protocols_vfunc_callback(GType type)
96 {
97 gpointer self = g_object_new(type, nullptr);
98 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
99 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
100
101 if(obj_base && obj_base->is_derived_())
102 {
103 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
104 if(obj)
105 {
106 #ifdef GLIBMM_EXCEPTIONS_ENABLED
107 try
108 {
109 #endif //GLIBMM_EXCEPTIONS_ENABLED
110 return obj->get_protocols_vfunc();
111 #ifdef GLIBMM_EXCEPTIONS_ENABLED
112 }
113 catch(...)
114 {
115 Glib::exception_handlers_invoke();
116 }
117 #endif //GLIBMM_EXCEPTIONS_ENABLED
118 }
119 }
120
121 BaseClassType *const base = static_cast<BaseClassType*>(
122 g_type_interface_peek_parent(
123 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type())
124 ) );
125
126 if(base && base->get_protocols)
127 {
128 return (*base->get_protocols)(type);
129 }
130 static const gchar *protocols[] = { nullptr };
131 return protocols;
132 }
133 }