use a dict for extra property info

A dictionary is probably more extensible
This commit is contained in:
Wim Taymans 2016-10-14 10:32:11 +02:00
parent 523868d6bd
commit d79489b29b
2 changed files with 7 additions and 10 deletions

View file

@ -31,6 +31,7 @@ typedef struct _SpaProps SpaProps;
#include <string.h> #include <string.h>
#include <spa/defs.h> #include <spa/defs.h>
#include <spa/dict.h>
/** /**
* SpaPropType: * SpaPropType:
@ -135,7 +136,7 @@ typedef struct {
* @range_type: type of the range values * @range_type: type of the range values
* @n_range_values: number of elements in @range_values * @n_range_values: number of elements in @range_values
* @range_values: array of possible values * @range_values: array of possible values
* @tags: extra tags, NULL terminated * @info: extra info
*/ */
typedef struct { typedef struct {
uint32_t id; uint32_t id;
@ -147,7 +148,7 @@ typedef struct {
SpaPropRangeType range_type; SpaPropRangeType range_type;
unsigned int n_range_values; unsigned int n_range_values;
const SpaPropRangeInfo *range_values; const SpaPropRangeInfo *range_values;
const char **tags; SpaDict *info;
} SpaPropInfo; } SpaPropInfo;
/** /**

View file

@ -377,8 +377,7 @@ spa_debug_props (const SpaProps *props, bool print_ranges)
info = &props->prop_info[i]; info = &props->prop_info[i];
fprintf (stderr, " %-20s\n", info->name); fprintf (stderr, " %-20s flags: ", info->name);
fprintf (stderr, "%-23.23s flags: ", "");
if (info->flags & SPA_PROP_FLAG_READABLE) if (info->flags & SPA_PROP_FLAG_READABLE)
fprintf (stderr, "readable "); fprintf (stderr, "readable ");
if (info->flags & SPA_PROP_FLAG_WRITABLE) if (info->flags & SPA_PROP_FLAG_WRITABLE)
@ -433,12 +432,9 @@ spa_debug_props (const SpaProps *props, bool print_ranges)
fprintf (stderr, "\t: %-12s\n", rinfo->name); fprintf (stderr, "\t: %-12s\n", rinfo->name);
} }
} }
if (info->tags) { if (info->info) {
fprintf (stderr, "Tags: "); fprintf (stderr, "Info: \n");
for (j = 0; info->tags[j]; j++) { spa_debug_dict (info->info);
fprintf (stderr, "\"%s\" ", info->tags[j]);
}
fprintf (stderr, "\n");
} }
} }
return SPA_RESULT_OK; return SPA_RESULT_OK;