1DTK_LOAD_VIDEO_UDP(3) Draw Toolkit manual DTK_LOAD_VIDEO_UDP(3)
2
3
4
6 dtk_load_video_udp - Load an video stream via UDP connection as a tex‐
7 ture
8
10 #include <dtk_video.h>
11
12 dtk_htex dtk_load_video_udp(int flags, int port);
13
15 This function loads as a dynamic texture the video stream broadcasted
16 over the network via UDP by listening to the port port. The texture
17 will then been tracked by an internal texture manager so that the next
18 call using the same port arguments will return the same texture handle,
19 thus sparing the resources of the system. If not specified by flags the
20 video will not be played immediately and dtk_video_exec(3) should be
21 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_udp() is thread-safe.
52
54 dtk_destroy_texture(3), dtk_video_exec(3), dtk_video_getstate(3)
55
56
57
58EPFL 2011 DTK_LOAD_VIDEO_UDP(3)