ffmpeg数据结构之AVDictionary
2014-10-16 11:10
106 查看
一:AVDictionary的定义:
struct AVDictionary {
int count;
AVDictionaryEntry *elems;
};
AVDictionaryEntry的定义:
typedef struct AVDictionaryEntry {
char *key;
char *value;
} AVDictionaryEntry;
作用:简单的键值对存储。
AVDictionary *d = NULL; // "create" an empty dictionary
AVDictionaryEntry *t = NULL;
av_dict_set(&d, "foo", "bar", 0); // add an entry
char *k = av_strdup("key"); // if your strings are already allocated,
char *v = av_strdup("value"); // you can avoid copying them like this
av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
<....> // iterate over all entries in d
}
av_dict_free(&d);
struct AVDictionary {
int count;
AVDictionaryEntry *elems;
};
AVDictionaryEntry的定义:
typedef struct AVDictionaryEntry {
char *key;
char *value;
} AVDictionaryEntry;
作用:简单的键值对存储。
AVDictionary *d = NULL; // "create" an empty dictionary
AVDictionaryEntry *t = NULL;
av_dict_set(&d, "foo", "bar", 0); // add an entry
char *k = av_strdup("key"); // if your strings are already allocated,
char *v = av_strdup("value"); // you can avoid copying them like this
av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
<....> // iterate over all entries in d
}
av_dict_free(&d);
相关文章推荐
- FFmpeg数据结构:AVPacket解析
- FFmpeg的一些关键的数据结构(一)
- FFMpeg主要数据结构
- FFMPEG中重要的数据结构的挖掘
- FFmpeg中的重要数据结构
- FFmpeg的一些关键的数据结构(二)
- FFMPEG学习【libavutil】:数据结构(四)
- ffmpeg 几个主要数据结构
- [置顶] FFmpeg数据结构:AVPacket解析
- FFMpeg 中比较重要的函数以及数据结构
- ffmpeg解析mpeg2ts时的数据结构分析
- [原]零基础学习视频解码之FFMpeg中比较重要的函数以及数据结构
- ffmpeg新版与旧版数据结构不同 持续更新.....
- 零基础学习视频解码之FFMpeg中比较重要的函数以及数据结构
- FFMPEG中重要的数据结构的挖掘
- a52dec工程ao数据结构和ffmpeg工程codec数据结构比较(2007.9.14)
- [转载] ffmpeg 基本数据结构和对象: AVPacket、AVPicture、AVFrame
- FFmpeg中比较重要的函数以及数据结构
- ffmpeg数据结构解释
- ffmpeg 的一些数据结构