1al_get_video_frame(3) al_get_video_frame(3)
2
3
4
6 al_get_video_frame - Allegro 5 API
7
9 #include <allegro5/allegro_video.h>
10
11 ALLEGRO_BITMAP *al_get_video_frame(ALLEGRO_VIDEO *video)
12
14 Returns the current video frame. The bitmap is owned by the video so
15 do not attempt to free it. The bitmap will stay valid until the next
16 call to al_get_video_frame.
17
18 Videos often do not use square pixels so the recommended way to draw a
19 video frame would be using code like this:
20
21 float scale = 1.0; /* Adjust this to fit your target bitmap dimensions. */
22 ALLEGRO_BITMAP* frame = al_get_video_frame(video);
23 float sw = al_get_bitmap_width(frame);
24 float sh = al_get_bitmap_height(frame);
25 float dw = scale * al_get_video_scaled_width(video);
26 float dh = scale * al_get_video_scaled_height(video);
27 al_draw_scaled_bitmap(frame, 0, 0, sw, sh, 0, 0, dw, dh, 0);
28
30 5.1.0
31
33 al_get_video_scaled_width(3), al_get_video_scaled_height(3)
34
35
36
37Allegro reference manual al_get_video_frame(3)