LiVES  2.4.1-svn
 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 {
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 
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 
136 
138 boolean get_frame(const lives_clip_data_t *, int64_t frame, int *rowstrides, int height, void **pixel_data);
139 
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);
153 
154 void module_unload(void);
155 
156 
157 // little-endian
158 #define get_le16int(p) (*(p+1)<<8 | *(p))
159 #define get_le32int(p) ((get_le16int(p+2)<<16) | get_le16int(p))
160 #define get_le64int(p) (int64_t)(((uint64_t)(get_le32int(p+4))<<32) | (uint64_t)(get_le32int(p)))
161 
162 
163 #define MK_FOURCC(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d)
164 
165 
166 #define ABS(a) ((a)>=0.?(a):-(a))
167 
168 
174 };
175 
176 
177 
178 #ifdef __cplusplus
179 
180 }
181 #endif /* __cplusplus */
182 
183 #endif // #ifndef __DECPLUGIN_H__
lives_interlace_t
Definition: decplugin.h:41
Definition: decplugin.h:170
boolean get_frame(const lives_clip_data_t *, int64_t frame, int *rowstrides, int height, void **pixel_data)
frame starts at 0
boolean set_palette(lives_clip_data_t *)
Definition: decplugin.h:43
void rip_audio_cleanup(const lives_clip_data_t *)
lives_interlace_t
Definition: main.h:464
Definition: decplugin.h:44
int boolean
Definition: decplugin.h:35
LiVESMediaType
Definition: decplugin.h:169
Definition: decplugin.h:172
Definition: decplugin.h:171
Definition: plugins.h:205
void clip_data_free(lives_clip_data_t *)
free clip data - this should be called for each instance before unloading the module ...
lives_clip_data_t * get_clip_data(const char *URI, lives_clip_data_t *)
Definition: decplugin.h:42
void module_unload(void)
const char * version(void)
const char * module_check_init(void)
int64_t rip_audio(const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff)
Definition: decplugin.h:173