视频解码
视频解码,读取数据包(packet),生成数据帧(frame),放入数据帧队列,用来输出音频和视频
解码流程
stream_component_open:
- 分配解码器上下文
avcodec_alloc_context3 - 将码流中的解码信息拷贝到上下文
avcodec_parameters_to_context - 查找解码器
avcodec_find_decoder - 关联上下文和解码器
avcodec_open2 - 音频解码:设置参数(采样率,声道数,布局通道等),获取steam索引和指针,初始化解码类Decoder,启动解码线程
- 视频解码:音频解码线程:获取steam索引和指针,初始化解码类Decoder, 启动解码线程
- 关闭上下文
int FFPlayer::stream_component_open(int stream_index)<