al_get_video_frame(3)
π NAME π
okay so this is al_get_video_frame(3), and it lives in the Library Functions Manual β specifically the Allegro 5 API, bestie β¨
al_get_video_frame β your main-character function for grabbing the current video frame, no cap π
π SYNOPSIS π
#include <allegro5/allegro_video.h>
ALLEGRO_BITMAP *al_get_video_frame(ALLEGRO_VIDEO *video)
π¦ DESCRIPTION π¦
It returns the current video frame. The bitmap is owned by the video, so do not attempt to free it β that's not your job, and trying would be giving red flag energy π
Do not free this bitmap, bestie. The video owns it. Periodt. π
The bitmap will stay valid until the next call to al_get_video_frame.
Videos often do not use square pixels, so the recommended way to draw a video frame would be using code like this β copy the vibe, not the ownership mistakes π«Ά
float scale = 1.0; /* Adjust this to fit your target bitmap dimensions. */
ALLEGRO_BITMAP* frame = al_get_video_frame(video);
float sw = al_get_bitmap_width(frame);
float sh = al_get_bitmap_height(frame);
float dw = scale * al_get_video_scaled_width(video);
float dh = scale * al_get_video_scaled_height(video);
al_draw_scaled_bitmap(frame, 0, 0, sw, sh, 0, 0, dw, dh, 0);
πΈ SINCE πΈ
This icon landed in 5.1.0 β vintage-ish, but still slay β
π§ SEE ALSO π§
Go peek at those too, iykyk π
Final footer energy: source/version is the Allegro reference manual, this page is al_get_video_frame(3), and no date line showed up to the party β bye bestie, stay scaled and stay iconic π
β¨
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms