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 #ifdef __GNUC__
00036 #pragma GCC visibility push(default)
00037 #endif
00038
00039
00040
00041 typedef struct lqt_codec_info_s lqt_codec_info_t;
00042
00043
00126 typedef enum
00127 {
00128 LQT_LOG_ERROR = (1<<0),
00129 LQT_LOG_WARNING = (1<<1),
00130 LQT_LOG_INFO = (1<<2),
00131 LQT_LOG_DEBUG = (1<<3),
00132 } lqt_log_level_t;
00133
00142 typedef void (*lqt_log_callback_t)(lqt_log_level_t level,
00143 const char * domain,
00144 const char * message,
00145 void * data);
00146
00147
00154 typedef enum
00155 {
00156 LQT_FILE_NONE = 0,
00157 LQT_FILE_QT_OLD = (1<<0),
00158 LQT_FILE_QT = (1<<1),
00159 LQT_FILE_AVI = (1<<2),
00160 LQT_FILE_AVI_ODML = (1<<3),
00161 LQT_FILE_MP4 = (1<<4),
00162 LQT_FILE_M4A = (1<<5),
00163 LQT_FILE_3GP = (1<<6),
00164 } lqt_file_type_t;
00165
00166
00177 typedef enum
00178 {
00179 LQT_CHANNEL_UNKNOWN,
00180 LQT_CHANNEL_FRONT_LEFT,
00181 LQT_CHANNEL_FRONT_RIGHT,
00182 LQT_CHANNEL_FRONT_CENTER,
00183 LQT_CHANNEL_FRONT_CENTER_LEFT,
00184 LQT_CHANNEL_FRONT_CENTER_RIGHT,
00185 LQT_CHANNEL_BACK_CENTER,
00186 LQT_CHANNEL_BACK_LEFT,
00187 LQT_CHANNEL_BACK_RIGHT,
00188 LQT_CHANNEL_SIDE_LEFT,
00189 LQT_CHANNEL_SIDE_RIGHT,
00190 LQT_CHANNEL_LFE,
00191 } lqt_channel_t;
00192
00193
00257 typedef enum
00258 {
00259 LQT_INTERLACE_NONE = 0,
00260 LQT_INTERLACE_TOP_FIRST,
00261 LQT_INTERLACE_BOTTOM_FIRST
00262 } lqt_interlace_mode_t;
00263
00273 typedef enum
00274 {
00275 LQT_CHROMA_PLACEMENT_DEFAULT = 0,
00276 LQT_CHROMA_PLACEMENT_MPEG2,
00277 LQT_CHROMA_PLACEMENT_DVPAL,
00278 } lqt_chroma_placement_t;
00279
00289 typedef enum
00290 {
00291 LQT_SAMPLE_UNDEFINED = 0,
00292 LQT_SAMPLE_INT8,
00293 LQT_SAMPLE_UINT8,
00294 LQT_SAMPLE_INT16,
00295 LQT_SAMPLE_INT32,
00296 LQT_SAMPLE_FLOAT,
00297 LQT_SAMPLE_DOUBLE,
00298 } lqt_sample_format_t;
00299
00308 typedef struct quicktime_s quicktime_t;
00309
00310
00311
00312
00313
00333 #define QUICKTIME_DIVX "DIVX"
00334
00341 #define QUICKTIME_DIV3 "DIV3"
00342
00349 #define QUICKTIME_DV "dvc "
00350
00351
00358 #define QUICKTIME_DV_AVID "AVdv"
00359
00366 #define QUICKTIME_DV_AVID_A "dvcp"
00367
00375
00376 #define QUICKTIME_RAW "raw "
00377
00384
00385 #define QUICKTIME_JPEG "jpeg"
00386
00387
00388
00396 #define QUICKTIME_PNG "png "
00397
00405 #define QUICKTIME_MJPA "mjpa"
00406
00413 #define QUICKTIME_YUV2 "yuv2"
00414
00421 #define QUICKTIME_YUV4 "yuv4"
00422
00430 #define QUICKTIME_YUV420 "yv12"
00431
00438 #define QUICKTIME_2VUY "2vuy"
00439
00446 #define QUICKTIME_YUVS "yuvs"
00447
00448
00455 #define QUICKTIME_V308 "v308"
00456
00463 #define QUICKTIME_V408 "v408"
00464
00471 #define QUICKTIME_V210 "v210"
00472
00479 #define QUICKTIME_V410 "v410"
00480
00481
00482
00502 #define QUICKTIME_RAWAUDIO "raw "
00503
00510 #define QUICKTIME_IMA4 "ima4"
00511
00518 #define QUICKTIME_TWOS "twos"
00519
00526 #define QUICKTIME_ULAW "ulaw"
00527
00536 #define QUICKTIME_VORBIS "OggS"
00537
00545 #define QUICKTIME_MP3 ".mp3"
00546
00547
00548
00557
00558 int quicktime_major();
00559
00567 int quicktime_minor();
00568
00577 int quicktime_release();
00578
00590 int quicktime_check_sig(char *path);
00591
00602 quicktime_t* quicktime_open(const char *filename, int rd, int wr);
00603
00616 int quicktime_make_streamable(char *in_path, char *out_path);
00617
00631 void quicktime_set_copyright(quicktime_t *file, char *string);
00632
00639 void quicktime_set_name(quicktime_t *file, char *string);
00640
00647 void quicktime_set_info(quicktime_t *file, char *string);
00648
00656 char* quicktime_get_copyright(quicktime_t *file);
00657
00665 char* quicktime_get_name(quicktime_t *file);
00666
00673 char* quicktime_get_info(quicktime_t *file);
00674
00675
00691 int quicktime_set_audio(quicktime_t *file,
00692 int channels,
00693 long sample_rate,
00694 int bits,
00695 char *compressor);
00696
00707 void quicktime_set_framerate(quicktime_t *file, double framerate);
00708
00724 int quicktime_set_video(quicktime_t *file,
00725 int tracks,
00726 int frame_w,
00727 int frame_h,
00728 double frame_rate,
00729 char *compressor);
00730
00744 void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);
00745
00760 void quicktime_set_parameter(quicktime_t *file, char *key, void *value);
00761
00772 void quicktime_set_depth(quicktime_t *file,
00773 int depth,
00774 int track);
00775
00785 void quicktime_set_cmodel(quicktime_t *file, int colormodel);
00786
00797 void quicktime_set_row_span(quicktime_t *file, int row_span);
00798
00804 int quicktime_close(quicktime_t *file);
00805
00806
00807
00808
00817 long quicktime_audio_length(quicktime_t *file, int track);
00818
00830 long quicktime_video_length(quicktime_t *file, int track);
00831
00839
00840 long quicktime_audio_position(quicktime_t *file, int track);
00841
00851 long quicktime_video_position(quicktime_t *file, int track);
00852
00859
00860 int quicktime_video_tracks(quicktime_t *file);
00861
00868 int quicktime_audio_tracks(quicktime_t *file);
00869
00876 int quicktime_has_audio(quicktime_t *file);
00877
00885 long quicktime_sample_rate(quicktime_t *file, int track);
00886
00901 int quicktime_audio_bits(quicktime_t *file, int track);
00902
00910 int quicktime_track_channels(quicktime_t *file, int track);
00911
00924 char* quicktime_audio_compressor(quicktime_t *file, int track);
00925
00932 int quicktime_has_video(quicktime_t *file);
00933
00941 int quicktime_video_width(quicktime_t *file, int track);
00942
00950 int quicktime_video_height(quicktime_t *file, int track);
00951
00966 int quicktime_video_depth(quicktime_t *file, int track);
00967
00982 double quicktime_frame_rate(quicktime_t *file, int track);
00983
00994 char* quicktime_video_compressor(quicktime_t *file, int track);
00995
00996
00997
01009 long quicktime_frame_size(quicktime_t *file, long frame, int track);
01010
01020 int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);
01021
01022
01023
01024
01025
01026
01035 int quicktime_seek_start(quicktime_t *file);
01036
01037
01038
01047 int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track);
01048
01059 int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track);
01060
01061
01062
01063
01064 int quicktime_write_audio(quicktime_t *file, uint8_t *audio_buffer, long samples, int track);
01065
01081 int quicktime_write_frame(quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track);
01082
01098 long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);
01099
01100
01101
01102 int quicktime_read_frame_init(quicktime_t *file, int track);
01103 int quicktime_read_frame_end(quicktime_t *file, int track);
01104
01105
01106 long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track);
01107 long quicktime_get_partial_keyframe_before(quicktime_t *file, long frame, int track);
01108 void quicktime_insert_keyframe(quicktime_t *file, long frame, int track);
01109 void quicktime_insert_partial_keyframe(quicktime_t *file, long frame, int track);
01110
01111 int quicktime_has_keyframes(quicktime_t *file, int track);
01112
01113
01114 void quicktime_insert_sdtp_entry(quicktime_t *file, long frame, int track, uint8_t flags);
01115
01116
01117
01118
01119
01127 int quicktime_supported_video(quicktime_t *file, int track);
01128
01136 int quicktime_supported_audio(quicktime_t *file, int track);
01137
01149 int quicktime_reads_cmodel(quicktime_t *file,
01150 int colormodel,
01151 int track);
01152
01164 int quicktime_writes_cmodel(quicktime_t *file,
01165 int colormodel,
01166 int track);
01167
01168
01169
01170 int quicktime_divx_is_key(unsigned char *data, long size);
01171 int quicktime_divx_write_vol(unsigned char *data_start,
01172 int vol_width,
01173 int vol_height,
01174 int time_increment_resolution,
01175 double frame_rate);
01176 int quicktime_divx_has_vol(unsigned char *data);
01177
01178 int quicktime_div3_is_key(unsigned char *data, long size);
01179
01190 int quicktime_encode_video(quicktime_t *file,
01191 unsigned char **row_pointers,
01192 int track);
01193
01204 int quicktime_decode_video(quicktime_t *file,
01205 unsigned char **row_pointers,
01206 int track);
01207
01228 long quicktime_decode_scaled(quicktime_t *file,
01229 int in_x,
01230 int in_y,
01231 int in_w,
01232 int in_h,
01233 int out_w,
01234 int out_h,
01235 int color_model,
01236 unsigned char **row_pointers,
01237 int track);
01238
01239
01240
01241
01242
01260 int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);
01261
01274 int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);
01275
01283 int quicktime_dump(quicktime_t *file);
01284
01285
01286
01297 int quicktime_set_cpus(quicktime_t *file, int cpus);
01298
01299
01300
01301
01302
01303 void quicktime_set_preload(quicktime_t *file, int64_t preload);
01304
01305 int64_t quicktime_byte_position(quicktime_t *file);
01306
01315 void quicktime_set_avi(quicktime_t *file, int value);
01316
01317 #ifdef __GNUC__
01318 #pragma GCC visibility pop
01319 #endif
01320
01321
01322 #ifdef __cplusplus
01323 }
01324 #endif
01325
01326 #endif