.\" Automatically generated by Pandoc 3.4 .\" .TH "al_open_video_f" "3" "" "Allegro reference manual" .SH NAME al_open_video_f \- Allegro 5 API .SH SYNOPSIS .IP .EX #include \f[B]\f[R] ALLEGRO_VIDEO* al_open_video_f(ALLEGRO_FILE *fp, const char *ident) .EE .SH DESCRIPTION Opens a video file from an existing \f[CR]ALLEGRO_FILE*\f[R] using the Allegro file interface system. This allows videos to be loaded from custom sources such as memory streams, virtual file systems, archives, or any other source supported by a custom \f[CR]ALLEGRO_FILE_INTERFACE\f[R]. .PP \f[B]Parameters:\f[R] .IP \[bu] 2 \f[CR]file\f[R]: A pointer to an \f[CR]ALLEGRO_FILE\f[R] object. Ownership of this file is transferred to the video object; the file will be closed automatically when \f[CR]al_close_video\f[R] is called. .PP \f[B]Returns:\f[R] A pointer to a new \f[CR]ALLEGRO_VIDEO\f[R] object if successful, or \f[CR]NULL\f[R] on failure. .PP \f[B]Remarks:\f[R] .IP \[bu] 2 The function does \f[B]not\f[R] require the file to be seeked or rewound; it reads from the current position. .IP \[bu] 2 After calling \f[CR]al_open_video_f\f[R], you must not manually close the \f[CR]ALLEGRO_FILE\f[R]; call \f[CR]al_close_video\f[R] to free all associated resources. .IP \[bu] 2 This function mirrors the behavior of other \f[CR]_f\f[R] variants in the Allegro API, enabling video streaming from custom file systems. .PP \f[B]Example:\f[R] .IP .EX ALLEGRO_FILE *f = al_fopen(\[dq]video.ogv\[dq], \[dq]rb\[dq]); \f[B]if\f[R] (f) { ALLEGRO_VIDEO *vid = al_open_video_f(f); \f[B]if\f[R] (vid) { float fps = al_get_video_fps(vid); \f[I]// ... use the video ...\f[R] al_close_video(vid); \f[I]// also closes f\f[R] } } .EE .SH SEE ALSO al_open_video(3) .SH SINCE 5.2.11