mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	context: improve debug
This commit is contained in:
		
							parent
							
								
									5e325f636c
								
							
						
					
					
						commit
						2dee35c216
					
				
					 1 changed files with 29 additions and 11 deletions
				
			
		| 
						 | 
					@ -21,6 +21,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <spa/utils/result.h>
 | 
					#include <spa/utils/result.h>
 | 
				
			||||||
#include <spa/param/props.h>
 | 
					#include <spa/param/props.h>
 | 
				
			||||||
 | 
					#include <spa/debug/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <pipewire/pipewire.h>
 | 
					#include <pipewire/pipewire.h>
 | 
				
			||||||
#include <extensions/metadata.h>
 | 
					#include <extensions/metadata.h>
 | 
				
			||||||
| 
						 | 
					@ -445,7 +446,8 @@ static void device_event_info(void *object, const struct pw_device_info *info)
 | 
				
			||||||
					g->card_info.pending_ports = true;
 | 
										g->card_info.pending_ports = true;
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				pw_log_debug("global %p: do enum:%d", g, id);
 | 
									pw_log_debug("global %p: id:%d do enum %s", g, g->id,
 | 
				
			||||||
 | 
										spa_debug_type_find_name(spa_type_param, id));
 | 
				
			||||||
				pw_device_enum_params((struct pw_device*)g->proxy,
 | 
									pw_device_enum_params((struct pw_device*)g->proxy,
 | 
				
			||||||
						0, id, 0, -1, NULL);
 | 
											0, id, 0, -1, NULL);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -555,6 +557,9 @@ static void device_event_param(void *object, int seq,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct global *g = object;
 | 
						struct global *g = object;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_log_debug("update param %d %s", g->id,
 | 
				
			||||||
 | 
								spa_debug_type_find_name(spa_type_param, id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (id) {
 | 
						switch (id) {
 | 
				
			||||||
	case SPA_PARAM_EnumProfile:
 | 
						case SPA_PARAM_EnumProfile:
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
| 
						 | 
					@ -954,7 +959,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
 | 
				
			||||||
	const char *str;
 | 
						const char *str;
 | 
				
			||||||
	uint32_t i;
 | 
						uint32_t i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("update %d %"PRIu64, g->id, info->change_mask);
 | 
						pw_log_debug("global %p: id:%d change-mask:%"PRIu64, g, g->id, info->change_mask);
 | 
				
			||||||
	info = g->info = pw_node_info_update(g->info, info);
 | 
						info = g->info = pw_node_info_update(g->info, info);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (info->props && (str = spa_dict_lookup(info->props, "card.profile.device")))
 | 
						if (info->props && (str = spa_dict_lookup(info->props, "card.profile.device")))
 | 
				
			||||||
| 
						 | 
					@ -964,25 +969,36 @@ static void node_event_info(void *object, const struct pw_node_info *info)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) {
 | 
						if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) {
 | 
				
			||||||
		for (i = 0; i < info->n_params; i++) {
 | 
							for (i = 0; i < info->n_params; i++) {
 | 
				
			||||||
 | 
								uint32_t id = info->params[i].id;
 | 
				
			||||||
 | 
								bool do_enum;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (info->params[i].user == 0)
 | 
								if (info->params[i].user == 0)
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			info->params[i].user = 0;
 | 
								info->params[i].user = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
 | 
								switch (id) {
 | 
				
			||||||
				continue;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			switch (info->params[i].id) {
 | 
					 | 
				
			||||||
			case SPA_PARAM_EnumFormat:
 | 
								case SPA_PARAM_EnumFormat:
 | 
				
			||||||
				clear_node_formats(g);
 | 
									clear_node_formats(g);
 | 
				
			||||||
				/* fallthrough */
 | 
									/* fallthrough */
 | 
				
			||||||
			case SPA_PARAM_Props:
 | 
								case SPA_PARAM_Props:
 | 
				
			||||||
			case SPA_PARAM_Format:
 | 
								case SPA_PARAM_Format:
 | 
				
			||||||
				pw_device_enum_params((struct pw_device*)g->proxy,
 | 
									do_enum = true;
 | 
				
			||||||
					0, info->params[i].id, 0, -1, NULL);
 | 
					 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
 | 
									do_enum = false;
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (do_enum) {
 | 
				
			||||||
 | 
									pw_log_debug("global %p: id:%d do enum %s", g, g->id,
 | 
				
			||||||
 | 
										spa_debug_type_find_name(spa_type_param, id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									pw_node_enum_params((struct pw_node*)g->proxy,
 | 
				
			||||||
 | 
										0, id, 0, -1, NULL);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	global_sync(g);
 | 
						global_sync(g);
 | 
				
			||||||
| 
						 | 
					@ -993,7 +1009,9 @@ static void node_event_param(void *object, int seq,
 | 
				
			||||||
		const struct spa_pod *param)
 | 
							const struct spa_pod *param)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct global *g = object;
 | 
						struct global *g = object;
 | 
				
			||||||
	pw_log_debug("update param %d %d", g->id, id);
 | 
					
 | 
				
			||||||
 | 
						pw_log_debug("update param %d %s", g->id,
 | 
				
			||||||
 | 
								spa_debug_type_find_name(spa_type_param, id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (id) {
 | 
						switch (id) {
 | 
				
			||||||
	case SPA_PARAM_Props:
 | 
						case SPA_PARAM_Props:
 | 
				
			||||||
| 
						 | 
					@ -1053,7 +1071,7 @@ static void module_event_info(void *object, const struct pw_module_info *info)
 | 
				
			||||||
        struct global *g = object;
 | 
					        struct global *g = object;
 | 
				
			||||||
	pa_module_info *i = &g->module_info.info;
 | 
						pa_module_info *i = &g->module_info.info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("update %d", g->id);
 | 
						pw_log_debug("global %p: id:%d change-mask:%"PRIu64, g, g->id, info->change_mask);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        info = g->info = pw_module_info_update(g->info, info);
 | 
					        info = g->info = pw_module_info_update(g->info, info);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1098,7 +1116,7 @@ static void client_event_info(void *object, const struct pw_client_info *info)
 | 
				
			||||||
	const char *str;
 | 
						const char *str;
 | 
				
			||||||
	pa_client_info *i = &g->client_info.info;
 | 
						pa_client_info *i = &g->client_info.info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("update %d", g->id);
 | 
						pw_log_debug("global %p: id:%d change-mask:%"PRIu64, g, g->id, info->change_mask);
 | 
				
			||||||
	info = g->info = pw_client_info_update(g->info, info);
 | 
						info = g->info = pw_client_info_update(g->info, info);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	i->index = g->id;
 | 
						i->index = g->id;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue