32#define GET(entry, mem) ((entry) ? (entry)->mem : "N/A")
33 printf(
"Iterating with av_dict_iterate() yields a different result "
34 "than iterating with av_dict_get() and AV_DICT_IGNORE_SUFFIX "
35 "(prev: %p, key %s; av_dict_iterate() %p, key %s, value %s; "
36 "av_dict_get() %p, key %s, value %s)\n",
59 char pairs[] = {pair ,
'\0'};
60 char vals[] = {
val,
'\0'};
83 printf(
"Testing av_dict_get_string() and av_dict_parse_string()\n");
108 printf(
"\nTesting av_dict_set()\n");
120 printf(
"av_dict_get() does not correctly handle NULL key.\n");
131 printf(
"av_dict_set does not correctly handle NULL key\n");
140 printf(
"\nTesting av_dict_set_int()\n");
155 printf(
"\nTesting av_dict_set() with existing AVDictionaryEntry.key as key\n");
static double val(void *priv, double ch)
__device__ int printf(const char *,...)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
int av_dict_get_string(const AVDictionary *m, char **buffer, const char key_val_sep, const char pairs_sep)
Get dictionary entries as a string.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
#define AV_DICT_APPEND
If the entry already exists, append to it.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
Memory handling functions.
static void test_separators(const AVDictionary *m, const char pair, const char val)
static void print_dict(const AVDictionary *m)
static const AVDictionaryEntry * dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)