LiVES  2.4.1-svn
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 // Warning - CPU_BITS macro evaluates only at runtime (uses sizeof)
63 #define CPU_BITS ((sizeof(void *))<<3)
64 
65 // all playback modules need to implement these functions, unless they are marked (optional)
66 
68 const char *module_check_init(void);
69 const char *version(void);
70 const char *get_description(void);
71 const char *get_init_rfx(void);
72 
74 const void **get_play_params(func_ptr func);
75 
77 const int *get_palette_list(void);
78 
80 boolean set_palette(int palette);
81 
83 uint64_t get_capabilities(int palette);
84 
85 #define VPP_CAN_RESIZE 1<<0
86 #define VPP_CAN_RETURN 1<<1
87 #define VPP_LOCAL_DISPLAY 1<<2
88 
89 
91 boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv);
92 
102 boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data,
103  void **play_params);
104 
106 void exit_screen(int16_t mouse_x, int16_t mouse_y);
107 
109 void module_unload(void);
110 
112 
113 // extra functions for fixed fps
114 const char *get_fps_list(int palette);
115 boolean set_fps(double fps);
116 
118 // mandatory function for display plugins (VPP_LOCAL_DISPLAY)
119 
121 typedef boolean(*keyfunc)(boolean down, uint16_t unicode, uint16_t keymod);
122 
123 #define MOD_CONTROL_MASK 1<<2
124 #define MOD_ALT_MASK 1<<3
125 #define MOD_NEEDS_TRANSLATION 1<<15
126 
128 boolean send_keycodes(keyfunc);
129 
131 // optional functions for yuv palettes
132 
134 const int *get_yuv_palette_sampling(int palette);
135 
137 const int *get_yuv_palette_clamping(int palette);
138 
140 const int *get_yuv_palette_subspace(int palette);
141 
143 boolean set_yuv_palette_sampling(int sampling_type);
144 
146 boolean set_yuv_palette_clamping(int clamping_type);
147 
149 boolean set_yuv_palette_subspace(int subspace_type);
150 
151 // optional - supported audio streams :: defined in lives/src/plugins.h
152 const int *get_audio_fmts(void);
153 
154 // ...may be expanded in the future to specify rates, #channels, sample size
155 // signed/endian [get_raw_audio_fmts ?]
156 
157 
158 #ifdef __cplusplus
159 }
160 #endif /* __cplusplus */
161 
162 #endif // #ifndef __VIDPLUGIN_H__
uint64_t get_capabilities(int palette)
host will call this
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:121
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)
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
void *( func_ptr)(void *)
Definition: videoplugin.h:47
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