AVDictionary结构体相关源码介绍
本文对AVDictionary结构体部分相关函数代码进行了介绍
- 本文研究分析AVDictionary相关代码
- struct AVDictionary {
- int count;
- AVDictionaryEntry *elems;
- };
- typedef struct AVDictionaryEntry {
- char *key;
- char *value;
- } AVDictionaryEntry;
- /*
- *这就是一个键值对或者叫键值对数组。为了create一个AVDictionary,
- *用到了av_dict_set()函数,将一个空指针传入该函数,这个空指针为
- *空的AVDictionary。生成AVDictionary后,可以通过av_dict_get()函
- *来找回一个数组或者递归所有数组,最后用av_dict_free()来释放。
- */
- 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);
- /*
- *介绍主要函数
- */
- /*
- *这个函数是把给定的key/value放入*pm中,如果数组已存在则覆盖
- *Note:增加一个新的数组到dictionary中会使之前由av_dict_get()返回的数组失效
- * pm 指向一个dictionary的指针的指针。如果*pm是空,那么一个dictionary结构将
- * 由函数分配并放入*pm
- * key 数组中的key值要加入*pm,由av_strduped设置一个值或者根据一个flag增加
- * value 数组中的value值要加入*pm,由av_strduped设置一个值或者根据一个flag增加
- *
- * 函数成功执行返回0,否则返回<0
- */
- int av_dict_set ( AVDictionary ** pm,
- const char * key,
- const char * value,
- int flags )
- /*
- *通过匹配的key值得到一个dictionary entry,返回的entry key或value值不能被修改
- *为递归所有dictionary entry,可以set the matching key to null,并且set the
- *AV_DICT_IGNORE_SUFFIX flag
- * prev Set to the previous matching element to find the next.If set to null
- * the first matching element is returned
- * key matching key
- * flags a collection of AV_DICT_ *flags,控制着如何检索数组
- *
- * 执行结果是:found entry or NULL in case no matching entry was found in the dictionary
- */
- AVDictionaryEntry* av_dict_get ( const AVDictionary * m,
- const char * key,
- const AVDictionaryEntry * prev,
- int flags )
- /*
- *对av_dict_set的一个包装处理,将其参数value转换成一个string类型并存储下来
- */
- int av_dict_set_int ( AVDictionary ** pm,
- const char * key,
- int64_t value,
- int flags )
- <pre name="code" class="cpp">/*
- *拷贝entries从一个AVDictionary到另一个AVDictionary
- * dst 指向一个AVDictionary结构体
- * src 指向原AVDictionary结构体
- * flag 在set dst中的entries时用到
- * 成功返回0,失败返回负。
- */
- int av_dict_copy ( AVDictionary ** dst,
- const AVDictionary * src,
- int flags )
AVDictionary结构体相关源码介绍相关推荐
- Live555源码阅读笔记(一):源码介绍文档 及 源码目录结构
目录 一.Live555介绍 1.Live555项目介绍 2.官网及帮助文档介绍 二.源码目录结构 1.UsageEnvironment 2.BasicUsageEnvironment 3.group ...
- 4- vue django restful framework 打造生鲜超市 -restful api 与前端源码介绍
使用Python3.6与Django2.0.2(Django-rest-framework)以及前端vue开发的前后端分离的商城网站 项目支持支付宝支付(暂不支持微信支付),支持手机短信验证码注册, ...
- android做拨号程序代码,Android开发手机拨号程序实现实例源码介绍
Android开发手机拨号程序实现实例源码介绍,在上一篇文章中,我们实现了第一个程序:helloWorld,并成功测试完成.还给大家介绍了Android项目结构和说明.现在写一个手机拨号程序: 首先, ...
- 最新E4A抖音互关源码+含数据库后台/搭建可用
正文: 最新E4A抖音互关源码+含数据库后台/搭建可用,其它的就没什么介绍了,对了,源码是属于E4A开发的,其它的自行体验吧. 程序: wwwu.lanzouw.com/iJLjw05buauh 图片 ...
- c语言 临时文件作用,c语言函数mktemp()产生唯一临时文件名实例源码介绍
c语言函数mktemp()产生唯一临时文件名实例源码介绍.有关的函数:tmpfile引入的头文件:#include 定义函数mktemp():char * mktemp(char * template ...
- c语言复制粘贴源码,c语言函数memccpy()如何复制内存中的内容实例源码介绍
c语言函数memccpy()如何复制内存中的内容实例源码介绍.引入的头文件:#include memccpy()函数定义:void * memccpy(void *dest, const void * ...
- Weka开发[8]-ID3源码介绍
为什么80%的码农都做不了架构师?>>> 这次介绍一下Id3源码,这次用Weka的源码介绍一下.首先Id3是继承于Classifier的: public class Id3 e ...
- c语言比较函数memcmp,c语言函数memcmp()如何比较内存前n个字节实例源码介绍
c语言函数memcmp()如何比较内存前n个字节实例源码介绍.引入头文件:#include 定义memcmp()函数:int memcmp (const void *s1, const void *s ...
- robot_localization中EKF源码介绍
robot_localization中EKF源码介绍 /** Copyright (c) 2014, 2015, 2016 Charles River Analytics, Inc.* Copyrig ...
- java 摄像头 win7_JAVA摄像头调用方法_实例源码介绍—Win7
JAVA摄像头调用_实例源码介绍-Win7. 本人菜鸟级人物,由于要搞个人脸识别登录(JAVACV),百度谷歌了一下午,找了网上简单的样例代码来试,可是老是调试不过,出现CaptureDeviceMa ...
最新文章
- 双活方案_MySQL业务双活的初步设计方案
- pyhton中的魔术方法
- leetcode 28. 实现 strStr()(kmp)
- 服务器系统怎么找便签,Win10电脑怎么找回便签记录?如何恢复误删的内容?
- Nutanix推出云基础架构远程管理IT解决方案
- poj 1001 分析
- 5.七个重点网络协议
- F - Restoring the Expression CodeForces - 898F
- ssh远程连接服务器常用命令
- EMS快递单打印模板
- 开放式虚拟仿真实验服务器,润尼尔开放式虚拟仿真实验教学及资源共享平台
- linux查看前50条日志,linux 查看日志信息--less命令
- 标准应用 | 数据库防火墙安全技术解析与实践
- [转] mongoose 之Shema
- windows下vue-cli及webpack 构建网站(三)使用组件
- POI解决读入Excel内存溢出
- 如何快速在服务器上搭建隧道ip
- 多旋翼无人机仿真 rotors_simulator:roll pitch yawrate thrust 控制器
- linux实现数据完整性检查工具 tripwire
- [上海线下活动] AI+教育 专场 -- 沪江技术沙龙