mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	dbus: add some more debug in the plugin
This commit is contained in:
		
							parent
							
								
									c1ec10c252
								
							
						
					
					
						commit
						ca72738fee
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -145,8 +145,11 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *userdata)
 | 
			
		|||
static void remove_watch(DBusWatch *watch, void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	struct connection *conn = userdata;
 | 
			
		||||
	struct impl *impl = conn->impl;
 | 
			
		||||
	struct spa_source *source;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "remove watch %p", watch);
 | 
			
		||||
 | 
			
		||||
	if ((source = dbus_watch_get_data(watch)))
 | 
			
		||||
		spa_loop_utils_destroy_source(conn->impl->utils, source);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -157,6 +160,8 @@ static void toggle_watch(DBusWatch *watch, void *userdata)
 | 
			
		|||
	struct impl *impl = conn->impl;
 | 
			
		||||
	struct spa_source *source;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "toggle watch %p", watch);
 | 
			
		||||
 | 
			
		||||
	source = dbus_watch_get_data(watch);
 | 
			
		||||
 | 
			
		||||
	spa_loop_utils_update_io(impl->utils, source, dbus_to_io(watch));
 | 
			
		||||
| 
						 | 
				
			
			@ -177,6 +182,8 @@ handle_timer_event(void *userdata, uint64_t expirations)
 | 
			
		|||
	struct connection *conn = data->conn;
 | 
			
		||||
	struct impl *impl = conn->impl;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
			
		||||
 | 
			
		||||
	if (dbus_timeout_get_enabled(timeout)) {
 | 
			
		||||
		t = dbus_timeout_get_interval(timeout) * SPA_NSEC_PER_MSEC;
 | 
			
		||||
		ts.tv_sec = t / SPA_NSEC_PER_SEC;
 | 
			
		||||
| 
						 | 
				
			
			@ -198,6 +205,8 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *userdata)
 | 
			
		|||
	if (!dbus_timeout_get_enabled(timeout))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "add timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
			
		||||
 | 
			
		||||
	data = calloc(1, sizeof(struct timeout_data));
 | 
			
		||||
	data->conn = conn;
 | 
			
		||||
	data->source = spa_loop_utils_add_timer(impl->utils, handle_timer_event, timeout);
 | 
			
		||||
| 
						 | 
				
			
			@ -217,6 +226,8 @@ static void remove_timeout(DBusTimeout *timeout, void *userdata)
 | 
			
		|||
	struct impl *impl = conn->impl;
 | 
			
		||||
	struct timeout_data *data;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "remove timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
			
		||||
 | 
			
		||||
	if ((data = dbus_timeout_get_data(timeout))) {
 | 
			
		||||
		spa_loop_utils_destroy_source(impl->utils, data->source);
 | 
			
		||||
		free(data);
 | 
			
		||||
| 
						 | 
				
			
			@ -232,6 +243,8 @@ static void toggle_timeout(DBusTimeout *timeout, void *userdata)
 | 
			
		|||
 | 
			
		||||
	data = dbus_timeout_get_data(timeout);
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "toggle timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
			
		||||
 | 
			
		||||
	if (dbus_timeout_get_enabled(timeout)) {
 | 
			
		||||
		uint64_t t = dbus_timeout_get_interval(timeout) * SPA_NSEC_PER_MSEC;
 | 
			
		||||
		ts.tv_sec = t / SPA_NSEC_PER_SEC;
 | 
			
		||||
| 
						 | 
				
			
			@ -264,6 +277,8 @@ impl_connection_destroy(struct spa_dbus_connection *conn)
 | 
			
		|||
	struct connection *this = SPA_CONTAINER_OF(conn, struct connection, this);
 | 
			
		||||
	struct impl *impl = this->impl;
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "destroy conn %p", this);
 | 
			
		||||
 | 
			
		||||
	dbus_connection_close(this->conn);
 | 
			
		||||
	dbus_connection_unref(this->conn);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -313,6 +328,8 @@ impl_get_connection(void *object,
 | 
			
		|||
 | 
			
		||||
	spa_list_append(&impl->connection_list, &conn->link);
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, "new conn %p", conn);
 | 
			
		||||
 | 
			
		||||
	return &conn->this;
 | 
			
		||||
 | 
			
		||||
      error:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue