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_DOUBLE
00291 } lqt_sample_format_t;
00292
00301 typedef struct quicktime_s quicktime_t;
00302
00303
00304
00305
00306
00326 #define QUICKTIME_DIVX "DIVX"
00327
00334 #define QUICKTIME_DIV3 "DIV3"
00335
00342 #define QUICKTIME_DV "dvc "
00343
00344
00351 #define QUICKTIME_DV_AVID "AVdv"
00352
00359 #define QUICKTIME_DV_AVID_A "dvcp"
00360
00368
00369 #define QUICKTIME_RAW "raw "
00370
00377
00378 #define QUICKTIME_JPEG "jpeg"
00379
00380
00381
00389 #define QUICKTIME_PNG "png "
00390
00398 #define QUICKTIME_MJPA "mjpa"
00399
00406 #define QUICKTIME_YUV2 "yuv2"
00407
00414 #define QUICKTIME_YUV4 "yuv4"
00415
00423 #define QUICKTIME_YUV420 "yv12"
00424
00431 #define QUICKTIME_2VUY "2vuy"
00432
00439 #define QUICKTIME_V308 "v308"
00440
00447 #define QUICKTIME_V408 "v408"
00448
00455 #define QUICKTIME_V210 "v210"
00456
00463 #define QUICKTIME_V410 "v410"
00464
00465
00466
00486 #define QUICKTIME_RAWAUDIO "raw "
00487
00494 #define QUICKTIME_IMA4 "ima4"
00495
00502 #define QUICKTIME_TWOS "twos"
00503
00510 #define QUICKTIME_ULAW "ulaw"
00511
00520 #define QUICKTIME_VORBIS "OggS"
00521
00529 #define QUICKTIME_MP3 ".mp3"
00530
00531
00532
00541
00542 int quicktime_major();
00543
00551 int quicktime_minor();
00552
00561 int quicktime_release();
00562
00574 int quicktime_check_sig(char *path);
00575
00586 quicktime_t* quicktime_open(const char *filename, int rd, int wr);
00587
00600 int quicktime_make_streamable(char *in_path, char *out_path);
00601
00615 void quicktime_set_copyright(quicktime_t *file, char *string);
00616
00623 void quicktime_set_name(quicktime_t *file, char *string);
00624
00631 void quicktime_set_info(quicktime_t *file, char *string);
00632
00640 char* quicktime_get_copyright(quicktime_t *file);
00641
00649 char* quicktime_get_name(quicktime_t *file);
00650
00657 char* quicktime_get_info(quicktime_t *file);
00658
00659
00675 int quicktime_set_audio(quicktime_t *file,
00676 int channels,
00677 long sample_rate,
00678 int bits,
00679 char *compressor);
00680
00691 void quicktime_set_framerate(quicktime_t *file, double framerate);
00692
00708 int quicktime_set_video(quicktime_t *file,
00709 int tracks,
00710 int frame_w,
00711 int frame_h,
00712 double frame_rate,
00713 char *compressor);
00714
00728 void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);
00729
00744 void quicktime_set_parameter(quicktime_t *file, char *key, void *value);
00745
00756 void quicktime_set_depth(quicktime_t *file,
00757 int depth,
00758 int track);
00759
00769 void quicktime_set_cmodel(quicktime_t *file, int colormodel);
00770
00781 void quicktime_set_row_span(quicktime_t *file, int row_span);
00782
00788 int quicktime_close(quicktime_t *file);
00789
00790
00791
00792
00801 long quicktime_audio_length(quicktime_t *file, int track);
00802
00814 long quicktime_video_length(quicktime_t *file, int track);
00815
00823
00824 long quicktime_audio_position(quicktime_t *file, int track);
00825
00835 long quicktime_video_position(quicktime_t *file, int track);
00836
00843
00844 int quicktime_video_tracks(quicktime_t *file);
00845
00852 int quicktime_audio_tracks(quicktime_t *file);
00853
00860 int quicktime_has_audio(quicktime_t *file);
00861
00869 long quicktime_sample_rate(quicktime_t *file, int track);
00870
00885 int quicktime_audio_bits(quicktime_t *file, int track);
00886
00894 int quicktime_track_channels(quicktime_t *file, int track);
00895
00908 char* quicktime_audio_compressor(quicktime_t *file, int track);
00909
00916 int quicktime_has_video(quicktime_t *file);
00917
00925 int quicktime_video_width(quicktime_t *file, int track);
00926
00934 int quicktime_video_height(quicktime_t *file, int track);
00935
00950 int quicktime_video_depth(quicktime_t *file, int track);
00951
00966 double quicktime_frame_rate(quicktime_t *file, int track);
00967
00978 char* quicktime_video_compressor(quicktime_t *file, int track);
00979
00980
00981
00993 long quicktime_frame_size(quicktime_t *file, long frame, int track);
00994
01004 int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);
01005
01006
01007
01008
01009
01010
01019 int quicktime_seek_start(quicktime_t *file);
01020
01021
01022
01031 int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track);
01032
01043 int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track);
01044
01045
01046 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);
01047
01048
01049
01050
01051 int quicktime_write_audio(quicktime_t *file, uint8_t *audio_buffer, long samples, int track);
01052
01067 int quicktime_write_frame(quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track);
01068
01081 long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);
01082
01083
01084
01085 int quicktime_read_frame_init(quicktime_t *file, int track);
01086 int quicktime_read_frame_end(quicktime_t *file, int track);
01087
01088
01089 long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track);
01090 void quicktime_insert_keyframe(quicktime_t *file, long frame, int track);
01091
01092 int quicktime_has_keyframes(quicktime_t *file, int track);
01093
01094
01095
01096
01097
01105 int quicktime_supported_video(quicktime_t *file, int track);
01106
01114 int quicktime_supported_audio(quicktime_t *file, int track);
01115
01127 int quicktime_reads_cmodel(quicktime_t *file,
01128 int colormodel,
01129 int track);
01130
01142 int quicktime_writes_cmodel(quicktime_t *file,
01143 int colormodel,
01144 int track);
01145
01146
01147
01148 int quicktime_divx_is_key(unsigned char *data, long size);
01149 int quicktime_divx_write_vol(unsigned char *data_start,
01150 int vol_width,
01151 int vol_height,
01152 int time_increment_resolution,
01153 double frame_rate);
01154 int quicktime_divx_has_vol(unsigned char *data);
01155
01156 int quicktime_div3_is_key(unsigned char *data, long size);
01157
01168 int quicktime_encode_video(quicktime_t *file,
01169 unsigned char **row_pointers,
01170 int track);
01171
01182 int quicktime_decode_video(quicktime_t *file,
01183 unsigned char **row_pointers,
01184 int track);
01185
01206 long quicktime_decode_scaled(quicktime_t *file,
01207 int in_x,
01208 int in_y,
01209 int in_w,
01210 int in_h,
01211 int out_w,
01212 int out_h,
01213 int color_model,
01214 unsigned char **row_pointers,
01215 int track);
01216
01217
01218
01219
01220
01238 int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);
01239
01252 int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);
01253
01261 int quicktime_dump(quicktime_t *file);
01262
01263
01264
01275 int quicktime_set_cpus(quicktime_t *file, int cpus);
01276
01277
01278
01279
01280
01281 void quicktime_set_preload(quicktime_t *file, int64_t preload);
01282
01283 int64_t quicktime_byte_position(quicktime_t *file);
01284
01293 void quicktime_set_avi(quicktime_t *file, int value);
01294
01295
01296
01297 #ifdef __cplusplus
01298 }
01299 #endif
01300
01301 #endif