LiVES  1.6.4-svn
 All Data Structures 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 #ifdef IS_DARWIN
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 
63 
64  // video data
65  int width;
66  int height;
67  int64_t nframes;
68  lives_interlace_t interlace;
69 
72  int offs_x;
73  int offs_y;
76 
77  float par;
78 
79 
80  float fps;
81 
82  int *palettes;
83 
85  int current_palette;
86 
87  int YUV_sampling;
88  int YUV_clamping;
89  int YUV_subspace;
90  char video_name[512];
91 
92  /* audio data */
93  int arate;
94  int achans;
95  int asamps;
96  boolean asigned;
97  boolean ainterleaf;
98  char audio_name[512];
99 
100  int seek_flag;
101 
102 #define SYNC_HINT_AUDIO_TRIM_START 1
103 
104  int sync_hint;
105 
106 
107  void *priv;
108 
110 
111 
112 
113 // std functions
114 const char *version(void);
115 
116 
121 
122 // should be threadsafe, and clip_data should be freed with clip_data_free() when no longer required
123 
124 lives_clip_data_t *get_clip_data(const char *URI, lives_clip_data_t *clip_data);
125 
127  boolean get_frame(const lives_clip_data_t *cdata, int64_t frame, int *rowstrides, int height, void **pixel_data);
128 
131 
132 
133 
134 
135 // opt fns
136 const char *module_check_init(void);
137 
138 int64_t rip_audio (const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff);
140 
141 void module_unload(void);
142 
143 
144 // little-endian
145 #define get_le16int(p) (*(p+1)<<8 | *(p))
146 #define get_le32int(p) ((get_le16int(p+2)<<16) | get_le16int(p))
147 #define get_le64int(p) (int64_t)(((uint64_t)(get_le32int(p+4))<<32) | (uint64_t)(get_le32int(p)))
148 
149 
150 #define MK_FOURCC(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d)
151 
152 
153 #define ABS(a) ((a)>=0.?(a):-(a))
154 
155 
161 };
162 
163 
164 
165 #ifdef __cplusplus
166 
167 }
168 #endif /* __cplusplus */
169 
170 #endif // #ifndef __DECPLUGIN_H__