ffplay 源码分析系列 - CSDN
ffplay源码分析1-概述 - 叶余 - 博客园
ffplay源码分析2-数据结构 - 叶余 - 博客园
ffplay源码分析3-代码框架 - 叶余 - 博客园
ffplay源码分析4-音视频同步 - 叶余 - 博客园
ffplay源码分析5-图像格式转换 - 叶余 - 博客园
ffplay源码分析6-音频重采样 - 叶余 - 博客园
ffplay源码分析7-播放控制 - 叶余 - 博客园
ffplay 源码分析系列 - 知乎
ffplay packet queue分析
ffplay frame queue分析
ffplay read线程分析
ffplay解码线程分析
ffplay video显示线程分析
ffplay audio输出线程分析
ffplay subtitle显示线程分析
ffplay音视频同步分析——基础概念
ffplay音视频同步分析——视频同步音频
ffplay音视频同步分析——音频同步视频
ffplay音视频同步分析——同步到外部时钟
ffplay 分析概述
ffplay 思维导图

ffmpeg数据流向
从文件或者直播流中获取AVPacket存入Packet queue,
从paket queue 获取 AVPacket , 发送给解码器解码,得到AVFrame 存入frame queue
SDL音频播放器从frame queue 中获取 AVFrame 进行播放,同时更新音频时钟
视频播放,从frame queue 中获取 AVFrame,根据音频时钟进行播放。
Packet 获取
read_thead
1 2 3 4 5
| for { ret = av_read_frame; packet_queue_put; }
|
视频解码
video_thread
1 2 3 4 5 6 7 8 9
| for (;;) { packet_queue_get() avcodec_send_packet() avcodec_receive_frame() frame_queue_peek_writable(); frame_queue_push(); }
|
视频绘制
video_refresh
1 2
| frame_queue_peek(); frame_queue_next();
|
音频解码
audio_thread
1 2 3 4 5 6 7 8 9
| for (;;) { packet_queue_get() avcodec_send_packet() avcodec_receive_frame() frame_queue_peek_writable(); frame_queue_push(); }
|
音频播放
sdl_audio_callback
1 2
| frame_queue_peek_readable(); frame_queue_next();
|