可以参考:https://blog.csdn.net/ice_ly000/article/details/90143045
一、av_register_all调用关系
1. ff_thread_once()
这个部分主要确保函数仅仅只调用一次,封装了av_format_init_next()
2. av_format_init_next()
muxer_list中的index = i的AVOutputFormat 模块指向index = i + 1的AVOutputFormat。
同理,对outdev_list,demuxer_list,indev_list
其中,注意的是:
把muxer_list的最后一个AVOutputFormat链表指针指向了outdev_list的第一个元素。
把demuxer_list的最后一个AVOutputFormat链表指针指向了indev_list的第一个元素。
3. av_register_all 使用注意事项
The tutorial mentions that the call to av_register_all() is required, although it seems it's deprecated since ffmpeg 4.0.
二、av_device_register_all
1. av_priv_register_devices
其中outdev_list.c、indev_list.c是./configure 之后生成的。
ffplayer 调用时序
work flow
- avdevice_register_all()
- avformat_network_init()
- init_opts()
- 注册SIGINT和SIGTERM, exit(123)
- show_banner()
- parse_options()
- SDL_setenv 并且SDL_Init(),SDL_Init失败就会退出,SDL_EventState
- av_init_packet====AVPacket