---
name: "dtk_video_exec"
section: "3"
platform: "linux"
package: "libdrawtk-dev"
version: "2.0-2.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dtk_video_exec"
---

# dtk\_video\_exec(3)

Start/stop/pause a video texture

## 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_file/3.md), [**dtk\_load\_video\_gst**(3)](/dtk_load_video_gst/3.md), [**dtk\_load\_video\_test**(3)](/dtk_load_video_test/3.md), [**dtk\_load\_video\_udp**(3)](/dtk_load_video_udp/3.md), [**dtk\_load\_video\_tcp**(3)](/dtk_load_video_tcp/3.md)
