美文网首页
2019-12-01 FFmpeg 源码学习ffplay

2019-12-01 FFmpeg 源码学习ffplay

作者: 沉睡的牛仔 | 来源:发表于2019-12-01 20:05 被阅读0次

可以参考: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

  1. avdevice_register_all()
  2. avformat_network_init()
  3. init_opts()
  4. 注册SIGINT和SIGTERM, exit(123)
  5. show_banner()
  6. parse_options()
  7. SDL_setenv 并且SDL_Init(),SDL_Init失败就会退出,SDL_EventState
  8. av_init_packet====AVPacket

相关文章

网友评论

      本文标题:2019-12-01 FFmpeg 源码学习ffplay

      本文链接:https://www.haomeiwen.com/subject/cjltgctx.html