1DTK_LOAD_VIDEO_TCP(3) Draw Toolkit manual DTK_LOAD_VIDEO_TCP(3)
2
3
4
6 dtk_load_video_tcp - Load an video stream via TCP connection as a tex‐
7 ture
8
10 #include <dtk_video.h>
11
12 dtk_htex dtk_load_video_tcp(int flags, const char *host, int port);
13
15 This function loads as a dynamic texture the video stream broadcasted
16 over the network via TCP by the server host on the port port. The tex‐
17 ture will then been tracked by an internal texture manager so that the
18 next call using the same host and port arguments will return the same
19 texture handle, thus sparing the resources of the system. If not speci‐
20 fied by flags the video will not be played immediately and
21 dtk_video_exec(3) should be called to do start playing.
22
23 The argument flags is used to modify the creation. It should contains a
24 bitwise OR combination of the following flags:
25
26 DTK_AUTOSTART : Indicates that the video should start immedi‐
27 ately after creation.
28
29 DTK_NOBLOCKING : Indicates that the creation function should not
30 block waiting that the video pipeline is fully running.
31
32 A dynamic texture can be used the same way as a static texture (for
33 example image file). The only difference is that the content of the
34 texture changes automatically with the stream of video. This means that
35 every time a shape using this texture is drawn, the latest frame avail‐
36 able from the video stream will be mapped on the shape.
37
38 There is no need for a valid window to create successfully a texture,
39 i.e. creation of textures are completely decoupled from the creation
40 of others resources and can even be created in one thread to be used in
41 another one.
42
43 Once a the texture is stopped being used, it should be destroyed by
44 dtk_destroy_texture(3).
45
47 In case of success, the function returns the handle to the created tex‐
48 ture. In case of failure, NULL is returned.
49
51 dtk_load_video_tcp() is thread-safe.
52
54 dtk_destroy_texture(3), dtk_video_exec(3), dtk_video_getstate(3)
55
56
57
58
59
60EPFL 2011 DTK_LOAD_VIDEO_TCP(3)