LiVES  3.2.0
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 #ifndef NEED_LOCAL_WEED
15 #include <weed/weed.h>
16 #include <weed/weed-palettes.h>
17 #else
18 #include "../../../../libweed/weed.h"
19 #include "../../../../libweed/weed-palettes.h"
20 #endif
21 
22 typedef weed_plant_t weed_layer_t;
23 
24 #include <inttypes.h>
25 
26 #ifndef PRId64
27 
28 #ifndef __WORDSIZE
29 #if defined __x86_64__
30 # define __WORDSIZE 64
31 #ifndef __WORDSIZE_COMPAT32
32 # define __WORDSIZE_COMPAT32 1
33 #endif
34 #else
35 # define __WORDSIZE 32
36 #endif
37 #endif // __WORDSIZE
38 
39 #ifndef __PRI64_PREFIX
40 # if __WORDSIZE == 64
41 # define __PRI64_PREFIX "l"
42 # else
43 # define __PRI64_PREFIX "ll"
44 # endif
45 #endif
46 
47 # define PRId64 __PRI64_PREFIX "d"
48 # define PRIu64 __PRI64_PREFIX "u"
49 #endif // ifndef PRI64d
50 
51 typedef void (*func_ptr)(void *);
52 
53 #ifndef IS_MINGW
54 typedef int boolean;
55 #endif
56 #undef TRUE
57 #undef FALSE
58 
59 #define TRUE 1
60 #define FALSE 0
61 
62 #ifndef ABS
63 #define ABS(a) (a > 0 ? a : -a)
64 #endif
65 
66 #ifndef PATH_MAX
67 #ifdef MAX_PATH
68 #define PATH_MAX MAX_PATH
69 #else
70 #define PATH_MAX 4096
71 #endif
72 #endif
73 
74 // Warning - CPU_BITS macro evaluates only at runtime (uses sizeof)
75 #define CPU_BITS ((sizeof(void *)) << 3)
76 
77 // all playback modules need to implement these functions, unless they are marked (optional)
78 
80 const char *module_check_init(void);
81 const char *version(void);
82 const char *get_description(void);
83 const char *get_init_rfx(int intention);
84 
85 #ifdef __WEED_EFFECTS_H__
86 const weed_plant_t **get_play_params(weed_bootstrap_f boot);
88 #endif
89 
91 const int *get_palette_list(void);
92 
94 boolean set_palette(int palette);
95 
97 uint64_t get_capabilities(int palette);
98 
99 #define LIVES_INTENTION_PLAY 1
100 #define LIVES_INTENTION_STREAM 2
101 #define LIVES_INTENTION_TRANSCODE 3
102 
103 #define VPP_CAN_RESIZE (1<<0)
104 #define VPP_CAN_RETURN (1<<1)
105 #define VPP_LOCAL_DISPLAY (1<<2)
106 #define VPP_LINEAR_GAMMA (1<<3)
107 #define VPP_CAN_RESIZE_WINDOW (1<<4)
108 #define VPP_CAN_LETTERBOX (1<<5)
109 #define VPP_CAN_CHANGE_PALETTE (1<<6)
110 // bit combinations: 0 & 5: can resize and letterbox; 5 without 0: cannot resize image, but it can offset the top left pixel
111 
113 boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv);
114 
125 boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data,
126  void **play_params);
127 
130 boolean play_frame(weed_layer_t *frame, int64_t tc, weed_layer_t *ret);
131 
133 void exit_screen(int16_t mouse_x, int16_t mouse_y);
134 
136 void module_unload(void);
137 
139 
140 // extra functions for fixed fps
141 const char *get_fps_list(int palette);
142 boolean set_fps(double fps);
143 
145 
146 // optional functions for yuv palettes
147 
150 
153 
156 
158 boolean set_yuv_palette_sampling(int sampling_type);
159 
161 boolean set_yuv_palette_clamping(int clamping_type);
162 
164 boolean set_yuv_palette_subspace(int subspace_type);
165 
167 boolean init_audio(int sample_rate, int nchans, int argc, char **argv);
168 
169 // only float handled for now
170 boolean render_audio_frame_float(float **audio, int nsamps);
171 
172 #ifdef USE_LIBWEED
173 weed_plant_t *weed_setup(weed_bootstrap_f);
174 #endif
175 
176 #ifdef __cplusplus
177 }
178 #endif /* __cplusplus */
179 
180 #endif // #ifndef __VIDPLUGIN_H__
get_init_rfx
const char * get_init_rfx(int intention)
optional
get_fps_list
const char * get_fps_list(int palette)
get_yuv_palette_clamping
const int * get_yuv_palette_clamping(int palette)
plugin send list of palette clamping types, in order of preference (optional); -1 terminates list
module_unload
void module_unload(void)
this is called when module is unloaded
version
const char * version(void)
set_yuv_palette_subspace
boolean set_yuv_palette_subspace(int subspace_type)
host sets the palette subspace (optional)
get_yuv_palette_subspace
const int * get_yuv_palette_subspace(int palette)
plugin send list of palette subspace types, in order of preference (optional); -1 terminates list
get_yuv_palette_sampling
const int * get_yuv_palette_sampling(int palette)
plugin send list of palette sampling types, in order of preference (optional); -1 terminates list
module_check_init
const char * module_check_init(void)
host calls at startup
set_fps
boolean set_fps(double fps)
init_screen
boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv)
ready the screen to play (optional)
exit_screen
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)
init_audio
boolean init_audio(int sample_rate, int nchans, int argc, char **argv)
newer style
set_palette
boolean set_palette(int palette)
host sets the palette used
palette
_palette * palette
interface colour settings
Definition: main.c:101
weed_layer_t
weed_plant_t weed_layer_t
Definition: colourspace.h:71
get_palette_list
const int * get_palette_list(void)
plugin send list of palettes, in order of preference
render_audio_frame_float
boolean render_audio_frame_float(float **audio, int nsamps)
weed_layer_t
weed_plant_t weed_layer_t
Definition: videoplugin.h:22
get_capabilities
uint64_t get_capabilities(int palette)
host will call this
set_yuv_palette_clamping
boolean set_yuv_palette_clamping(int clamping_type)
host sets the palette sampling (optional)
get_description
const char * get_description(void)
optional
func_ptr
void(* func_ptr)(void *)
Definition: videoplugin.h:51
play_frame
boolean play_frame(weed_layer_t *frame, int64_t tc, weed_layer_t *ret)
updated version of render_frame: input is a weed_layer and timecode, if ret is non NULL,...
set_yuv_palette_sampling
boolean set_yuv_palette_sampling(int sampling_type)
host sets the palette sampling (optional)
boolean
int boolean
Definition: videoplugin.h:54
render_frame
boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data, void **play_params)
display one frame, adding effects if you like, and resizing it to screen size if possible (VPP_CAN_RE...