10 #include "include/mm_sound_mgr_focus_dbus.h"
11 #include "include/mm_sound_mgr_focus_ipc.h"
12 #include "../include/mm_sound_dbus.h"
15 #define BUS_NAME_FOCUS_SERVER "org.tizen.FocusServer"
16 #define OBJECT_FOCUS_SERVER "/org/tizen/FocusServer1"
17 #define INTERFACE_FOCUS_SERVER "org.tizen.FocusServer1"
19 /* Introspection data for the service we are exporting */
20 static const gchar introspection_xml[] =
22 " <interface name='org.tizen.FocusServer1'>"
23 " <method name='GetUniqueId'>"
24 " <arg name='id' type='i' direction='out'/>"
26 " <method name='RegisterFocus'>"
27 " <arg name='pid' type='i' direction='in'/>"
28 " <arg name='handle_id' type='i' direction='in'/>"
29 " <arg name='stream_type' type='s' direction='in'/>"
30 " <arg name='is_for_session' type='b' direction='in'/>"
32 " <method name='UnregisterFocus'>"
33 " <arg name='pid' type='i' direction='in'/>"
34 " <arg name='handle_id' type='i' direction='in'/>"
35 " <arg name='is_for_session' type='b' direction='in'/>"
37 " <method name='SetFocusReacquisition'>"
38 " <arg name='pid' type='i' direction='in'/>"
39 " <arg name='handle_id' type='i' direction='in'/>"
40 " <arg name='reacquisition' type='b' direction='in'/>"
41 " <arg name='is_for_session' type='b' direction='in'/>"
43 " <method name='GetAcquiredFocusStreamType'>"
44 " <arg name='focus_type' type='i' direction='in'/>"
45 " <arg name='stream_type' type='s' direction='out'/>"
46 " <arg name='option' type='i' direction='out'/>"
47 " <arg name='ext_info' type='s' direction='out'/>"
49 " <method name='AcquireFocus'>"
50 " <arg name='pid' type='i' direction='in'/>"
51 " <arg name='handle_id' type='i' direction='in'/>"
52 " <arg name='focus_type' type='i' direction='in'/>"
53 " <arg name='option' type='i' direction='in'/>"
54 " <arg name='ext_info' type='s' direction='in'/>"
55 " <arg name='is_for_session' type='b' direction='in'/>"
57 " <method name='ReleaseFocus'>"
58 " <arg name='pid' type='i' direction='in'/>"
59 " <arg name='handle_id' type='i' direction='in'/>"
60 " <arg name='focus_type' type='i' direction='in'/>"
61 " <arg name='option' type='i' direction='in'/>"
62 " <arg name='ext_info' type='s' direction='in'/>"
63 " <arg name='is_for_session' type='b' direction='in'/>"
65 " <method name='WatchFocus'>"
66 " <arg name='pid' type='i' direction='in'/>"
67 " <arg name='handle_id' type='i' direction='in'/>"
68 " <arg name='focus_type' type='i' direction='in'/>"
69 " <arg name='is_for_session' type='b' direction='in'/>"
71 " <method name='UnwatchFocus'>"
72 " <arg name='pid' type='i' direction='in'/>"
73 " <arg name='handle_id' type='i' direction='in'/>"
74 " <arg name='is_for_session' type='b' direction='in'/>"
76 " <method name='EmergentExitFocus'>"
77 " <arg name='pid' type='i' direction='in'/>"
81 static GDBusConnection* conn_g;
83 typedef void (*dbus_method_handler)(GDBusMethodInvocation *invocation);
84 typedef int (*dbus_signal_sender)(GDBusConnection *conn, GVariant *parameter);
86 struct mm_sound_mgr_focus_dbus_method{
87 struct mm_sound_dbus_method_info info;
88 dbus_method_handler handler;
91 struct mm_sound_mgr_focus_dbus_signal{
92 struct mm_sound_dbus_signal_info info;
93 dbus_signal_sender sender;
96 static void handle_method_get_unique_id(GDBusMethodInvocation* invocation);
97 static void handle_method_register_focus(GDBusMethodInvocation* invocation);
98 static void handle_method_unregister_focus(GDBusMethodInvocation* invocation);
99 static void handle_method_set_focus_reacquisition(GDBusMethodInvocation* invocation);
100 static void handle_method_get_acquired_focus_stream_type(GDBusMethodInvocation* invocation);
101 static void handle_method_acquire_focus(GDBusMethodInvocation* invocation);
102 static void handle_method_release_focus(GDBusMethodInvocation* invocation);
103 static void handle_method_watch_focus(GDBusMethodInvocation* invocation);
104 static void handle_method_unwatch_focus(GDBusMethodInvocation* invocation);
106 /* Currently , Just using method's name and handler */
107 /* TODO : generate introspection xml automatically, with these value include argument and reply */
108 /* TODO : argument check with these information */
109 /* TODO : divide object and interface with features (ex. play, path, device, focus, asm) */
110 static mm_sound_dbus_method_intf_t methods[AUDIO_METHOD_MAX] = {
111 [AUDIO_METHOD_GET_UNIQUE_ID] = {
113 .name = "GetUniqueId",
115 .handler = handle_method_get_unique_id
117 [AUDIO_METHOD_REGISTER_FOCUS] = {
119 .name = "RegisterFocus",
121 .handler = handle_method_register_focus
123 [AUDIO_METHOD_UNREGISTER_FOCUS] = {
125 .name = "UnregisterFocus",
127 .handler = handle_method_unregister_focus
129 [AUDIO_METHOD_SET_FOCUS_REACQUISITION] = {
131 .name = "SetFocusReacquisition",
133 .handler = handle_method_set_focus_reacquisition
135 [AUDIO_METHOD_GET_ACQUIRED_FOCUS_STREAM_TYPE] = {
137 .name = "GetAcquiredFocusStreamType",
139 .handler = handle_method_get_acquired_focus_stream_type
141 [AUDIO_METHOD_ACQUIRE_FOCUS] = {
143 .name = "AcquireFocus",
145 .handler = handle_method_acquire_focus
147 [AUDIO_METHOD_RELEASE_FOCUS] = {
149 .name = "ReleaseFocus",
151 .handler = handle_method_release_focus
153 [AUDIO_METHOD_WATCH_FOCUS] = {
155 .name = "WatchFocus",
157 .handler = handle_method_watch_focus
159 [AUDIO_METHOD_UNWATCH_FOCUS] = {
161 .name = "UnwatchFocus",
163 .handler = handle_method_unwatch_focus
167 static GDBusNodeInfo *introspection_data = NULL;
168 guint focus_server_owner_id ;
169 unsigned emergent_exit_subs_id;
172 For pass error code with 'g_dbus_method_invocation_return_error'
173 We have to use some glib features like GError, GQuark
175 /* Only For error types which is currently being used in server-side */
176 static const GDBusErrorEntry mm_sound_error_entries[] =
178 {MM_ERROR_OUT_OF_MEMORY, "org.tizen.multimedia.OutOfMemory"},
179 {MM_ERROR_OUT_OF_STORAGE, "org.tizen.multimedia.OutOfStorage"},
180 {MM_ERROR_INVALID_ARGUMENT, "org.tizen.multimedia.InvalidArgument"},
181 {MM_ERROR_POLICY_INTERNAL, "org.tizen.multimedia.PolicyInternal"},
182 {MM_ERROR_NOT_SUPPORT_API, "org.tizen.multimedia.NotSupportAPI"},
183 {MM_ERROR_POLICY_BLOCKED, "org.tizen.multimedia.PolicyBlocked"},
184 {MM_ERROR_END_OF_FILE, "org.tizen.multimedia.EndOfFile"},
185 {MM_ERROR_COMMON_OUT_OF_RANGE, "org.tizen.multimedia.common.OutOfRange"},
186 {MM_ERROR_COMMON_UNKNOWN, "org.tizen.multimedia.common.Unknown"},
187 {MM_ERROR_COMMON_NO_FREE_SPACE, "org.tizen.multimedia.common.NoFreeSpace"},
188 {MM_ERROR_SOUND_INTERNAL, "org.tizen.multimedia.audio.Internal"},
189 {MM_ERROR_SOUND_INVALID_STATE, "org.tizen.multimedia.audio.InvalidState"},
190 {MM_ERROR_SOUND_NO_FREE_SPACE, "org.tizen.multimedia.audio.NoFreeSpace"},
191 {MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE, "org.tizen.multimedia.audio.UnsupportedMediaType"},
192 {MM_ERROR_SOUND_INVALID_POINTER, "org.tizen.multimedia.audio.InvalidPointer"},
193 {MM_ERROR_SOUND_INVALID_FILE, "org.tizen.multimedia.audio.InvalidFile"},
194 {MM_ERROR_SOUND_FILE_NOT_FOUND, "org.tizen.multimedia.audio.FileNotFound"},
195 {MM_ERROR_SOUND_NO_DATA, "org.tizen.multimedia.audio.NoData"},
196 {MM_ERROR_SOUND_INVALID_PATH, "org.tizen.multimedia.audio.InvalidPath"},
199 static const char* _convert_error_code(int err_code)
203 for (i = 0; i < G_N_ELEMENTS(mm_sound_error_entries); i++) {
204 if (err_code == mm_sound_error_entries[i].error_code) {
205 return mm_sound_error_entries[i].dbus_error_name;
209 return "org.tizen.multimedia.common.Unknown";
212 static int _get_sender_pid(GDBusMethodInvocation* invocation)
217 GDBusConnection * connection = NULL;
220 connection = g_dbus_method_invocation_get_connection(invocation);
221 sender = g_dbus_method_invocation_get_sender(invocation);
223 debug_msg("connection = %p, sender = %s", connection, sender);
225 value = g_dbus_connection_call_sync(connection, "org.freedesktop.DBus", "/org/freedesktop/DBus",
226 "org.freedesktop.DBus", "GetConnectionUnixProcessID",
227 g_variant_new("(s)", sender, NULL), NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err);
229 g_variant_get(value, "(u)", &pid);
230 debug_msg("Sender PID = [%d]", pid);
231 g_variant_unref(value);
233 debug_error("err code = %d, err msg = %s", err->code, err->message);
238 static void _method_call_return_value(GDBusMethodInvocation *invocation, GVariant *params)
240 const char *method_name;
241 method_name = g_dbus_method_invocation_get_method_name(invocation);
242 debug_msg("Method Call '%s' success", method_name);
243 g_dbus_method_invocation_return_value(invocation, params);
245 static void _method_call_return_error(GDBusMethodInvocation *invocation, int ret)
247 const char *err_name, *method_name;
248 err_name = _convert_error_code(ret);
249 method_name = g_dbus_method_invocation_get_method_name(invocation);
250 debug_error("Method Call '%s' failed, err '%s(%X)'", method_name, err_name, ret);
251 g_dbus_method_invocation_return_dbus_error(invocation, err_name, "failed");
254 static void handle_method_get_unique_id(GDBusMethodInvocation* invocation)
256 static int unique_id = 0;
260 _method_call_return_value(invocation, g_variant_new("(i)", ++unique_id));
265 static void handle_method_register_focus(GDBusMethodInvocation* invocation)
267 int ret = MM_ERROR_NONE;
269 const char* stream_type = NULL;
270 gboolean is_for_session;
271 GVariant *params = NULL;
276 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
277 debug_error("Parameter for Method is NULL");
278 ret = MM_ERROR_SOUND_INTERNAL;
282 g_variant_get(params, "(ii&sb)", &pid, &handle_id, &stream_type, &is_for_session);
283 ret = __mm_sound_mgr_focus_ipc_register_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, stream_type, is_for_session);
286 if (ret == MM_ERROR_NONE) {
287 _method_call_return_value(invocation, g_variant_new("()"));
289 _method_call_return_error(invocation, ret);
295 static void handle_method_unregister_focus(GDBusMethodInvocation* invocation)
297 int ret = MM_ERROR_NONE;
298 int pid = 0, handle_id = 0;
299 gboolean is_for_session;
300 GVariant *params = NULL;
304 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
305 debug_error("Parameter for Method is NULL");
306 ret = MM_ERROR_SOUND_INTERNAL;
310 g_variant_get(params, "(iib)", &pid, &handle_id, &is_for_session);
311 ret = __mm_sound_mgr_focus_ipc_unregister_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, is_for_session);
314 if (ret == MM_ERROR_NONE) {
315 _method_call_return_value(invocation, g_variant_new("()"));
317 _method_call_return_error(invocation, ret);
323 static void handle_method_set_focus_reacquisition(GDBusMethodInvocation* invocation)
325 int ret = MM_ERROR_NONE;
326 int pid = 0, handle_id = 0;
327 gboolean reacquisition;
328 gboolean is_for_session;
329 GVariant *params = NULL;
333 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
334 debug_error("Parameter for Method is NULL");
335 ret = MM_ERROR_SOUND_INTERNAL;
339 g_variant_get(params, "(iibb)", &pid, &handle_id, &reacquisition, &is_for_session);
340 ret = __mm_sound_mgr_focus_ipc_set_focus_reacquisition(_get_sender_pid(invocation), handle_id, reacquisition, is_for_session);
343 if (ret == MM_ERROR_NONE) {
344 _method_call_return_value(invocation, g_variant_new("()"));
346 _method_call_return_error(invocation, ret);
352 static void handle_method_get_acquired_focus_stream_type(GDBusMethodInvocation* invocation)
354 int ret = MM_ERROR_NONE;
356 char *stream_type = NULL;
358 char *ext_info = NULL;
359 GVariant *params = NULL;
363 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
364 debug_error("Parameter for Method is NULL");
365 ret = MM_ERROR_SOUND_INTERNAL;
369 g_variant_get(params, "(i)", &focus_type);
370 ret = __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(focus_type, &stream_type, &option, &ext_info);
373 if (ret == MM_ERROR_NONE) {
374 _method_call_return_value(invocation, g_variant_new("(sis)", stream_type, option, ext_info));
376 _method_call_return_error(invocation, ret);
382 static void handle_method_acquire_focus(GDBusMethodInvocation* invocation)
384 int ret = MM_ERROR_NONE;
385 int pid = 0, handle_id = 0, focus_type = 0, option = 0;
386 const char* ext_info = NULL;
387 gboolean is_for_session;
388 GVariant *params = NULL;
392 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
393 debug_error("Parameter for Method is NULL");
394 ret = MM_ERROR_SOUND_INTERNAL;
398 g_variant_get(params, "(iiiisb)", &pid, &handle_id, &focus_type, &option, &ext_info, &is_for_session);
399 ret = __mm_sound_mgr_focus_ipc_acquire_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, option, ext_info, is_for_session);
402 if (ret == MM_ERROR_NONE) {
403 _method_call_return_value(invocation, g_variant_new("()"));
405 _method_call_return_error(invocation, ret);
411 static void handle_method_release_focus(GDBusMethodInvocation* invocation)
413 int ret = MM_ERROR_NONE;
414 int pid = 0, handle_id = 0, focus_type = 0, option = 0;
415 const char* ext_info = NULL;
416 gboolean is_for_session;
417 GVariant *params = NULL;
421 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
422 debug_error("Parameter for Method is NULL");
423 ret = MM_ERROR_SOUND_INTERNAL;
427 g_variant_get(params, "(iiiisb)", &pid, &handle_id, &focus_type, &option, &ext_info, &is_for_session);
428 ret = __mm_sound_mgr_focus_ipc_release_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, option, ext_info, is_for_session);
431 if (ret == MM_ERROR_NONE) {
432 _method_call_return_value(invocation, g_variant_new("()"));
434 _method_call_return_error(invocation, ret);
440 static void handle_method_watch_focus(GDBusMethodInvocation* invocation)
442 int ret = MM_ERROR_NONE;
443 int handle_id = 0, focus_type = 0;
444 gboolean is_for_session;
445 GVariant *params = NULL;
450 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
451 debug_error("Parameter for Method is NULL");
452 ret = MM_ERROR_SOUND_INTERNAL;
456 g_variant_get(params, "(iiib)", &pid, &handle_id, &focus_type, &is_for_session);
457 ret = __mm_sound_mgr_focus_ipc_watch_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, is_for_session);
460 if (ret == MM_ERROR_NONE) {
461 _method_call_return_value(invocation, g_variant_new("()"));
463 _method_call_return_error(invocation, ret);
469 static void handle_method_unwatch_focus(GDBusMethodInvocation* invocation)
471 int ret = MM_ERROR_NONE;
474 gboolean is_for_session;
475 GVariant *params = NULL;
479 if (!(params = g_dbus_method_invocation_get_parameters(invocation))) {
480 debug_error("Parameter for Method is NULL");
481 ret = MM_ERROR_SOUND_INTERNAL;
485 g_variant_get(params, "(iib)", &pid, &handle_id, &is_for_session);
486 ret = __mm_sound_mgr_focus_ipc_unwatch_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id);
489 if (ret == MM_ERROR_NONE) {
490 _method_call_return_value(invocation, g_variant_new("()"));
492 _method_call_return_error(invocation, ret);
498 /**********************************************************************************/
499 static void handle_method_call(GDBusConnection *connection,
501 const gchar *object_path,
502 const gchar *interface_name,
503 const gchar *method_name,
504 GVariant *parameters,
505 GDBusMethodInvocation *invocation,
511 debug_error("Parameter Null");
514 debug_msg("Method Call, obj : %s, intf : %s, method : %s", object_path, interface_name, method_name);
516 for (method_idx = AUDIO_METHOD_GET_UNIQUE_ID; method_idx < AUDIO_METHOD_MAX; method_idx++) {
517 if (!g_strcmp0(method_name, methods[method_idx].info.name)) {
518 methods[method_idx].handler(invocation);
524 static GVariant* handle_get_property(GDBusConnection *connection,
526 const gchar *object_path,
527 const gchar *interface_name,
528 const gchar *property_name,
532 debug_log("Get Property, obj : %s, intf : %s, prop : %s", object_path, interface_name, property_name);
536 static gboolean handle_set_property(GDBusConnection *connection,
538 const gchar *object_path,
539 const gchar *interface_name,
540 const gchar *property_name,
545 debug_log("Set Property, obj : %s, intf : %s, prop : %s", object_path, interface_name, property_name);
549 void emergent_exit_signal_handler(audio_event_t event, GVariant *param, void *userdata)
551 int ret = MM_ERROR_NONE;
554 if (event != AUDIO_EVENT_EMERGENT_EXIT)
559 g_variant_get(param, "(i)", &pid);
560 debug_log("emergent exit : pid %d", pid);
561 ret = __mm_sound_mgr_focus_ipc_emergent_exit(pid);
563 debug_error("__mm_sound_mgr_focus_ipc_emergent_exit failed : 0x%x", ret);
568 static const GDBusInterfaceVTable interface_vtable =
575 static void on_bus_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
578 debug_log("Bus Acquired (%s)", name);
581 reg_id = g_dbus_connection_register_object(connection,
583 introspection_data->interfaces[0],
589 debug_error("Register object(%s) failed", OBJECT_FOCUS_SERVER);
594 static void on_name_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
596 debug_log("Name Acquired (%s)", name);
599 static void on_name_lost(GDBusConnection *connection, const gchar *name, gpointer user_data)
601 debug_log("Name Lost (%s)", name);
604 static int _mm_sound_mgr_focus_dbus_own_name(GBusType bus_type, const char* wellknown_name, guint* owner_id)
608 debug_msg("Own name (%s) for focus-server", wellknown_name);
610 oid = g_bus_own_name(bus_type, wellknown_name, G_BUS_NAME_OWNER_FLAGS_NONE,
611 on_bus_acquired, on_name_acquired, on_name_lost, NULL, NULL);
613 debug_error("Dbus own name failed");
614 return MM_ERROR_SOUND_INTERNAL;
619 debug_msg("OwnerID (%d) for focus-server", *owner_id);
621 return MM_ERROR_NONE;
624 static void _mm_sound_mgr_focus_dbus_unown_name(guint oid)
626 debug_msg("Unown name for focus-server [%d]", oid);
628 g_bus_unown_name(oid);
632 #define PA_BUS_NAME "org.pulseaudio.Server"
633 #define PA_STREAM_MANAGER_OBJECT_PATH "/org/pulseaudio/StreamManager"
634 #define PA_STREAM_MANAGER_INTERFACE "org.pulseaudio.StreamManager"
635 #define PA_STREAM_MANAGER_METHOD_NAME_GET_STREAM_LIST "GetStreamList"
636 int __mm_sound_mgr_focus_dbus_get_stream_list(stream_list_t* stream_list)
638 int ret = MM_ERROR_NONE;
639 GVariant *result = NULL;
640 GVariant *child = NULL;
641 GDBusConnection *conn = NULL;
645 conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
647 LOGE("g_bus_get_sync() error (%s)", err->message);
649 ret = MM_ERROR_SOUND_INTERNAL;
652 result = g_dbus_connection_call_sync(conn,
654 PA_STREAM_MANAGER_OBJECT_PATH,
655 PA_STREAM_MANAGER_INTERFACE,
656 PA_STREAM_MANAGER_METHOD_NAME_GET_STREAM_LIST,
658 G_VARIANT_TYPE("(vv)"),
659 G_DBUS_CALL_FLAGS_NONE,
663 if (!result && err) {
664 debug_error("g_dbus_connection_call_sync() error (%s)", err->message);
665 ret = MM_ERROR_SOUND_INTERNAL;
668 GVariant *item = NULL;
669 child = g_variant_get_child_value(result, 0);
670 item = g_variant_get_variant(child);
673 g_variant_iter_init(&iter, item);
674 while ((i < AVAIL_STREAMS_MAX) && g_variant_iter_loop(&iter, "&s", &name)) {
675 debug_log("name : %s", name);
676 stream_list->stream_types[i++] = strdup(name);
678 g_variant_unref(item);
679 g_variant_unref(child);
681 child = g_variant_get_child_value(result, 1);
682 item = g_variant_get_variant(child);
685 g_variant_iter_init(&iter, item);
686 while ((i < AVAIL_STREAMS_MAX) && g_variant_iter_loop(&iter, "i", &priority)) {
687 debug_log("priority : %d", priority);
688 stream_list->priorities[i++] = priority;
690 g_variant_unref(item);
691 g_variant_unref(child);
693 g_variant_unref(result);
695 g_object_unref(conn);
700 int MMSoundMgrFocusDbusInit(void)
704 introspection_data = g_dbus_node_info_new_for_xml(introspection_xml, NULL);
705 if (!introspection_data)
706 return MM_ERROR_SOUND_INTERNAL;
708 if (_mm_sound_mgr_focus_dbus_own_name(G_BUS_TYPE_SYSTEM, BUS_NAME_FOCUS_SERVER, &focus_server_owner_id) != MM_ERROR_NONE) {
709 debug_error("dbus own name for focus-server error\n");
710 return MM_ERROR_SOUND_INTERNAL;
712 if (mm_sound_dbus_signal_subscribe_to(AUDIO_PROVIDER_AUDIO_CLIENT, AUDIO_EVENT_EMERGENT_EXIT, emergent_exit_signal_handler, NULL, NULL, &emergent_exit_subs_id) != MM_ERROR_NONE) {
713 debug_error("dbus signal subscribe for emergent exit error\n");
714 return MM_ERROR_SOUND_INTERNAL;
719 return MM_ERROR_NONE;
722 void MMSoundMgrFocusDbusFini(void)
726 if (emergent_exit_subs_id != 0)
727 mm_sound_dbus_signal_unsubscribe(emergent_exit_subs_id);
728 _mm_sound_mgr_focus_dbus_unown_name(focus_server_owner_id);
729 g_dbus_node_info_unref(introspection_data);