Tscope5
Main Page
Related Pages
Files
Examples
video01.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// video01.c
// - Read and play a video from a file.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
#include <stdio.h>
int
main()
{
TS5_VIDEO *test;
test =
ts5_read_video
(
"max.ogv"
);
double
w =
ts5_get_video_width
(test);
double
h =
ts5_get_video_height
(test);
printf(
"video aspect ratio: %f\n"
,
ts5_get_video_aspect_ratio
(test));
printf(
"video width: %f\n"
, w);
printf(
"video height: %f\n"
, h);
printf(
"video sample rate: %f\n"
,
ts5_get_video_samplerate
(test));
printf(
"video frame rate: %f\n"
,
ts5_get_video_framerate
(test));
ts5_set_display_size
(w, h);
ts5_install_display
();
ts5_wait
(1.0);
double
start =
ts5_get_time
();
ts5_play_video
(test);
do
{
TS5_BITMAP *tmp =
ts5_get_video_frame
(test);
ts5_draw_bitmap
(tmp, 0.0, 0.0);
ts5_flip_display
();
}
while
(al_get_time() - start < 3.0);
ts5_free_video
(test);
return
0;
}