LiVES  2.8.3
videoplugin.h
Go to the documentation of this file.
1 // LiVES - video playback plugin header
2 // (c) G. Finch 2003 - 2008 <salsaman@xs4all.nl,salsaman@gmail.com>
3 // released under the GNU GPL 3 or later
4 // see file COPYING or www.gnu.org for details
5 
6 #ifndef __VIDPLUGIN_H__
7 #define __VIDPLUGIN_H__
8 
9 #ifdef __cplusplus
10 extern "C"
11 {
12 #endif /* __cplusplus */
13 
14 #include <inttypes.h>
15 
16 #ifdef HAVE_SYSTEM_WEED
17 #include <weed/weed-palettes.h>
18 #else
19 #include "../../../../libweed/weed-palettes.h"
20 #endif
21 
22 #ifndef PRId64
23 
24 #ifndef __WORDSIZE
25 #if defined __x86_64__
26 # define __WORDSIZE 64
27 #ifndef __WORDSIZE_COMPAT32
28 # define __WORDSIZE_COMPAT32 1
29 #endif
30 #else
31 # define __WORDSIZE 32
32 #endif
33 #endif // __WORDSIZE
34 
35 #ifndef __PRI64_PREFIX
36 # if __WORDSIZE == 64
37 # define __PRI64_PREFIX "l"
38 # else
39 # define __PRI64_PREFIX "ll"
40 # endif
41 #endif
42 
43 # define PRId64 __PRI64_PREFIX "d"
44 # define PRIu64 __PRI64_PREFIX "u"
45 #endif // ifndef PRI64d
46 
47 typedef void *(func_ptr)(void *);
48 
49 #ifndef IS_MINGW
50 typedef int boolean;
51 #endif
52 #undef TRUE
53 #undef FALSE
54 
55 #define TRUE 1
56 #define FALSE 0
57 
58 #ifndef ABS
59 #define ABS(a) (a>0?a:-a)
60 #endif
61 
62 #ifndef PATH_MAX
63 #ifdef MAX_PATH
64 #define PATH_MAX MAX_PATH
65 #else
66 #define PATH_MAX 4096
67 #endif
68 #endif
69 
70 // Warning - CPU_BITS macro evaluates only at runtime (uses sizeof)
71 #define CPU_BITS ((sizeof(void *))<<3)
72 
73 // all playback modules need to implement these functions, unless they are marked (optional)
74 
76 const char *module_check_init(void);
77 const char *version(void);
78 const char *get_description(void);
79 const char *get_init_rfx(void);
80 
82 const void **get_play_params(func_ptr func);
83 
85 const int *get_palette_list(void);
86 
88 boolean set_palette(int palette);
89 
91 uint64_t get_capabilities(int palette);
92 
93 #define VPP_CAN_RESIZE 1<<0
94 #define VPP_CAN_RETURN 1<<1
95 #define VPP_LOCAL_DISPLAY 1<<2
96 
97 
99 boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv);
100 
110 boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data,
111  void **play_params);
112 
114 void exit_screen(int16_t mouse_x, int16_t mouse_y);
115 
117 void module_unload(void);
118 
120 
121 // extra functions for fixed fps
122 const char *get_fps_list(int palette);
123 boolean set_fps(double fps);
124 
126 // mandatory function for display plugins (VPP_LOCAL_DISPLAY)
127 
129 typedef boolean(*keyfunc)(boolean down, uint16_t unicode, uint16_t keymod);
130 
131 #define MOD_CONTROL_MASK 1<<2
132 #define MOD_ALT_MASK 1<<3
133 #define MOD_NEEDS_TRANSLATION 1<<15
134 
136 boolean send_keycodes(keyfunc);
137 
139 // optional functions for yuv palettes
140 
142 const int *get_yuv_palette_sampling(int palette);
143 
145 const int *get_yuv_palette_clamping(int palette);
146 
148 const int *get_yuv_palette_subspace(int palette);
149 
151 boolean set_yuv_palette_sampling(int sampling_type);
152 
154 boolean set_yuv_palette_clamping(int clamping_type);
155 
157 boolean set_yuv_palette_subspace(int subspace_type);
158 
159 // optional - supported audio streams :: defined in lives/src/plugins.h
160 const int *get_audio_fmts(void);
161 
162 // ...may be expanded in the future to specify rates, #channels, sample size
163 // signed/endian [get_raw_audio_fmts ?]
164 
165 
166 #ifdef __cplusplus
167 }
168 #endif /* __cplusplus */
169 
170 #endif // #ifndef __VIDPLUGIN_H__
uint64_t get_capabilities(int palette)
host will call this
void exit_screen(int16_t mouse_x, int16_t mouse_y)
destroy the screen, return mouse to original posn., allow the host GUI to take over (optional) ...
int boolean
Definition: videoplugin.h:50
const int * get_yuv_palette_clamping(int palette)
plugin send list of palette clamping types, in order of preference (optional); -1 terminates list ...
boolean set_yuv_palette_subspace(int subspace_type)
host sets the palette subspace (optional)
boolean set_palette(int palette)
host sets the palette used
boolean set_fps(double fps)
const int * get_yuv_palette_sampling(int palette)
plugin send list of palette sampling types, in order of preference (optional); -1 terminates list ...
const char * version(void)
_palette * palette
Definition: main.c:89
boolean set_yuv_palette_sampling(int sampling_type)
host sets the palette sampling (optional)
const char * get_fps_list(int palette)
const int * get_audio_fmts(void)
boolean(* keyfunc)(boolean down, uint16_t unicode, uint16_t keymod)
This is a host function - a pointer to it is passed in send_keycodes()
Definition: videoplugin.h:129
const char * get_init_rfx(void)
optional
boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data, void **play_params)
const void ** get_play_params(func_ptr func)
boolean set_yuv_palette_clamping(int clamping_type)
host sets the palette sampling (optional)
boolean send_keycodes(keyfunc)
host calls this fn to send keycodes, plugin should call key function with a unicode keycode and modif...
const char * get_description(void)
optional
const char * module_check_init(void)
host calls at startup
const int * get_palette_list(void)
plugin send list of palettes, in order of preference
const int * get_yuv_palette_subspace(int palette)
plugin send list of palette subspace types, in order of preference (optional); -1 terminates list ...
boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv)
ready the screen to play (optional)
void module_unload(void)
this is called when module is unloaded
void *( func_ptr)(void *)
Definition: videoplugin.h:47