AVFormatContext *avformat_alloc_context (libavformat/options.c) | ||||||||||
AVFormatContext *ic;ic = av_malloc(sizeof(AVFormatContext)); | ||||||||||
(libavutil/mem.c:77)void *av_malloc(size_t size) | ||||||||||
if (size > (max_alloc_size - 32)) return NULL; | ||||||||||
posix_memalign(&ptr, ALIGN, size) | ||||||||||
调用posix_memalign( )成功时会返回size字节的动态内存,并且这块内存的地址是alignment的倍数,这里是16,函数在stdlib.h中有声明 | ||||||||||
avformat_get_context_defaults(ic); | ||||||||||
libavformat/options.c:100 | ||||||||||
memset(s, 0, sizeof(AVFormatContext)); | ||||||||||
s->av_class = &av_format_context_class; | ||||||||||
av_opt_set_defaults(s); |
ffmpeg学习:avformat_alloc_context
最新推荐文章于 2024-02-20 19:32:12 发布