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 #pragma GCC visibility push(default)
00036
00037
00038
00039 typedef struct lqt_codec_info_s lqt_codec_info_t;
00040
00041
00124 typedef enum
00125 {
00126 LQT_LOG_ERROR = (1<<0),
00127 LQT_LOG_WARNING = (1<<1),
00128 LQT_LOG_INFO = (1<<2),
00129 LQT_LOG_DEBUG = (1<<3),
00130 } lqt_log_level_t;
00131
00140 typedef void (*lqt_log_callback_t)(lqt_log_level_t level,
00141 const char * domain,
00142 const char * message,
00143 void * data);
00144
00145
00152 typedef enum
00153 {
00154 LQT_FILE_NONE = 0,
00155 LQT_FILE_QT_OLD = (1<<0),
00156 LQT_FILE_QT = (1<<1),
00157 LQT_FILE_AVI = (1<<2),
00158 LQT_FILE_AVI_ODML = (1<<3),
00159 LQT_FILE_MP4 = (1<<4),
00160 LQT_FILE_M4A = (1<<5),
00161 LQT_FILE_3GP = (1<<6),
00162 } lqt_file_type_t;
00163
00164
00175 typedef enum
00176 {
00177 LQT_CHANNEL_UNKNOWN,
00178 LQT_CHANNEL_FRONT_LEFT,
00179 LQT_CHANNEL_FRONT_RIGHT,
00180 LQT_CHANNEL_FRONT_CENTER,
00181 LQT_CHANNEL_FRONT_CENTER_LEFT,
00182 LQT_CHANNEL_FRONT_CENTER_RIGHT,
00183 LQT_CHANNEL_BACK_CENTER,
00184 LQT_CHANNEL_BACK_LEFT,
00185 LQT_CHANNEL_BACK_RIGHT,
00186 LQT_CHANNEL_SIDE_LEFT,
00187 LQT_CHANNEL_SIDE_RIGHT,
00188 LQT_CHANNEL_LFE,
00189 } lqt_channel_t;
00190
00191
00255 typedef enum
00256 {
00257 LQT_INTERLACE_NONE = 0,
00258 LQT_INTERLACE_TOP_FIRST,
00259 LQT_INTERLACE_BOTTOM_FIRST
00260 } lqt_interlace_mode_t;
00261
00271 typedef enum
00272 {
00273 LQT_CHROMA_PLACEMENT_DEFAULT = 0,
00274 LQT_CHROMA_PLACEMENT_MPEG2,
00275 LQT_CHROMA_PLACEMENT_DVPAL,
00276 } lqt_chroma_placement_t;
00277
00287 typedef enum
00288 {
00289 LQT_SAMPLE_UNDEFINED = 0,
00290 LQT_SAMPLE_INT8,
00291 LQT_SAMPLE_UINT8,
00292 LQT_SAMPLE_INT16,
00293 LQT_SAMPLE_INT32,
00294 LQT_SAMPLE_FLOAT,
00295 LQT_SAMPLE_DOUBLE
00296 } lqt_sample_format_t;
00297
00306 typedef struct quicktime_s quicktime_t;
00307
00308
00309
00310
00311
00331 #define QUICKTIME_DIVX "DIVX"
00332
00339 #define QUICKTIME_DIV3 "DIV3"
00340
00347 #define QUICKTIME_DV "dvc "
00348
00349
00356 #define QUICKTIME_DV_AVID "AVdv"
00357
00364 #define QUICKTIME_DV_AVID_A "dvcp"
00365
00373
00374 #define QUICKTIME_RAW "raw "
00375
00382
00383 #define QUICKTIME_JPEG "jpeg"
00384
00385
00386
00394 #define QUICKTIME_PNG "png "
00395
00403 #define QUICKTIME_MJPA "mjpa"
00404
00411 #define QUICKTIME_YUV2 "yuv2"
00412
00419 #define QUICKTIME_YUV4 "yuv4"
00420
00428 #define QUICKTIME_YUV420 "yv12"
00429
00436 #define QUICKTIME_2VUY "2vuy"
00437
00444 #define QUICKTIME_V308 "v308"
00445
00452 #define QUICKTIME_V408 "v408"
00453
00460 #define QUICKTIME_V210 "v210"
00461
00468 #define QUICKTIME_V410 "v410"
00469
00470
00471
00491 #define QUICKTIME_RAWAUDIO "raw "
00492
00499 #define QUICKTIME_IMA4 "ima4"
00500
00507 #define QUICKTIME_TWOS "twos"
00508
00515 #define QUICKTIME_ULAW "ulaw"
00516
00525 #define QUICKTIME_VORBIS "OggS"
00526
00534 #define QUICKTIME_MP3 ".mp3"
00535
00536
00537
00546
00547 int quicktime_major();
00548
00556 int quicktime_minor();
00557
00566 int quicktime_release();
00567
00579 int quicktime_check_sig(char *path);
00580
00591 quicktime_t* quicktime_open(const char *filename, int rd, int wr);
00592
00605 int quicktime_make_streamable(char *in_path, char *out_path);
00606
00620 void quicktime_set_copyright(quicktime_t *file, char *string);
00621
00628 void quicktime_set_name(quicktime_t *file, char *string);
00629
00636 void quicktime_set_info(quicktime_t *file, char *string);
00637
00645 char* quicktime_get_copyright(quicktime_t *file);
00646
00654 char* quicktime_get_name(quicktime_t *file);
00655
00662 char* quicktime_get_info(quicktime_t *file);
00663
00664
00680 int quicktime_set_audio(quicktime_t *file,
00681 int channels,
00682 long sample_rate,
00683 int bits,
00684 char *compressor);
00685
00696 void quicktime_set_framerate(quicktime_t *file, double framerate);
00697
00713 int quicktime_set_video(quicktime_t *file,
00714 int tracks,
00715 int frame_w,
00716 int frame_h,
00717 double frame_rate,
00718 char *compressor);
00719
00733 void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);
00734
00749 void quicktime_set_parameter(quicktime_t *file, char *key, void *value);
00750
00761 void quicktime_set_depth(quicktime_t *file,
00762 int depth,
00763 int track);
00764
00774 void quicktime_set_cmodel(quicktime_t *file, int colormodel);
00775
00786 void quicktime_set_row_span(quicktime_t *file, int row_span);
00787
00793 int quicktime_close(quicktime_t *file);
00794
00795
00796
00797
00806 long quicktime_audio_length(quicktime_t *file, int track);
00807
00819 long quicktime_video_length(quicktime_t *file, int track);
00820
00828
00829 long quicktime_audio_position(quicktime_t *file, int track);
00830
00840 long quicktime_video_position(quicktime_t *file, int track);
00841
00848
00849 int quicktime_video_tracks(quicktime_t *file);
00850
00857 int quicktime_audio_tracks(quicktime_t *file);
00858
00865 int quicktime_has_audio(quicktime_t *file);
00866
00874 long quicktime_sample_rate(quicktime_t *file, int track);
00875
00890 int quicktime_audio_bits(quicktime_t *file, int track);
00891
00899 int quicktime_track_channels(quicktime_t *file, int track);
00900
00913 char* quicktime_audio_compressor(quicktime_t *file, int track);
00914
00921 int quicktime_has_video(quicktime_t *file);
00922
00930 int quicktime_video_width(quicktime_t *file, int track);
00931
00939 int quicktime_video_height(quicktime_t *file, int track);
00940
00955 int quicktime_video_depth(quicktime_t *file, int track);
00956
00971 double quicktime_frame_rate(quicktime_t *file, int track);
00972
00983 char* quicktime_video_compressor(quicktime_t *file, int track);
00984
00985
00986
00998 long quicktime_frame_size(quicktime_t *file, long frame, int track);
00999
01009 int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);
01010
01011
01012
01013
01014
01015
01024 int quicktime_seek_start(quicktime_t *file);
01025
01026
01027
01036 int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track);
01037
01048 int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track);
01049
01050
01051 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);
01052
01053
01054
01055
01056 int quicktime_write_audio(quicktime_t *file, uint8_t *audio_buffer, long samples, int track);
01057
01072 int quicktime_write_frame(quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track);
01073
01086 long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);
01087
01088
01089
01090 int quicktime_read_frame_init(quicktime_t *file, int track);
01091 int quicktime_read_frame_end(quicktime_t *file, int track);
01092
01093
01094 long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track);
01095 void quicktime_insert_keyframe(quicktime_t *file, long frame, int track);
01096
01097 int quicktime_has_keyframes(quicktime_t *file, int track);
01098
01099
01100
01101
01102
01110 int quicktime_supported_video(quicktime_t *file, int track);
01111
01119 int quicktime_supported_audio(quicktime_t *file, int track);
01120
01132 int quicktime_reads_cmodel(quicktime_t *file,
01133 int colormodel,
01134 int track);
01135
01147 int quicktime_writes_cmodel(quicktime_t *file,
01148 int colormodel,
01149 int track);
01150
01151
01152
01153 int quicktime_divx_is_key(unsigned char *data, long size);
01154 int quicktime_divx_write_vol(unsigned char *data_start,
01155 int vol_width,
01156 int vol_height,
01157 int time_increment_resolution,
01158 double frame_rate);
01159 int quicktime_divx_has_vol(unsigned char *data);
01160
01161 int quicktime_div3_is_key(unsigned char *data, long size);
01162
01173 int quicktime_encode_video(quicktime_t *file,
01174 unsigned char **row_pointers,
01175 int track);
01176
01187 int quicktime_decode_video(quicktime_t *file,
01188 unsigned char **row_pointers,
01189 int track);
01190
01211 long quicktime_decode_scaled(quicktime_t *file,
01212 int in_x,
01213 int in_y,
01214 int in_w,
01215 int in_h,
01216 int out_w,
01217 int out_h,
01218 int color_model,
01219 unsigned char **row_pointers,
01220 int track);
01221
01222
01223
01224
01225
01243 int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);
01244
01257 int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);
01258
01266 int quicktime_dump(quicktime_t *file);
01267
01268
01269
01280 int quicktime_set_cpus(quicktime_t *file, int cpus);
01281
01282
01283
01284
01285
01286 void quicktime_set_preload(quicktime_t *file, int64_t preload);
01287
01288 int64_t quicktime_byte_position(quicktime_t *file);
01289
01298 void quicktime_set_avi(quicktime_t *file, int value);
01299
01300 #pragma GCC visibility pop
01301
01302
01303 #ifdef __cplusplus
01304 }
01305 #endif
01306
01307 #endif