NAME¶
dtk_video_exec - Start/stop/pause a video texture
SYNOPSIS¶
#include <dtk_video.h>
int dtk_video_exec(dtk_htex vid, int command,
const void* arg);
DESCRIPTION¶
This function changes the state (or playing position) of a video texture
referenced by
vid according to the value of
command:
- DTKV_CMD_PLAY: Set the video to play. arg is interpreted as
a
- pointer to a variable of type int whose non zero value indicates
that the state change is asynchronous and can be finished after the
function returns. If arg is NULL, the change is performed
synchronously.
- DTKV_CMD_PAUSE: Set the video to pause. arg is interpreted
as a
- pointer to a variable of type int whose non zero value indicates
that the state change is asynchronous and can be finished after the
function returns. If arg is NULL, the change is performed
synchronously.
- DTKV_CMD_SEEK: Seek the video to the position specified by
arg
- which is then interpreted as a pointer to a variable of type long
representing the position in milliseconds from the beginning of the video.
arg is allowed to be NULL. In that case, the video will be
positioned at its start.
vid must be a dynamic texture created by one of the functions
dtk_create_video_*(3). If the video was already in the requested state,
the function will do nothing.
If the video is created from the live source (webcam, network broadcast...),
executing
DTKV_CMD_SEEK will fail.
RETURN VALUE¶
0 if the state has been changed or was already the one requested, -1 otherwise.
SEE ALSO¶
dtk_load_video_file(3),
dtk_load_video_gst(3),
dtk_load_video_test(3),
dtk_load_video_udp(3),
dtk_load_video_tcp(3)