MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / event_loop

Function event_loop

ffplay.c:2787–2923  ·  view source on GitHub ↗

handle an event sent by the GUI */

Source from the content-addressed store, hash-verified

2785
2786/* handle an event sent by the GUI */
2787static void event_loop(void)
2788{
2789 SDL_Event event;
2790 double incr, pos, frac;
2791
2792 for(;;) {
2793 double x;
2794 SDL_WaitEvent(&event);
2795 switch(event.type) {
2796 case SDL_KEYDOWN:
2797 switch(event.key.keysym.sym) {
2798 case SDLK_ESCAPE:
2799 case SDLK_q:
2800 do_exit();
2801 break;
2802 case SDLK_f:
2803 toggle_full_screen();
2804 break;
2805 case SDLK_p:
2806 case SDLK_SPACE:
2807 toggle_pause();
2808 break;
2809 case SDLK_s: //S: Step to next frame
2810 step_to_next_frame();
2811 break;
2812 case SDLK_a:
2813 if (cur_stream)
2814 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
2815 break;
2816 case SDLK_v:
2817 if (cur_stream)
2818 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
2819 break;
2820 case SDLK_t:
2821 if (cur_stream)
2822 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
2823 break;
2824 case SDLK_w:
2825 toggle_audio_display();
2826 break;
2827 case SDLK_LEFT:
2828 incr = -10.0;
2829 goto do_seek;
2830 case SDLK_RIGHT:
2831 incr = 10.0;
2832 goto do_seek;
2833 case SDLK_UP:
2834 incr = 60.0;
2835 goto do_seek;
2836 case SDLK_DOWN:
2837 incr = -60.0;
2838 do_seek:
2839 if (cur_stream) {
2840 if (seek_by_bytes) {
2841 if (cur_stream->video_stream >= 0 && cur_stream->video_current_pos>=0){
2842 pos= cur_stream->video_current_pos;
2843 }else if(cur_stream->audio_stream >= 0 && cur_stream->audio_pkt.pos>=0){
2844 pos= cur_stream->audio_pkt.pos;

Callers 1

mainFunction · 0.85

Calls 13

do_exitFunction · 0.85
toggle_full_screenFunction · 0.85
toggle_pauseFunction · 0.85
step_to_next_frameFunction · 0.85
stream_cycle_channelFunction · 0.85
toggle_audio_displayFunction · 0.85
url_ftellFunction · 0.85
stream_seekFunction · 0.85
get_master_clockFunction · 0.85
url_fsizeFunction · 0.85
video_openFunction · 0.85
video_refresh_timerFunction · 0.85

Tested by

no test coverage detected