LiVES 2.4.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
decplugin.h
Go to the documentation of this file.
1 // LiVES - decoder plugin header
2 // (c) G. Finch 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
7 #ifndef __DECPLUGIN_H__
8 #define __DECPLUGIN_H__
9
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif /* __cplusplus */
14
15 #include <inttypes.h>
16 #include <sys/types.h>
17
18 // palettes, etc.
19 #ifdef HAVE_SYSTEM_WEED
20 #include <weed/weed-palettes.h>
21 #else
22 #include "../../../libweed/weed-palettes.h"
23 #endif
24
25 #if defined (IS_DARWIN) || defined (__FreeBSD__)
26 #ifndef lseek64
27 #define lseek64 lseek
28 #endif
29 #ifndef off64_t
30 #define off64_t off_t
31 #endif
32 #endif
33
34
35 typedef int boolean;
36 #undef TRUE
37 #undef FALSE
38 #define TRUE 1
39 #define FALSE 0
40
41 typedef enum {
42 LIVES_INTERLACE_NONE=0,
43 LIVES_INTERLACE_BOTTOM_FIRST=1,
44 LIVES_INTERLACE_TOP_FIRST=2
45 } lives_interlace_t;
46
48 #define LIVES_SEEK_FAST (1<<0)
49
51 #define LIVES_SEEK_NEEDS_CALCULATION (1<<1)
52 #define LIVES_SEEK_QUALITY_LOSS (1<<2)
53
54
55 typedef struct {
56 char *URI;
57
58 int nclips;
59 char container_name[512];
60
61 char title[256];
62 char author[256];
63 char comment[256];
64
66 int current_clip;
67
68 // video data
69 int width;
70 int height;
71 int64_t nframes;
72 lives_interlace_t interlace;
73
76 int offs_x;
77 int offs_y;
78 int frame_width;
79 int frame_height;
80
81 float par;
82
83 float video_start_time;
84
85 float fps;
86
87 int *palettes;
88
90 int current_palette;
91
92 int YUV_sampling;
93 int YUV_clamping;
94 int YUV_subspace;
95 char video_name[512];
96
97 /* audio data */
98 int arate;
99 int achans;
100 int asamps;
101 boolean asigned;
102 boolean ainterleaf;
103 char audio_name[512];
104
105 int seek_flag;
106
107 #define SYNC_HINT_AUDIO_TRIM_START (1<<0)
108 #define SYNC_HINT_AUDIO_PAD_START (1<<1)
109 #define SYNC_HINT_AUDIO_TRIM_END (1<<2)
110 #define SYNC_HINT_AUDIO_PAD_END (1<<3)
111
112 #define SYNC_HINT_VIDEO_PAD_START (1<<4)
113 #define SYNC_HINT_VIDEO_PAD_END (1<<5)
114
115 int sync_hint;
116
117
118 void *priv;
119
120 } lives_clip_data_t;
121
122
123
124 // std functions
125 const char *version(void);
126
127
132
133 // should be threadsafe, and clip_data should be freed with clip_data_free() when no longer required
134
135 lives_clip_data_t *get_clip_data(const char *URI, lives_clip_data_t *);
136
138 boolean get_frame(const lives_clip_data_t *, int64_t frame, int *rowstrides, int height, void **pixel_data);
139
141 void clip_data_free(lives_clip_data_t *);
142
143
144
145
146 // opt fns
147 const char *module_check_init(void);
148
149 boolean set_palette(lives_clip_data_t *);
150
151 int64_t rip_audio(const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff);
152 boolean rip_audio_sequential(const lives_clip_data_t *, const char *fname);
153 void rip_audio_cleanup(const lives_clip_data_t *);
154
155 void module_unload(void);
156
157
158 // little-endian
159 #define get_le16int(p) (*(p+1)<<8 | *(p))
160 #define get_le32int(p) ((get_le16int(p+2)<<16) | get_le16int(p))
161 #define get_le64int(p) (int64_t)(((uint64_t)(get_le32int(p+4))<<32) | (uint64_t)(get_le32int(p)))
162
163
164 #define MK_FOURCC(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d)
165
166
167 #define ABS(a) ((a)>=0.?(a):-(a))
168
169
170 double get_fps(const char *uri);
171
172 enum LiVESMediaType {
173 LIVES_MEDIA_TYPE_UNKNOWN=0,
174 LIVES_MEDIA_TYPE_VIDEO,
175 LIVES_MEDIA_TYPE_AUDIO,
176 LIVES_MEDIA_TYPE_DATA
177 };
178
179
180
181 #ifdef __cplusplus
182
183 }
184 #endif /* __cplusplus */
185
186 #endif // #ifndef __DECPLUGIN_H__
rip_audio_sequential
boolean rip_audio_sequential(const lives_clip_data_t *, const char *fname)
get_fps
double get_fps(const char *uri)
boolean
int boolean
Definition: videoplugin.h:50
LIVES_MEDIA_TYPE_UNKNOWN
Definition: decplugin.h:173
get_frame
boolean get_frame(const lives_clip_data_t *, int64_t frame, int *rowstrides, int height, void **pixel_data)
frame starts at 0
set_palette
boolean set_palette(int palette)
host sets the palette used
LIVES_INTERLACE_BOTTOM_FIRST
Definition: main.h:476
LIVES_INTERLACE_TOP_FIRST
Definition: main.h:477
version
const char * version(void)
rip_audio_cleanup
void rip_audio_cleanup(const lives_clip_data_t *)
lives_interlace_t
lives_interlace_t
Definition: main.h:474
LiVESMediaType
LiVESMediaType
Definition: decplugin.h:172
LIVES_MEDIA_TYPE_AUDIO
Definition: decplugin.h:175
LIVES_MEDIA_TYPE_VIDEO
Definition: decplugin.h:174
lives_clip_data_t
Definition: plugins.h:205
clip_data_free
void clip_data_free(lives_clip_data_t *)
free clip data - this should be called for each instance before unloading the module ...
module_check_init
const char * module_check_init(void)
host calls at startup
get_clip_data
lives_clip_data_t * get_clip_data(const char *URI, lives_clip_data_t *)
rip_audio
int64_t rip_audio(const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff)
LIVES_MEDIA_TYPE_DATA
Definition: decplugin.h:176
module_unload
void module_unload(void)
this is called when module is unloaded
LIVES_INTERLACE_NONE
Definition: main.h:475