static void constructed (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_stream_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_dbus_daemon_register_object ( tp_base_connection_get_dbus_daemon (self->priv->conn), self->priv->object_path, self); if (self->priv->locally_requested) { example_call_stream_change_direction (self, TRUE, TRUE); } else { example_call_stream_receive_direction_request (self, TRUE, TRUE); } if (self->priv->handle != 0) { TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( self->priv->conn, TP_HANDLE_TYPE_CONTACT); tp_handle_ref (contact_repo, self->priv->handle); } }
static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); switch (property_id) { case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; case PROP_LOCALLY_REQUESTED: g_value_set_boolean (value, self->priv->locally_requested); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static void finalize (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); if (self->priv->agreed_delay_id != 0) g_source_remove (self->priv->agreed_delay_id); G_OBJECT_CLASS (example_call_stream_parent_class)->finalize (object); }
static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_INTERFACES: g_value_set_static_boxed (value, empty_strv); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; case PROP_LOCALLY_REQUESTED: g_value_set_boolean (value, self->priv->locally_requested); break; case PROP_SENDERS: { GHashTable *senders = g_hash_table_new (NULL, NULL); g_hash_table_insert (senders, GUINT_TO_POINTER (self->priv->handle), GUINT_TO_POINTER (self->priv->remote_sending_state)); g_hash_table_insert (senders, GUINT_TO_POINTER (tp_base_connection_get_self_handle ( self->priv->conn)), GUINT_TO_POINTER (self->priv->local_sending_state)); g_value_take_boxed (value, senders); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static void finalize (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_stream_parent_class)->finalize; g_free (self->priv->object_path); if (chain_up != NULL) chain_up (object); }
static gboolean stream_set_sending (TpBaseCallStream *base, gboolean sending, GError **error) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (base); TpSendingState remote_sending_state = tp_base_call_stream_get_remote_sending_state (base, self->priv->handle); example_call_stream_change_direction (self, sending, (remote_sending_state == TP_SENDING_STATE_SENDING)); return TRUE; }
static gboolean stream_request_receiving (TpBaseCallStream *base, TpHandle contact, gboolean receive, GError **error) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (base); TpSendingState local_sending_state = tp_base_call_stream_get_local_sending_state (base); /* This is the only member */ g_assert (contact == self->priv->handle); example_call_stream_change_direction (self, (local_sending_state == TP_SENDING_STATE_SENDING), receive); return TRUE; }
static void constructed (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_stream_parent_class)->constructed; static guint count = 0; TpBaseConnection *conn; TpDBusDaemon *dbus; gchar *object_path; TpCallStreamEndpoint *endpoint; if (chain_up != NULL) chain_up (object); conn = tp_base_call_stream_get_connection ((TpBaseCallStream *) self); dbus = tp_base_connection_get_dbus_daemon (conn); object_path = g_strdup_printf ("%s/Endpoint%d", tp_base_call_stream_get_object_path ((TpBaseCallStream *) self), count++); endpoint = tp_call_stream_endpoint_new (dbus, object_path, TP_STREAM_TRANSPORT_TYPE_RAW_UDP, FALSE); tp_base_media_call_stream_add_endpoint ((TpBaseMediaCallStream *) self, endpoint); if (self->priv->locally_requested) { example_call_stream_change_direction (self, TRUE, TRUE); } else { example_call_stream_receive_direction_request (self, TRUE, TRUE); } g_object_unref (endpoint); g_free (object_path); }
static void dispose (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( self->priv->conn, TP_HANDLE_TYPE_CONTACT); example_call_stream_close (self); if (self->priv->handle != 0) { tp_handle_unref (contact_repo, self->priv->handle); self->priv->handle = 0; } if (self->priv->conn != NULL) { g_object_unref (self->priv->conn); self->priv->conn = NULL; } ((GObjectClass *) example_call_stream_parent_class)->dispose (object); }
static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); switch (property_id) { case PROP_OBJECT_PATH: g_assert (self->priv->object_path == NULL); /* construct-only */ self->priv->object_path = g_value_dup_string (value); break; case PROP_HANDLE: self->priv->handle = g_value_get_uint (value); break; case PROP_CONNECTION: g_assert (self->priv->conn == NULL); self->priv->conn = g_value_dup_object (value); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; case PROP_LOCALLY_REQUESTED: self->priv->locally_requested = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
future_svc_call_stream_emit_senders_changed (self, updated_senders, removed_senders); g_array_free (removed_senders, TRUE); } g_hash_table_unref (updated_senders); } static void stream_set_sending (FutureSvcCallStream *iface G_GNUC_UNUSED, gboolean sending, DBusGMethodInvocation *context) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (iface); example_call_stream_change_direction (self, sending, (self->priv->remote_sending_state == FUTURE_SENDING_STATE_SENDING)); future_svc_call_stream_return_from_set_sending (context); } static void stream_request_receiving (FutureSvcCallStream *iface, TpHandle contact, gboolean receive, DBusGMethodInvocation *context) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (iface); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles