FFmpeg
Data Structures | Functions
dict.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include "avassert.h"
#include "avstring.h"
#include "dict.h"
#include "dict_internal.h"
#include "error.h"
#include "mem.h"
#include "time_internal.h"
#include "bprint.h"

Go to the source code of this file.

Data Structures

struct  AVDictionary
 

Functions

int av_dict_count (const AVDictionary *m)
 Get number of entries in dictionary. More...
 
const AVDictionaryEntryav_dict_iterate (const AVDictionary *m, const AVDictionaryEntry *prev)
 Iterate over a dictionary. More...
 
AVDictionaryEntryav_dict_get (const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
 Get a dictionary entry with matching key. More...
 
int av_dict_set (AVDictionary **pm, const char *key, const char *value, int flags)
 Set the given entry in *pm, overwriting an existing entry. More...
 
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. More...
 
static int parse_key_value_pair (AVDictionary **pm, const char **buf, const char *key_val_sep, const char *pairs_sep, int flags)
 
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. More...
 
void av_dict_free (AVDictionary **pm)
 Free all the memory allocated for an AVDictionary struct and all keys and values. More...
 
int av_dict_copy (AVDictionary **dst, const AVDictionary *src, int flags)
 Copy entries from one AVDictionary struct into another. More...
 
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. More...
 
int avpriv_dict_set_timestamp (AVDictionary **dict, const char *key, int64_t timestamp)
 Set a dictionary value to an ISO-8601 compliant timestamp string. More...
 

Function Documentation

◆ parse_key_value_pair()

static int parse_key_value_pair ( AVDictionary **  pm,
const char **  buf,
const char *  key_val_sep,
const char *  pairs_sep,
int  flags 
)
static

Definition at line 176 of file dict.c.

Referenced by av_dict_parse_string().

◆ avpriv_dict_set_timestamp()

int avpriv_dict_set_timestamp ( AVDictionary **  dict,
const char *  key,
int64_t  timestamp 
)

Set a dictionary value to an ISO-8601 compliant timestamp string.

Parameters
dictpointer to a pointer to a dictionary struct. If *dict is NULL a dictionary struct is allocated and put in *dict.
keymetadata key
timestampunix timestamp in microseconds
Returns
<0 on error

Definition at line 278 of file dict.c.

Referenced by amf_parse_object(), ff_standardize_creation_time(), matroska_parse_flac(), mov_metadata_creation_time(), and parse_header().