00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QUICKTIME_H
00026 #define QUICKTIME_H
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 #include <inttypes.h>
00033 #include <stddef.h>
00034
00035
00036
00119 typedef enum
00120 {
00121 LQT_LOG_ERROR = (1<<0),
00122 LQT_LOG_WARNING = (1<<1),
00123 LQT_LOG_INFO = (1<<2),
00124 LQT_LOG_DEBUG = (1<<3),
00125 } lqt_log_level_t;
00126
00135 typedef void (*lqt_log_callback_t)(lqt_log_level_t level,
00136 const char * domain,
00137 const char * message,
00138 void * data);
00139
00140
00147 typedef enum
00148 {
00149 LQT_FILE_NONE = 0,
00150 LQT_FILE_QT_OLD = (1<<0),
00151 LQT_FILE_QT = (1<<1),
00152 LQT_FILE_AVI = (1<<2),
00153 LQT_FILE_AVI_ODML = (1<<3),
00154 LQT_FILE_MP4 = (1<<4),
00155 LQT_FILE_M4A = (1<<5),
00156 LQT_FILE_3GP = (1<<6),
00157 } lqt_file_type_t;
00158
00159
00170 typedef enum
00171 {
00172 LQT_CHANNEL_UNKNOWN,
00173 LQT_CHANNEL_FRONT_LEFT,
00174 LQT_CHANNEL_FRONT_RIGHT,
00175 LQT_CHANNEL_FRONT_CENTER,
00176 LQT_CHANNEL_FRONT_CENTER_LEFT,
00177 LQT_CHANNEL_FRONT_CENTER_RIGHT,
00178 LQT_CHANNEL_BACK_CENTER,
00179 LQT_CHANNEL_BACK_LEFT,
00180 LQT_CHANNEL_BACK_RIGHT,
00181 LQT_CHANNEL_SIDE_LEFT,
00182 LQT_CHANNEL_SIDE_RIGHT,
00183 LQT_CHANNEL_LFE,
00184 } lqt_channel_t;
00185
00186
00250 typedef enum
00251 {
00252 LQT_INTERLACE_NONE = 0,
00253 LQT_INTERLACE_TOP_FIRST,
00254 LQT_INTERLACE_BOTTOM_FIRST
00255 } lqt_interlace_mode_t;
00256
00266 typedef enum
00267 {
00268 LQT_CHROMA_PLACEMENT_DEFAULT = 0,
00269 LQT_CHROMA_PLACEMENT_MPEG2,
00270 LQT_CHROMA_PLACEMENT_DVPAL,
00271 } lqt_chroma_placement_t;
00272
00282 typedef enum
00283 {
00284 LQT_SAMPLE_UNDEFINED = 0,
00285 LQT_SAMPLE_INT8,
00286 LQT_SAMPLE_UINT8,
00287 LQT_SAMPLE_INT16,
00288 LQT_SAMPLE_INT32,
00289 LQT_SAMPLE_FLOAT
00290 } lqt_sample_format_t;
00291
00300 typedef struct quicktime_s quicktime_t;
00301
00302
00303
00304
00305
00325 #define QUICKTIME_DIVX "DIVX"
00326
00333 #define QUICKTIME_DIV3 "DIV3"
00334
00341 #define QUICKTIME_DV "dvc "
00342
00343
00350 #define QUICKTIME_DV_AVID "AVdv"
00351
00358 #define QUICKTIME_DV_AVID_A "dvcp"
00359
00367
00368 #define QUICKTIME_RAW "raw "
00369
00376
00377 #define QUICKTIME_JPEG "jpeg"
00378
00379
00380
00388 #define QUICKTIME_PNG "png "
00389
00397 #define QUICKTIME_MJPA "mjpa"
00398
00405 #define QUICKTIME_YUV2 "yuv2"
00406
00413 #define QUICKTIME_YUV4 "yuv4"
00414
00422 #define QUICKTIME_YUV420 "yv12"
00423
00430 #define QUICKTIME_2VUY "2vuy"
00431
00438 #define QUICKTIME_V308 "v308"
00439
00446 #define QUICKTIME_V408 "v408"
00447
00454 #define QUICKTIME_V210 "v210"
00455
00462 #define QUICKTIME_V410 "v410"
00463
00464
00465
00485 #define QUICKTIME_RAWAUDIO "raw "
00486
00493 #define QUICKTIME_IMA4 "ima4"
00494
00501 #define QUICKTIME_TWOS "twos"
00502
00509 #define QUICKTIME_ULAW "ulaw"
00510
00519 #define QUICKTIME_VORBIS "OggS"
00520
00528 #define QUICKTIME_MP3 ".mp3"
00529
00530
00531
00540
00541 int quicktime_major();
00542
00550 int quicktime_minor();
00551
00560 int quicktime_release();
00561
00573 int quicktime_check_sig(char *path);
00574
00585 quicktime_t* quicktime_open(const char *filename, int rd, int wr);
00586
00599 int quicktime_make_streamable(char *in_path, char *out_path);
00600
00614 void quicktime_set_copyright(quicktime_t *file, char *string);
00615
00622 void quicktime_set_name(quicktime_t *file, char *string);
00623
00630 void quicktime_set_info(quicktime_t *file, char *string);
00631
00639 char* quicktime_get_copyright(quicktime_t *file);
00640
00648 char* quicktime_get_name(quicktime_t *file);
00649
00656 char* quicktime_get_info(quicktime_t *file);
00657
00658
00674 int quicktime_set_audio(quicktime_t *file,
00675 int channels,
00676 long sample_rate,
00677 int bits,
00678 char *compressor);
00679
00690 void quicktime_set_framerate(quicktime_t *file, double framerate);
00691
00707 int quicktime_set_video(quicktime_t *file,
00708 int tracks,
00709 int frame_w,
00710 int frame_h,
00711 double frame_rate,
00712 char *compressor);
00713
00727 void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);
00728
00743 void quicktime_set_parameter(quicktime_t *file, char *key, void *value);
00744
00755 void quicktime_set_depth(quicktime_t *file,
00756 int depth,
00757 int track);
00758
00768 void quicktime_set_cmodel(quicktime_t *file, int colormodel);
00769
00780 void quicktime_set_row_span(quicktime_t *file, int row_span);
00781
00787 int quicktime_close(quicktime_t *file);
00788
00789
00790
00791
00800 long quicktime_audio_length(quicktime_t *file, int track);
00801
00813 long quicktime_video_length(quicktime_t *file, int track);
00814
00822
00823 long quicktime_audio_position(quicktime_t *file, int track);
00824
00834 long quicktime_video_position(quicktime_t *file, int track);
00835
00842
00843 int quicktime_video_tracks(quicktime_t *file);
00844
00851 int quicktime_audio_tracks(quicktime_t *file);
00852
00859 int quicktime_has_audio(quicktime_t *file);
00860
00868 long quicktime_sample_rate(quicktime_t *file, int track);
00869
00884 int quicktime_audio_bits(quicktime_t *file, int track);
00885
00893 int quicktime_track_channels(quicktime_t *file, int track);
00894
00907 char* quicktime_audio_compressor(quicktime_t *file, int track);
00908
00915 int quicktime_has_video(quicktime_t *file);
00916
00924 int quicktime_video_width(quicktime_t *file, int track);
00925
00933 int quicktime_video_height(quicktime_t *file, int track);
00934
00949 int quicktime_video_depth(quicktime_t *file, int track);
00950
00965 double quicktime_frame_rate(quicktime_t *file, int track);
00966
00977 char* quicktime_video_compressor(quicktime_t *file, int track);
00978
00979
00980
00992 long quicktime_frame_size(quicktime_t *file, long frame, int track);
00993
01003 int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);
01004
01005
01006
01007
01008
01009
01018 int quicktime_seek_start(quicktime_t *file);
01019
01020
01021
01030 int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track);
01031
01042 int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track);
01043
01044
01045
01046
01047 int quicktime_write_audio(quicktime_t *file, uint8_t *audio_buffer, long samples, int track);
01048
01063 int quicktime_write_frame(quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track);
01064
01077 long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);
01078
01079
01080
01081 int quicktime_read_frame_init(quicktime_t *file, int track);
01082 int quicktime_read_frame_end(quicktime_t *file, int track);
01083
01084
01085 long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track);
01086 void quicktime_insert_keyframe(quicktime_t *file, long frame, int track);
01087
01088 int quicktime_has_keyframes(quicktime_t *file, int track);
01089
01090
01091
01092
01093
01101 int quicktime_supported_video(quicktime_t *file, int track);
01102
01110 int quicktime_supported_audio(quicktime_t *file, int track);
01111
01123 int quicktime_reads_cmodel(quicktime_t *file,
01124 int colormodel,
01125 int track);
01126
01138 int quicktime_writes_cmodel(quicktime_t *file,
01139 int colormodel,
01140 int track);
01141
01142
01143
01144 int quicktime_divx_is_key(unsigned char *data, long size);
01145 int quicktime_divx_write_vol(unsigned char *data_start,
01146 int vol_width,
01147 int vol_height,
01148 int time_increment_resolution,
01149 double frame_rate);
01150 int quicktime_divx_has_vol(unsigned char *data);
01151
01152 int quicktime_div3_is_key(unsigned char *data, long size);
01153
01164 int quicktime_encode_video(quicktime_t *file,
01165 unsigned char **row_pointers,
01166 int track);
01167
01178 int quicktime_decode_video(quicktime_t *file,
01179 unsigned char **row_pointers,
01180 int track);
01181
01202 long quicktime_decode_scaled(quicktime_t *file,
01203 int in_x,
01204 int in_y,
01205 int in_w,
01206 int in_h,
01207 int out_w,
01208 int out_h,
01209 int color_model,
01210 unsigned char **row_pointers,
01211 int track);
01212
01213
01214
01215
01216
01234 int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);
01235
01248 int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);
01249
01257 int quicktime_dump(quicktime_t *file);
01258
01259
01260
01271 int quicktime_set_cpus(quicktime_t *file, int cpus);
01272
01273
01274
01275
01276
01277 void quicktime_set_preload(quicktime_t *file, int64_t preload);
01278
01279 int64_t quicktime_byte_position(quicktime_t *file);
01280
01289 void quicktime_set_avi(quicktime_t *file, int value);
01290
01291
01292
01293 #ifdef __cplusplus
01294 }
01295 #endif
01296
01297 #endif