Main Page   Modules   Data Structures   File List   Data Fields   Globals  

/dar/build/libquicktime-1.1.0/include/quicktime/lqt.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  lqt.h
00003 
00004  libquicktime - A library for reading and writing quicktime/avi/mp4 files.
00005  http://libquicktime.sourceforge.net
00006 
00007  Copyright (C) 2002 Heroine Virtual Ltd.
00008  Copyright (C) 2002-2007 Members of the libquicktime project.
00009 
00010  This library is free software; you can redistribute it and/or modify it under
00011  the terms of the GNU Lesser General Public License as published by the Free
00012  Software Foundation; either version 2.1 of the License, or (at your option)
00013  any later version.
00014 
00015  This library is distributed in the hope that it will be useful, but WITHOUT
00016  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
00018  details.
00019 
00020  You should have received a copy of the GNU Lesser General Public License along
00021  with this library; if not, write to the Free Software Foundation, Inc., 51
00022  Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00023 *******************************************************************************/
00024 
00025 #ifndef _LQT_H_
00026 #define _LQT_H_
00027 
00028 #include "quicktime.h"
00029 #include "lqt_atoms.h"
00030 #include "lqt_codecinfo.h"
00031 #include "lqt_qtvr.h"
00032 
00033 #pragma GCC visibility push(default)
00034 
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif /* __cplusplus */
00039 
00045 void *lqt_bufalloc(size_t size);
00046 
00047 
00048   
00055 void lqt_set_log_callback(lqt_log_callback_t cb, void * data);
00056                            
00057   
00069 int lqt_fileno(quicktime_t *file);
00070 
00082 void lqt_set_audio_parameter(quicktime_t *file,int track, const char *key,const void *value);
00083 
00095 void lqt_set_video_parameter(quicktime_t *file,int track, const char *key,const void *value);
00096 
00107 int lqt_get_pixel_aspect(quicktime_t *file, int track, int * pixel_width,
00108                          int * pixel_height);
00109 
00120 int lqt_set_pixel_aspect(quicktime_t *file, int track, int pixel_width,
00121                          int pixel_height);
00122 
00135 lqt_interlace_mode_t lqt_get_interlace_mode(quicktime_t * file, int track);
00136 
00149 int lqt_set_interlace_mode(quicktime_t * file, int track,
00150                            lqt_interlace_mode_t mode);
00151 
00152   
00158 const char * lqt_interlace_mode_to_string(lqt_interlace_mode_t mode);
00159 
00170 lqt_chroma_placement_t lqt_get_chroma_placement(quicktime_t * file, int track);
00171 
00178 const char * lqt_chroma_placement_to_string(lqt_chroma_placement_t chroma_placement);
00179 
00190 int lqt_get_codec_api_version();
00191 
00198 const char * lqt_channel_to_string(lqt_channel_t ch);
00199 
00211 void lqt_set_channel_setup(quicktime_t * file, int track, lqt_channel_t * ch);
00212 
00223 const lqt_channel_t * lqt_get_channel_setup(quicktime_t * file, int track);
00224 
00225 
00258 int lqt_add_text_track(quicktime_t * file, int timescale);
00259 
00269 void lqt_set_text_language(quicktime_t * file, int track, const char * language);
00270 
00281 void lqt_set_chapter_track(quicktime_t * file, int track);
00282 
00292 void lqt_set_text_box(quicktime_t * file, int track,
00293                       uint16_t top, uint16_t left,
00294                       uint16_t bottom, uint16_t right);
00295 
00308 void lqt_set_text_fg_color(quicktime_t * file, int track,
00309                            uint16_t r, uint16_t g,
00310                            uint16_t b, uint16_t a);
00311 
00325 void lqt_set_text_bg_color(quicktime_t * file, int track,
00326                            uint16_t r, uint16_t g,
00327                            uint16_t b, uint16_t a);
00328 
00329   
00330   
00331   
00340 int lqt_write_text(quicktime_t * file, int track, const char * text, int64_t duration);
00341   
00359 int lqt_text_tracks(quicktime_t * file);
00360 
00371 int lqt_get_text_language(quicktime_t * file, int track, char * language);
00372 
00379 int lqt_text_time_scale(quicktime_t * file, int track);
00380 
00390 void lqt_get_text_box(quicktime_t * file, int track,
00391                       uint16_t * top, uint16_t * left,
00392                       uint16_t * bottom, uint16_t * right);
00393 
00394   
00409 int lqt_read_text(quicktime_t * file, int track, char ** text, int * text_alloc,
00410                   int64_t * timestamp, int64_t * duration);
00411 
00419 int lqt_is_chapter_track(quicktime_t * file, int track);
00420 
00427 int64_t lqt_text_samples(quicktime_t * file, int track);
00428 
00435 void lqt_set_text_position(quicktime_t * file, int track, int64_t position);
00436 
00447 void lqt_set_text_time(quicktime_t * file, int track, int64_t time);
00448 
00460 void lqt_get_text_fg_color(quicktime_t * file, int track,
00461                            uint16_t * r, uint16_t * g,
00462                            uint16_t * b, uint16_t * a);
00463 
00475 void lqt_get_text_bg_color(quicktime_t * file, int track,
00476                            uint16_t * r, uint16_t * g,
00477                            uint16_t * b, uint16_t * a);
00478 
00494 #define LQT_TIMECODE_DROP    0x0001 
00495 #define LQT_TIMECODE_24HMAX  0x0002 
00496 #define LQT_TIMECODE_NEG_OK  0x0004 
00497 #define LQT_TIMECODE_COUNTER 0x0008 
00498 
00499 
00510 void lqt_add_timecode_track(quicktime_t * file, int track,
00511                             uint32_t flags, int framerate);
00512 
00520 void lqt_write_timecode(quicktime_t * file, int track,
00521                         uint32_t timecode);
00522 
00531 int lqt_has_timecode_track(quicktime_t * file, int track,
00532                            uint32_t * flags, int * framerate);
00533 
00546 int lqt_read_timecode(quicktime_t * file, int track,
00547                       uint32_t * timecode);
00548 
00558 const char * lqt_get_timecode_tape_name(quicktime_t * file, int track);
00559 
00568 void lqt_set_timecode_tape_name(quicktime_t * file, int track,
00569                                 const char * tapename);
00570 
00577 int lqt_get_timecode_track_enabled(quicktime_t * file, int track);
00578 
00585 void lqt_set_timecode_track_enabled(quicktime_t * file, int track,
00586                                     int enabled);
00587 
00594 /***********************************************
00595  * Advanced colormodel handling.
00596  * (defined in lqt_color.c)
00597  ***********************************************/
00598 
00604 #define LQT_COLORMODEL_NONE -1
00605   
00606 /* Colormodel <-> string conversion (used by registry file routines) */
00607 
00614 const char * lqt_colormodel_to_string(int colormodel);
00615 
00622 int lqt_string_to_colormodel(const char * str);
00623 
00624 /* Query information about the colormodel */
00625 
00632 int lqt_colormodel_is_planar(int colormodel);
00633 
00640 int lqt_colormodel_has_alpha(int colormodel);
00641 
00648 int lqt_colormodel_is_rgb(int colormodel);
00649 
00656 int lqt_colormodel_is_yuv(int colormodel);
00657 
00666 void lqt_colormodel_get_chroma_sub(int colormodel, int * sub_h, int * sub_v);
00667 
00681 void lqt_get_default_rowspan(int colormodel, int width, int * rowspan, int * rowspan_uv);
00682 
00695 int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel);
00696   
00697 /* Query supported colormodels */
00698 
00704 int lqt_num_colormodels();
00705 
00711 const char * lqt_get_colormodel_string(int index);
00712 
00719 int lqt_get_colormodel(int index);
00720 
00731 int lqt_get_decoder_colormodel(quicktime_t * file, int track);
00732 
00749 int lqt_get_best_colormodel(quicktime_t * file, int track, int * supported);
00750 
00761 int lqt_get_cmodel(quicktime_t * file, int track);
00762   
00778 uint8_t ** lqt_rows_alloc(int width, int height, int colormodel, int * rowspan, int * rowspan_uv);
00779 
00793 void lqt_rows_copy(uint8_t **out_rows, uint8_t **in_rows, int width, int height, int in_rowspan, int in_rowspan_uv,
00794                    int out_rowspan, int out_rowspan_uv, int colormodel);
00795   
00796 
00802 void lqt_rows_free(uint8_t ** rows);
00803   
00804 
00805 /**************************************
00806  * Set streams for encoding
00807  **************************************/
00808 
00822 int lqt_set_audio(quicktime_t *file, int channels,
00823                   long sample_rate,  int bits,
00824                   lqt_codec_info_t * codec_info);
00825 
00826   
00844 int lqt_set_video(quicktime_t *file, int tracks, 
00845                   int frame_w, int frame_h,
00846                   int frame_duration, int timescale,
00847                   lqt_codec_info_t * codec_info);
00848 
00849  
00863 int lqt_add_audio_track(quicktime_t *file,
00864                         int channels, long sample_rate, int bits,
00865                         lqt_codec_info_t * codec_info);
00866 
00877 void lqt_set_audio_language(quicktime_t * file, int track, const char * language);
00878   
00894 int lqt_add_video_track(quicktime_t *file,
00895                         int frame_w, int frame_h,
00896                         int frame_duration, int timescale,
00897                         lqt_codec_info_t * codec_info);
00898 
00916 int lqt_set_video_pass(quicktime_t *file,
00917                        int pass, int total_passes, 
00918                        const char * stats_file, int track);
00919 
00930 int64_t lqt_frame_time(quicktime_t * file, int track);
00931 
00944 int lqt_decode_video(quicktime_t *file,
00945                      unsigned char **row_pointers, int track);
00946 
00964 int lqt_read_video_frame(quicktime_t * file,
00965                          uint8_t ** buffer, int * buffer_alloc,
00966                          int64_t frame, int64_t * time, int track);
00967   
00983 int lqt_encode_video(quicktime_t *file, 
00984                      unsigned char **row_pointers, 
00985                      int track, int64_t time);
00986   
00995 int lqt_frame_duration(quicktime_t * file, int track, int *constant);
00996   
01004 int lqt_video_time_scale(quicktime_t * file, int track);
01005 
01015 int64_t lqt_video_duration(quicktime_t * file, int track);
01016 
01031 void lqt_set_cmodel(quicktime_t *file, int track, int colormodel);
01032 
01043 void lqt_set_row_span(quicktime_t *file, int track, int row_span);
01044 
01055 void lqt_set_row_span_uv(quicktime_t *file, int track, int row_span_uv);
01056   
01081 int lqt_decode_audio(quicktime_t *file, 
01082                      int16_t **output_i, 
01083                      float **output_f, 
01084                      long samples);
01085   
01098 int64_t lqt_last_audio_position(quicktime_t * file, int track);
01099   
01113 int lqt_encode_audio_track(quicktime_t *file, 
01114                            int16_t **output_i, 
01115                            float **output_f, 
01116                            long samples,
01117                            int track);
01118   
01136 int lqt_decode_audio_track(quicktime_t *file, 
01137                            int16_t **output_i, 
01138                            float **output_f, 
01139                            long samples,
01140                            int track);
01141 
01142 /*
01143  *  Support for "raw" audio en-/decoding: This bypasses all
01144  *  internal sampleformat conversions, and allows access to audio
01145  *  samples in a format, which is closest to the internal representation.
01146  */
01147   
01148 /*
01149  *  Query the internal sample format. Works for decoding (call after quicktime_open)
01150  *  and encoding (call after lqt_add_audio_track, lqt_set_audio or quicktime_set_audio).
01151  */
01152 
01159 const char * lqt_sample_format_to_string(lqt_sample_format_t sampleformat);
01160 
01176 lqt_sample_format_t lqt_get_sample_format(quicktime_t * file, int track);
01177 
01178 /* The following return the actual number of en-/decoded frames */
01179 
01196 int lqt_decode_audio_raw(quicktime_t *file, 
01197                          void * output, 
01198                          long samples,
01199                          int track);
01200 
01212 int lqt_get_audio_language(quicktime_t * file, int track, char * language);
01213 
01214   
01228 int lqt_encode_audio_raw(quicktime_t *file, 
01229                          void * input, 
01230                          long samples,
01231                          int track);
01232 
01244 void lqt_seek_video(quicktime_t * file, int track,
01245                     int64_t time);
01246   
01247 /*
01248  *  AVI Specific stuff
01249  */
01250 
01257 int lqt_is_avi(quicktime_t *file);
01258 
01269 int lqt_get_wav_id(quicktime_t *file, int track);
01270   
01281 int lqt_total_channels(quicktime_t *file);
01282 
01283 /* Extended metadata support */
01284 
01291 void lqt_set_album(quicktime_t *file, char *string);
01292 
01299 void lqt_set_artist(quicktime_t *file, char *string);
01300 
01307 void lqt_set_genre(quicktime_t *file, char *string);
01308 
01316 void lqt_set_track(quicktime_t *file, char *string);
01317 
01324 void lqt_set_comment(quicktime_t *file, char *string);
01325 
01332 void lqt_set_author(quicktime_t *file, char *string);
01333 
01340 void lqt_set_creation_time(quicktime_t *file, unsigned long time);
01341 
01342   
01349 char * lqt_get_album(quicktime_t * file);
01350   
01356 char * lqt_get_artist(quicktime_t * file);
01357 
01364 char * lqt_get_genre(quicktime_t * file);
01365 
01371 char * lqt_get_track(quicktime_t * file);
01372 
01379 char * lqt_get_comment(quicktime_t *file);
01380 
01386 char * lqt_get_author(quicktime_t *file);
01387 
01393 unsigned long lqt_get_creation_time(quicktime_t * file);
01394   
01395 /* get track number from track id */
01396 int lqt_track_from_id(quicktime_t *file, int track_id);
01397 
01404 const char * lqt_file_type_to_string(lqt_file_type_t type);
01405 
01412 lqt_file_type_t lqt_get_file_type(quicktime_t * file);
01413  
01414   
01422 quicktime_t * lqt_open_read(const char * filename);
01423 
01433   quicktime_t * lqt_open_read_with_log(const char * filename, lqt_log_callback_t cb, void * log_data);
01434   
01443 quicktime_t * lqt_open_write(const char * filename, lqt_file_type_t type);
01444 
01455 quicktime_t * lqt_open_write_with_log(const char * filename, lqt_file_type_t type,
01456                                       lqt_log_callback_t cb, void * log_data);
01457   
01469 void lqt_set_max_riff_size(quicktime_t * file, int size);
01470 
01471   
01472   
01473   
01474 #ifdef __cplusplus
01475 }
01476 #endif /* __cplusplus */
01477 
01478 #pragma GCC visibility pop
01479   
01480 #endif

Generated at Mon Nov 10 00:28:16 2008 for libquicktime by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001