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
10extern "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
22typedef 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
51typedef void (*func_ptr)(void *);
52
53#ifndef IS_MINGW
54typedef 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
80const char *module_check_init(void);
81const char *version(void);
82const char *get_description(void);
83const char *get_init_rfx(int intention);
84
85#ifdef __WEED_EFFECTS_H__
87const weed_plant_t **get_play_params(weed_bootstrap_f boot);
88#endif
89
91const int *get_palette_list(void);
92
94boolean set_palette(int palette);
95
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
113boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv);
114
125boolean render_frame(int hsize, int vsize, int64_t timecode, void **pixel_data, void **return_data,
126 void **play_params);
127
130boolean play_frame(weed_layer_t *frame, int64_t tc, weed_layer_t *ret);
131
133void exit_screen(int16_t mouse_x, int16_t mouse_y);
134
136void module_unload(void);
137
139
140// extra functions for fixed fps
141const char *get_fps_list(int palette);
142boolean set_fps(double fps);
143
145
146// optional functions for yuv palettes
147
150
153
156
158boolean set_yuv_palette_sampling(int sampling_type);
159
161boolean set_yuv_palette_clamping(int clamping_type);
162
164boolean set_yuv_palette_subspace(int subspace_type);
165
167boolean init_audio(int sample_rate, int nchans, int argc, char **argv);
168
169// only float handled for now
170boolean render_audio_frame_float(float **audio, int nsamps);
171
172#ifdef USE_LIBWEED
173weed_plant_t *weed_setup(weed_bootstrap_f);
174#endif
175
176#ifdef __cplusplus
177}
178#endif /* __cplusplus */
179
180#endif // #ifndef __VIDPLUGIN_H__
weed_plant_t weed_layer_t
Definition: colourspace.h:71
_palette * palette
interface colour settings
Definition: main.c:101
boolean init_audio(int sample_rate, int nchans, int argc, char **argv)
newer style
uint64_t get_capabilities(int palette)
host will call this
boolean set_yuv_palette_clamping(int clamping_type)
host sets the palette sampling (optional)
void module_unload(void)
this is called when module is unloaded
boolean init_screen(int width, int height, boolean fullscreen, uint64_t window_id, int argc, char **argv)
ready the screen to play (optional)
const int * get_yuv_palette_clamping(int palette)
plugin send list of palette clamping types, in order of preference (optional); -1 terminates list
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...
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,...
const int * get_yuv_palette_sampling(int palette)
plugin send list of palette sampling types, in order of preference (optional); -1 terminates list
boolean set_yuv_palette_sampling(int sampling_type)
host sets the palette sampling (optional)
int boolean
Definition: videoplugin.h:54
const char * module_check_init(void)
host calls at startup
const char * version(void)
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)
const char * get_fps_list(int palette)
boolean set_yuv_palette_subspace(int subspace_type)
host sets the palette subspace (optional)
void(* func_ptr)(void *)
Definition: videoplugin.h:51
const int * get_palette_list(void)
plugin send list of palettes, in order of preference
boolean set_fps(double fps)
const char * get_description(void)
optional
const char * get_init_rfx(int intention)
optional
boolean render_audio_frame_float(float **audio, int nsamps)
boolean set_palette(int palette)
host sets the palette used
weed_plant_t weed_layer_t
Definition: videoplugin.h:22
const int * get_yuv_palette_subspace(int palette)
plugin send list of palette subspace types, in order of preference (optional); -1 terminates list