LiVES 1.4.9
|
00001 // LiVES - decoder plugin header 00002 // (c) G. Finch 2008 <salsaman@xs4all.nl,salsaman@gmail.com> 00003 // released under the GNU GPL 3 or later 00004 // see file COPYING or www.gnu.org for details 00005 00006 00007 #ifndef __DECPLUGIN_H__ 00008 #define __DECPLUGIN_H__ 00009 00010 #ifdef __cplusplus 00011 extern "C" 00012 { 00013 #endif /* __cplusplus */ 00014 00015 #include <inttypes.h> 00016 #include <sys/types.h> 00017 00018 // palettes, etc. 00019 #ifdef HAVE_SYSTEM_WEED 00020 #include "weed/weed-palettes.h" 00021 #else 00022 #include "../../../libweed/weed-palettes.h" 00023 #endif 00024 00025 #ifdef IS_DARWIN 00026 #ifndef lseek64 00027 #define lseek64 lseek 00028 #endif 00029 #ifndef off64_t 00030 #define off64_t off_t 00031 #endif 00032 #endif 00033 00034 00035 typedef int boolean; 00036 #undef TRUE 00037 #undef FALSE 00038 #define TRUE 1 00039 #define FALSE 0 00040 00041 typedef enum { 00042 LIVES_INTERLACE_NONE=0, 00043 LIVES_INTERLACE_BOTTOM_FIRST=1, 00044 LIVES_INTERLACE_TOP_FIRST=2 00045 } lives_interlace_t; 00046 00048 #define LIVES_SEEK_FAST (1<<0) 00049 00051 #define LIVES_SEEK_NEEDS_CALCULATION (1<<1) 00052 #define LIVES_SEEK_QUALITY_LOSS (1<<2) 00053 00054 00055 typedef struct { 00056 char *URI; 00057 00058 int nclips; 00059 char container_name[512]; 00060 00062 int current_clip; 00063 00064 // video data 00065 int width; 00066 int height; 00067 int64_t nframes; 00068 lives_interlace_t interlace; 00069 00072 int offs_x; 00073 int offs_y; 00074 int frame_width; 00075 int frame_height; 00076 00077 float par; 00078 00079 00080 float fps; 00081 00082 int *palettes; 00083 00085 int current_palette; 00086 00087 int YUV_sampling; 00088 int YUV_clamping; 00089 int YUV_subspace; 00090 char video_name[512]; 00091 00092 /* audio data */ 00093 int arate; 00094 int achans; 00095 int asamps; 00096 boolean asigned; 00097 boolean ainterleaf; 00098 char audio_name[512]; 00099 00100 int seek_flag; 00101 00102 void *priv; 00103 00104 } lives_clip_data_t; 00105 00106 00107 00108 // std functions 00109 const char *version(void); 00110 00111 00116 00117 // should be threadsafe, and clip_data should be freed with clip_data_free() when no longer required 00118 00119 lives_clip_data_t *get_clip_data(const char *URI, lives_clip_data_t *clip_data); 00120 00122 boolean get_frame(const lives_clip_data_t *cdata, int64_t frame, int *rowstrides, int height, void **pixel_data); 00123 00125 void clip_data_free(lives_clip_data_t *); 00126 00127 00128 00129 00130 // opt fns 00131 const char *module_check_init(void); 00132 00133 int64_t rip_audio (const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff); 00134 void rip_audio_cleanup(const lives_clip_data_t *); 00135 00136 void module_unload(void); 00137 00138 00139 // little-endian 00140 #define get_le16int(p) (*(p+1)<<8 | *(p)) 00141 #define get_le32int(p) ((get_le16int(p+2)<<16) | get_le16int(p)) 00142 #define get_le64int(p) (int64_t)(((uint64_t)(get_le32int(p+4))<<32) | (uint64_t)(get_le32int(p))) 00143 00144 00145 #define MK_FOURCC(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d) 00146 00147 00148 #define ABS(a) ((a)>=0.?(a):-(a)) 00149 00150 00151 enum LiVESMediaType { 00152 LIVES_MEDIA_TYPE_UNKNOWN=0, 00153 LIVES_MEDIA_TYPE_VIDEO, 00154 LIVES_MEDIA_TYPE_AUDIO, 00155 LIVES_MEDIA_TYPE_DATA 00156 }; 00157 00158 00159 00160 #ifdef __cplusplus 00161 00162 } 00163 #endif /* __cplusplus */ 00164 00165 #endif // #ifndef __DECPLUGIN_H__