cinelerra  4.6.src
About: Cinelerra is an advanced non-linear video editor and compositor. Community version. Cinelerra is an advanced non-linear video editor and compositor. 64 bit binary tested on Ubuntu-14.04 (decompress and run ./cinelerra in the directory). Community version.
  Fossies Dox: cinelerra-4.6.src.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
quicktime.h
Go to the documentation of this file.
1 #ifndef QUICKTIME_H
2 #define QUICKTIME_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 
9 #include "qtprivate.h"
10 
11 /* This is the reference for all your library entry points. */
12 
13 
14 
15 
16 
17 
18 /* ===== compression formats for which codecs exist ====== */
19 
20 /* Straight MPEG-4 */
21 #define QUICKTIME_DX50 "DX50"
22 #define QUICKTIME_MPG4 "MPG4"
23 #define QUICKTIME_MP42 "MP42"
24 #define QUICKTIME_DIVX "DIVX"
25 #define QUICKTIME_XVID "XVID"
26 #define QUICKTIME_MP4V "mp4v"
27 
28 #define QUICKTIME_H264 "avc1"
29 
30 
31 /* Basterdization of MPEG-4 which encodes alternating fields in series */
32 /* NOT STANDARD */
33 #define QUICKTIME_HV60 "HV60"
34 /* Basterdization of H264 which encodes alternating fields in series */
35 /* NOT STANDARD */
36 #define QUICKTIME_HV64 "HV64"
37 
38 /* McRoesoft MPEG-4 */
39 #define QUICKTIME_DIV3 "DIV3"
40 #define QUICKTIME_DIV3_LOWER "div3"
41 
42 /* Mormon MPEG-4 */
43 #define QUICKTIME_SVQ1 "SVQ1"
44 #define QUICKTIME_SVQ3 "SVQ3"
45 #define QUICKTIME_H263 "h263"
46 
47 /* Dee Vee */
48 #define QUICKTIME_DV "dvc "
49 #define QUICKTIME_DV25 "dv25"
50 #define QUICKTIME_DVSD "dvsd"
51 #define QUICKTIME_DVCP "dvcp" // PAL video inside Quicktime
52 
53 /* RGB uncompressed. Allows alpha */
54 #define QUICKTIME_RAW "raw "
55 
56 /* Jpeg Photo */
57 #define QUICKTIME_JPEG "jpeg"
58 #define QUICKTIME_MJPG "MJPG"
59 
60 /* Concatenated png images. Allows alpha */
61 #define QUICKTIME_PNG "png "
62 
63 /* Motion JPEG-A. */
64 #define QUICKTIME_MJPA "mjpa"
65 
66 /* YUV 4:2:2 */
67 #define QUICKTIME_YUV2 "yuv2"
68 
69 /* 8 bit Packed YUV (video range) 4:2:2 */
70 #define QUICKTIME_2VUY "2vuy"
71 
72 /* Crazy YUV 4:2:0 configuration for early tests. NOT STANDARD. */
73 #define QUICKTIME_YUV4 "yuv4"
74 
75 /* The following don't seem to work in Win but are documented. Only use
76  for intermediate storage since the documentation may be wrong. */
77 /* 8 bit Planar YUV 4:2:0 */
78 #define QUICKTIME_YUV420 "yv12"
79 
80 /* 8 bit Planar YUV 4:1:1 */
81 #define QUICKTIME_YUV411 "y411"
82 
83 /* 8 bit Packed YUV 4:2:2 */
84 #define QUICKTIME_YUV422 "yuv2"
85 
86 /* 8 bit Planar YUV 4:4:4 */
87 #define QUICKTIME_YUV444 "v308"
88 
89 /* 8 bit Planar YUVA 4:4:4:4 */
90 #define QUICKTIME_YUVA4444 "v408"
91 
92 /* 10 bit Planar YUV 4:4:4 */
93 #define QUICKTIME_YUV444_10bit "v410"
94 
95 /* ======== compression for which no codec exists ========== */
96 /* These are traditionally converted in hardware or not at all */
97 /* ======== Studies in different algorithms =============== */
98 
99 /* YUV9. Too horrible to look at. */
100 #define QUICKTIME_YUV9 "YVU9"
101 
102 /* RTjpeg, proprietary but fast? */
103 /* This is theoretically what nipple video uses. May get integrated later. */
104 #define QUICKTIME_RTJ0 "RTJ0"
105 
106 /* =================== Audio formats ======================= */
107 
108 /* Unsigned 8 bit but it uses the same fourcc as RGB uncompressed */
109 #ifndef QUICKTIME_RAW
110 #define QUICKTIME_RAW "raw "
111 #endif
112 
113 /* IMA4 */
114 #define QUICKTIME_IMA4 "ima4"
115 
116 /* Twos compliment 8, 16, 24 */
117 #define QUICKTIME_TWOS "twos"
118 #define QUICKTIME_SOWT "sowt"
119 
120 /* ulaw */
121 #define QUICKTIME_ULAW "ulaw"
122 
123 /* OGG Vorbis. NOT STANDARD */
124 #define QUICKTIME_VORBIS "OggS"
125 
126 /* MP3 Doesn't play in Win for some reason */
127 #define QUICKTIME_MP3 ".mp3"
128 
129 #define QUICKTIME_MP4A "mp4a"
130 #define QUICKTIME_QDM2 "QDM2"
131 
132 /* Mike Row Soft */
133 /* AVI decode only */
134 #define QUICKTIME_WMA "WMA "
135 
136 /* Some crazy derivative on ima4. NOT STANDARD */
137 #define QUICKTIME_WMX2 "wmx2"
138 
139 /* =========================== public interface ========================= */
140 
141 /* Get version information */
142 int quicktime_major(void);
143 int quicktime_minor(void);
144 int quicktime_release(void);
145 
146 /* return 1 if the file is a quicktime file */
147 int quicktime_check_sig(char *path);
148 
149 /* call this first to open the file and create all the objects */
150 quicktime_t* quicktime_open(char *filename, int rd, int wr);
151 
152 /* After quicktime_open and quicktime_set for the audio and video call this */
153 /* to generate a Microsoft AVI file. */
154 /* The allmighty requires the codec information in the beginning of the file */
155 /* while the index can either be in the beginning or the end. Thus */
156 /* You need to set the audio and video first. */
159 
160 /* Another Microsoft file format */
162 
163 
164 /* make the quicktime file streamable */
165 int quicktime_make_streamable(char *in_path, char *out_path);
166 
167 /* Set various options in the file. */
168 void quicktime_set_copyright(quicktime_t *file, const char *string);
169 void quicktime_set_name(quicktime_t *file, const char *string);
170 void quicktime_set_info(quicktime_t *file, const char *string);
174 
175 /* Read all the information about the file. */
176 /* Requires a MOOV atom be present in the file. */
177 /* If no MOOV atom exists return 1 else return 0. */
179 
180 /* set up tracks in a new file after opening and before writing */
181 /* returns the number of quicktime tracks allocated */
182 /* audio is stored two channels per quicktime track */
184  int channels,
185  long sample_rate,
186  int bits,
187  char *compressor);
188 /* Samplerate can be set after file is created */
189 void quicktime_set_framerate(quicktime_t *file, double framerate);
190 
191 /* Set aspect ratio. Only a few codecs support it. */
192 void quicktime_set_aspect(quicktime_t *file, double aspect);
193 
194 /* video is stored one layer per quicktime track */
196  int tracks,
197  int frame_w,
198  int frame_h,
199  double frame_rate,
200  char *compressor);
201 
202 /* routines for setting various video parameters */
203 /* should be called after set_video */
204 void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);
205 
206 /* Configure codec parameters with this */
207 /* It iterates through every track and sets the key in that codec to */
208 /* the value. The value can be any data type and the key must be a */
209 /* string which the codec understands. */
210 void quicktime_set_parameter(quicktime_t *file, const char *key, void *value);
211 
212 /* Get the english title of a codec based on its fourcc. */
213 /* Used by info boxed. */
214 char* quicktime_acodec_title(char *fourcc);
215 char* quicktime_vcodec_title(char *fourcc);
216 
217 
218 /* Set the depth of the track. */
220  int depth,
221  int track);
222 
223 
224 /* close the file and delete all the objects */
226 
227 /* get length information */
230 
231 /* get position information */
234 
235 /* get file information */
238 
240 
241 /* Get the samples per second */
243 
244 /* Get the number of bits for the twos codec */
246 
247 /* Get the number of audio channels in an audio track */
250 
254 
255 /* Number of bytes per pixel for the raw codec */
257 
258 /* Frames per second */
260 /* Frames per second as numerator over denominator*/
263 
264 /* FourCC of the video compressor */
266 
267 /* number of bytes of raw data in this frame */
269 
270 /* get the quicktime track and channel that the audio channel belongs to */
271 /* channels and tracks start on 0 */
272 int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);
273 
274 /* file positioning */
277 
278 /* set position of file descriptor relative to a track */
281 
282 /* ========================== Access to raw data follows. */
283 /* write data for one quicktime track */
284 /* the user must handle conversion to the channels in this track */
285 /*
286  * int quicktime_write_audio(quicktime_t *file,
287  * char *audio_buffer,
288  * long samples,
289  * int track);
290  */
292  unsigned char *video_buffer,
293  int64_t bytes,
294  int track);
295 
296 /* Read an entire chunk. */
297 /* read the number of bytes starting at the byte_start in the specified chunk */
298 /* You must provide enough space to store the chunk. */
299 int quicktime_read_chunk(quicktime_t *file, char *output, int track, int64_t chunk, int64_t byte_start, int64_t byte_len);
300 
301 /* read raw data */
302 long quicktime_read_audio(quicktime_t *file, char *audio_buffer, long samples, int track);
303 long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);
304 
305 /* for reading frame using a library that needs a file descriptor */
306 /* Frame caching doesn't work here. */
309 
310 /* One keyframe table for each track */
311 /* Returns -1 if no keyframe exists. In AVI this always returns -1 */
312 /* if the frame offset is over 1 Gig. McRowsoft you know. */
316 
317 /* Track has keyframes */
319 
320 /* ===================== Access to built in codecs follows. */
321 
322 /* If the codec for this track is supported in the library return 1. */
325 
326 
327 
328 /* The codecs can all support RGB in and out. */
329 /* To find out if other color models are supported, use these functions. */
330 /* Returns 1 if the codec can generate the color model with no conversion */
332  int colormodel,
333  int track);
334 
335 /* Returns 1 if the codec can write the color model with no conversion */
337  int colormodel,
338  int track);
339 
340 
341 /* Utilities for direct copy of MPEG-4 */
342 int quicktime_mpeg4_is_key(unsigned char *data, long size, char *codec_id);
343 int quicktime_mpeg4_write_vol(unsigned char *data_start,
344  int vol_width,
345  int vol_height,
346  int time_increment_resolution,
347  double frame_rate);
348 int quicktime_mpeg4_has_vol(unsigned char *data);
349 
350 /* Direct copy of H264 */
351 int quicktime_h264_is_key(unsigned char *data, long size, char *codec_id);
352 
353 
354 
355 
356 
357 
358 
359 
360 /* These should be called right before a decode or encode function */
361 /* Set the colormodel for the encoder and decoder interface */
362 void quicktime_set_cmodel(quicktime_t *file, int colormodel);
363 
364 /* Set row span in bytes for the encoder and decoder interface */
365 void quicktime_set_row_span(quicktime_t *file, int row_span);
366 
367 /* Set the decoding window for the decoder interface. If the dimensions are */
368 /* all -1, no scaling is used. The default is no scaling. */
370  int in_x, /* Location of input frame to take picture */
371  int in_y,
372  int in_w,
373  int in_h,
374  int out_w, /* Dimensions of output frame */
375  int out_h);
376 
377 /* Encode the frame into a frame buffer. */
379  unsigned char **row_pointers,
380  int track);
381 
382 /* Decode a frame */
384  unsigned char **row_pointers,
385  int track);
386 
387 /* Get memory used by video decoders. Only counts frame caches. */
389 void quicktime_set_cache_max(quicktime_t *file, int bytes);
390 
391 /* Decode or encode audio for a single channel into the buffer. */
392 /* Pass a buffer for the _i or the _f argument if you want int16 or float data. */
393 /* Notice that encoding requires an array of pointers to each channel. */
395  int16_t *output_i,
396  float *output_f,
397  long samples,
398  int channel);
400  int16_t **input_i,
401  float **input_f,
402  long samples);
403 
404 
405 
406 
407 
408 
409 
410 /* Dump the file structures for the currently opened file. */
412 
413 /* Specify the number of cpus to utilize. */
414 int quicktime_set_cpus(quicktime_t *file, int cpus);
415 
416 /* Specify whether to read contiguously or not. */
417 /* preload is the number of bytes to read ahead. */
418 /* This is no longer functional to the end user but is used to accelerate */
419 /* reading the header internally. */
421 
423 
424 
425 
426 #ifdef __cplusplus
427 }
428 #endif
429 
430 #endif
int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel)
Definition: quicktime.c:582
long quicktime_video_position(quicktime_t *file, int track)
Definition: quicktime.c:459
GLint GLint GLsizei GLsizei GLsizei depth
Definition: SDL_opengl.h:1549
enum CodecID codec_id
Definition: rtp.c:39
int quicktime_set_audio(quicktime_t *file, int channels, long sample_rate, int bits, char *compressor)
Definition: quicktime.c:228
int quicktime_seek_end(quicktime_t *file)
Definition: quicktime.c:423
long quicktime_video_length(quicktime_t *file, int track)
Definition: quicktime.c:446
char * filename
Definition: cdjpeg.h:133
Definition: mpg123.h:72
int quicktime_has_audio(quicktime_t *file)
Definition: quicktime.c:545
int quicktime_set_video(quicktime_t *file, int tracks, int frame_w, int frame_h, double frame_rate, char *compressor)
Definition: quicktime.c:261
int64_t quicktime_memory_usage(quicktime_t *file)
Definition: quicktime.c:1014
quicktime_t * file
Definition: yuv2mov.c:7
int quicktime_read_frame_init(quicktime_t *file, int track)
Definition: quicktime.c:976
long quicktime_audio_length(quicktime_t *file, int track)
Definition: quicktime.c:438
void quicktime_set_framerate(quicktime_t *file, double framerate)
Definition: quicktime.c:289
void quicktime_set_depth(quicktime_t *file, int depth, int track)
Definition: quicktime.c:664
long quicktime_audio_position(quicktime_t *file, int track)
Definition: quicktime.c:454
void quicktime_set_cache_max(quicktime_t *file, int bytes)
Definition: quicktime.c:1026
int quicktime_audio_tracks(quicktime_t *file)
Definition: quicktime.c:215
int quicktime_video_height(quicktime_t *file, int track)
Definition: quicktime.c:614
int quicktime_h264_is_key(unsigned char *data, long size, char *codec_id)
Definition: qth264.c:55
void quicktime_set_preload(quicktime_t *file, int64_t preload)
Definition: quicktime.c:397
int64_t quicktime_byte_position(quicktime_t *file)
Definition: util.c:326
int quicktime_major(void)
Definition: quicktime.c:1459
int quicktime_read_info(quicktime_t *file)
Definition: quicktime.c:1089
int quicktime_supported_video(quicktime_t *file, int track)
Definition: codecs.c:201
int quicktime_track_channels(quicktime_t *file, int track)
Definition: quicktime.c:574
int fourcc
Definition: highgui_c.h:454
int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track)
Definition: quicktime.c:519
char * quicktime_get_copyright(quicktime_t *file)
Definition: quicktime.c:189
EXTERN_ char out_path[256]
Definition: global.h:443
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: SDL_opengl.h:1524
void quicktime_set_name(quicktime_t *file, const char *string)
Definition: quicktime.c:179
int quicktime_has_video(quicktime_t *file)
Definition: quicktime.c:601
int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel)
Definition: codecs.c:297
void quicktime_set_aspect(quicktime_t *file, double aspect)
EXTERN_ unsigned char ** row_pointers
Definition: global.h:486
int quicktime_frame_rate_n(quicktime_t *file, int track)
Definition: quicktime.c:688
void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float)
Definition: jpeg.c:42
char * quicktime_vcodec_title(char *fourcc)
Definition: plugin.c:222
void quicktime_set_info(quicktime_t *file, const char *string)
Definition: quicktime.c:184
int quicktime_video_tracks(quicktime_t *file)
Definition: quicktime.c:205
char * quicktime_acodec_title(char *fourcc)
Definition: plugin.c:186
int quicktime_dump(quicktime_t *file)
Definition: quicktime.c:1248
long quicktime_frame_size(quicktime_t *file, long frame, int track)
Definition: quicktime.c:822
unsigned int bits
Definition: tif_acorn.c:68
const char int * value
Definition: highgui_c.h:150
int quicktime_seek_start(quicktime_t *file)
Definition: quicktime.c:431
int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples)
Definition: codecs.c:322
char * in_path
Definition: mts2mp4.c:92
int quicktime_make_streamable(char *in_path, char *out_path)
Definition: quicktime.c:9
int quality
Definition: jpeglib.h:919
EXTERN_ double frame_rate
Definition: global.h:530
char * quicktime_get_name(quicktime_t *file)
Definition: quicktime.c:194
long quicktime_read_audio(quicktime_t *file, char *audio_buffer, long samples, int track)
Definition: quicktime.c:759
float ** audio_buffer
Definition: mts2mp4.c:68
int quicktime_encode_video(quicktime_t *file, unsigned char **row_pointers, int track)
Definition: codecs.c:286
double quicktime_frame_rate(quicktime_t *file, int track)
Definition: quicktime.c:674
int quicktime_mpeg4_has_vol(unsigned char *data)
Definition: mpeg4.c:139
int quicktime_check_sig(char *path)
Definition: quicktime.c:1262
void quicktime_set_avi(quicktime_t *file, int value)
Definition: quicktime.c:1326
int quicktime_minor(void)
Definition: quicktime.c:1464
void quicktime_insert_keyframe(quicktime_t *file, int64_t frame, int track)
Definition: quicktime.c:911
long quicktime_decode_video(quicktime_t *file, unsigned char **row_pointers, int track)
Definition: codecs.c:230
unsigned long channels
Definition: QCDFAAD.c:518
int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track)
Definition: quicktime.c:499
int quicktime_reads_cmodel(quicktime_t *file, int colormodel, int track)
Definition: codecs.c:337
long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track)
Definition: quicktime.c:845
char * quicktime_get_info(quicktime_t *file)
Definition: quicktime.c:199
int quicktime_close(quicktime_t *file)
Definition: quicktime.c:1409
int quicktime_has_keyframes(quicktime_t *file, int track)
Definition: quicktime.c:964
int quicktime_audio_bits(quicktime_t *file, int track)
Definition: quicktime.c:561
tuple track
Definition: browse.py:21
int quicktime_video_width(quicktime_t *file, int track)
Definition: quicktime.c:607
int quicktime_mpeg4_is_key(unsigned char *data, long size, char *codec_id)
Definition: mpeg4.c:111
int quicktime_set_cpus(quicktime_t *file, int cpus)
Definition: quicktime.c:391
int quicktime_write_frame(quicktime_t *file, unsigned char *video_buffer, int64_t bytes, int track)
Definition: quicktime.c:733
int64_t quicktime_get_keyframe_after(quicktime_t *file, int64_t frame, int track)
Definition: quicktime.c:889
int quicktime_writes_cmodel(quicktime_t *file, int colormodel, int track)
Definition: codecs.c:345
quicktime_t * quicktime_open(char *filename, int rd, int wr)
Definition: quicktime.c:1347
void quicktime_set_parameter(quicktime_t *file, const char *key, void *value)
Definition: codecs.c:268
signed short int16_t
Definition: inttypes.h:2
int quicktime_video_depth(quicktime_t *file, int track)
Definition: quicktime.c:621
int quicktime_supported_audio(quicktime_t *file, int track)
Definition: codecs.c:215
int size
int quicktime_mpeg4_write_vol(unsigned char *data_start, int vol_width, int vol_height, int time_increment_resolution, double frame_rate)
Definition: mpeg4.c:202
int quicktime_read_chunk(quicktime_t *file, char *output, int track, int64_t chunk, int64_t byte_start, int64_t byte_len)
Definition: quicktime.c:812
void quicktime_set_asf(quicktime_t *file, int value)
Definition: quicktime.c:1341
int quicktime_frame_rate_d(quicktime_t *file, int track)
Definition: quicktime.c:695
void quicktime_set_cmodel(quicktime_t *file, int colormodel)
Definition: quicktime.c:628
int quicktime_is_avi(quicktime_t *file)
Definition: quicktime.c:1335
int64_t quicktime_get_keyframe_before(quicktime_t *file, int64_t frame, int track)
Definition: quicktime.c:867
char * quicktime_audio_compressor(quicktime_t *file, int track)
Definition: quicktime.c:569
long long int64_t
Definition: common.h:206
void quicktime_set_copyright(quicktime_t *file, const char *string)
Definition: quicktime.c:174
void quicktime_set_window(quicktime_t *file, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h)
Definition: quicktime.c:638
char * quicktime_video_compressor(quicktime_t *file, int track)
Definition: quicktime.c:702
int quicktime_read_frame_end(quicktime_t *file, int track)
Definition: quicktime.c:988
void quicktime_set_row_span(quicktime_t *file, int row_span)
Definition: quicktime.c:633
int quicktime_release(void)
Definition: quicktime.c:1469
Definition: t2s.h:111
long quicktime_sample_rate(quicktime_t *file, int track)
Definition: quicktime.c:551