Ffplay Source Analysis (3.2.4 + SDL2) (1): Function call flowchart

Source: Internet
Author: User

Recently in learning Ffplay source knowledge, on-line about Ffplay is the old version of the sdl1.x version based, so that their own understanding of the analysis of the ffpaly3.2.4 (based on the SDL2) source, and recorded for their own later review. If there is an understanding error, please correct me. 1, the overall framework:

The function call graph for Ffplay in the ffmpeg3.2.4 version is as follows:


Avdevice_register_all () This ffmpeg device is initialized and registered.

Av_register_all () initializes the Libavformat and registers all muxers, Demuxers, and protocols.

Avformat_network_init () Registers the network transport protocol associated with initializing the network.

Init_opts () initializes the command-line options.

Show_banner () displays video information.

Parse_options () parses the command-line arguments.

Sdl_init () initializes the SDL.

Stream_open () Opens the video for processing.

Event_loop () displays video and captures relevant SDL events.

2, Ffpaly thread ffplay in a total of 5 threads, a re-use thread, three decoding thread, and a display thread. reusability Thread: read_thread--> av_read_frame--> packet_queue_put Audio decoding thread: audio_thread--> decoder_decode_frame --Frame_queue_push video decoding thread:video_thread--> get_video_frame--> queue_picture subtitle decoding thread: subtitile_t hread--> decoder_decode_frame--> frame_queue_push Display thread: event_loop--> refresh_loop_wait_event--> V         Ideo_refresh--> video_display Step: Ffplay First calls the Read_thread function for de-multiplexing, then stores the de-multiplexed packet in Packetqueue and creates three decoding threads.         Three decoding threads remove Avpacket data from their respective packetqueue to decode, get avframe frame data, and then store the decoding frame in Framequeue. The display thread pulls the Avframe frame data from the Framequeue and calls the SDL for display.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.