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

Function event_loop

fftools/ffplay.c:3438–3633  ·  view source on GitHub ↗

handle an event sent by the GUI */

Source from the content-addressed store, hash-verified

3436
3437/* handle an event sent by the GUI */
3438static void event_loop(VideoState *cur_stream)
3439{
3440 SDL_Event event;
3441 double incr, pos, frac;
3442
3443 for (;;) {
3444 double x;
3445 refresh_loop_wait_event(cur_stream, &event);
3446 switch (event.type) {
3447 case SDL_KEYDOWN:
3448 if (exit_on_keydown || event.key.keysym.sym == SDLK_ESCAPE || event.key.keysym.sym == SDLK_q) {
3449 do_exit(cur_stream);
3450 break;
3451 }
3452 // If we don't yet have a window, skip all key events, because read_thread might still be initializing...
3453 if (!cur_stream->width)
3454 continue;
3455 switch (event.key.keysym.sym) {
3456 case SDLK_f:
3457 toggle_full_screen(cur_stream);
3458 cur_stream->force_refresh = 1;
3459 break;
3460 case SDLK_p:
3461 case SDLK_SPACE:
3462 toggle_pause(cur_stream);
3463 break;
3464 case SDLK_m:
3465 toggle_mute(cur_stream);
3466 break;
3467 case SDLK_KP_MULTIPLY:
3468 case SDLK_0:
3469 update_volume(cur_stream, 1, SDL_VOLUME_STEP);
3470 break;
3471 case SDLK_KP_DIVIDE:
3472 case SDLK_9:
3473 update_volume(cur_stream, -1, SDL_VOLUME_STEP);
3474 break;
3475 case SDLK_s: // S: Step to next frame
3476 step_to_next_frame(cur_stream);
3477 break;
3478 case SDLK_a:
3479 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
3480 break;
3481 case SDLK_v:
3482 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
3483 break;
3484 case SDLK_c:
3485 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
3486 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
3487 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
3488 break;
3489 case SDLK_t:
3490 stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
3491 break;
3492 case SDLK_w:
3493 if (cur_stream->show_mode == SHOW_MODE_VIDEO && cur_stream->vfilter_idx < nb_vfilters - 1) {
3494 if (++cur_stream->vfilter_idx >= nb_vfilters)
3495 cur_stream->vfilter_idx = 0;

Callers 1

mainFunction · 0.85

Calls 15

refresh_loop_wait_eventFunction · 0.85
do_exitFunction · 0.85
toggle_full_screenFunction · 0.85
toggle_pauseFunction · 0.85
toggle_muteFunction · 0.85
step_to_next_frameFunction · 0.85
stream_cycle_channelFunction · 0.85
toggle_audio_displayFunction · 0.85
seek_chapterFunction · 0.85
frame_queue_last_posFunction · 0.85
avio_tellFunction · 0.85
get_master_clockFunction · 0.85

Tested by

no test coverage detected