"Analysis of data structure of
ffplay " "Analysis of ffplay (from startup to operation of reading thread)"
"Analysis of ffplay (operation of video decoding thread)"
"ffplay source code (version: ffmpeg-4.2.1)"
ffplay analysis (operation of audio decoding thread)
- 1. Analysis:
-
- 1. stream_component_open(): Open the audio decoding thread audio_thread()
- 2. audio_thread(): Assign AVframe work before decoding
- 3. Audio_thread(): call decoder_decode_frame() to get a frame of data after decoding
- 4. audio_thread(): call avcodec_receive_frame() to get the decoded frame
- 5. audio_thread(): The result obtained by avcodec_receive_frame() determines whether it returns normally or exits the loop and goes down
- 6. audio_thread(): Get a new Packet from the Packet (before decoding) queue
- 7. audio_thread(): Determine whether the obtained Packet is a flush Packet
- 8. audio_thread(): call avcodec_send_packet() to decode
- 9. audio_thread(): call frame_queue_peek_writable() to get the writable Frame, and set the corresponding parameters
- 10. audio_thread(): call av_frame_move_ref() to move AVFrame->buffer, call frame_queue_push() to add to the frame (after decoding) queue
- 11. audio_thread(): The audio decoding thread ends processing, except for requesting exit or abnormal exit, otherwise it will not.
)
1. Analysis:
1. stream_component_open(): Open the audio decoding thread audio_thread()
2. audio_thread(): Assign AVframe work before decoding
3. Audio_thread(): call decoder_decode_frame() to get a frame of data after decoding
4. audio_thread(): call avcodec_receive_frame() to get the decoded frame