format: make formats as uri

This commit is contained in:
Wim Taymans 2017-03-21 13:36:22 +01:00
parent 6f0a12462b
commit ff62c1b9ce
11 changed files with 476 additions and 222 deletions

View file

@ -322,8 +322,18 @@ print_format_value (uint32_t size, uint32_t type, void *body)
fprintf (stderr, "%s", *(int32_t *) body ? "true" : "false");
break;
case SPA_POD_TYPE_URI:
fprintf (stderr, "%"PRIi32, *(int32_t *) body);
{
const char *str = spa_id_map_get_uri (spa_id_map_get_default(), *(int32_t*)body);
if (str) {
const char *h = strstr (str, "#");
if (h)
str = h + 1;
} else {
str = "unknown";
}
fprintf (stderr, "%s", str);
break;
}
case SPA_POD_TYPE_INT:
fprintf (stderr, "%"PRIi32, *(int32_t *) body);
break;