Main Page | Modules | Data Structures | File List | Data Fields | Globals

/dar/build/libquicktime-1.0.3/include/quicktime/lqt_codecinfo.h

00001 /*******************************************************************************
00002  lqt_codecinfo.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 /*
00026  *   Codec info structure for libquicktime
00027  *   (first approximation)
00028  */
00029 
00030 /* Type of a codec parameter */
00031 
00032 #ifndef _LQT_CODEC_INFO_H_
00033 #define _LQT_CODEC_INFO_H_
00034 
00035 #include <inttypes.h>
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif /* __cplusplus */
00040 
00074 typedef enum
00075   {
00076     LQT_PARAMETER_INT,     
00077     LQT_PARAMETER_FLOAT,   
00078     LQT_PARAMETER_STRING,  
00079     LQT_PARAMETER_STRINGLIST, 
00080     /* This dummy type is used to separate sections (real_name will be on tab-label) */
00081     LQT_PARAMETER_SECTION, 
00082   } lqt_parameter_type_t;
00083 
00090 typedef union
00091   {
00092   int val_int; 
00093   char * val_string; 
00094   float val_float; 
00095   } lqt_parameter_value_t;
00096 
00104 typedef struct
00105   {
00106   char * name;   
00108   char * real_name; 
00110   lqt_parameter_type_t type; 
00112   lqt_parameter_value_t val_default; 
00114   /*
00115    *   Minimum and maximum values:
00116    *   These are only valid for numeric types and if val_min < val_max
00117    */
00118   
00119   lqt_parameter_value_t val_min; 
00120   lqt_parameter_value_t val_max; 
00122   int num_digits; 
00124   /*
00125    *  Possible options (only valid for LQT_STRINGLIST)
00126    */
00127   
00128   int num_stringlist_options; 
00129   char ** stringlist_options; 
00130   char ** stringlist_labels;  
00132   char * help_string; 
00134   } lqt_parameter_info_t;
00135 
00140 typedef enum
00141   {
00142     LQT_CODEC_AUDIO,
00143     LQT_CODEC_VIDEO
00144   } lqt_codec_type;
00145 
00150 typedef enum
00151   {
00152     LQT_DIRECTION_ENCODE,
00153     LQT_DIRECTION_DECODE,
00154     LQT_DIRECTION_BOTH
00155   } lqt_codec_direction;
00156 
00161 typedef struct lqt_codec_info_s
00162   {
00163   int compatibility_flags; 
00165   /* These are set by the plugins */
00166   
00167   char * name;               
00168   char * long_name;          
00169   char * description;        
00171   lqt_codec_type type;           
00172   lqt_codec_direction direction; 
00174   int num_fourccs;      
00175   char ** fourccs;      
00177   int num_wav_ids; 
00178   int * wav_ids;   
00181   int num_encoding_parameters; 
00182   lqt_parameter_info_t * encoding_parameters; 
00184   int num_decoding_parameters; 
00185   lqt_parameter_info_t * decoding_parameters; 
00187   /* The following members are set by libquicktime      */
00188   
00189   char * module_filename;    
00190   int module_index;          
00192   uint32_t file_time;        
00194   char * gettext_domain;     
00195   char * gettext_directory;  
00197   struct lqt_codec_info_s * next;   
00198   } lqt_codec_info_t;
00199 
00200 
00201 /* Global Entry points */
00202 
00210 void lqt_registry_init();
00211 
00220 void lqt_registry_destroy();
00221 
00222 /* \ingroup codec_registry
00223  *
00224  * Save the registry file $HOME/.libquicktime_codecs.
00225  * Under normal circumstances, you never need to call this function
00226  */
00227 
00228 void lqt_registry_write();
00229 
00230 
00231 /******************************************************
00232  *  Non thread save functions for querying the
00233  *  codec registry. Suitable for single threaded
00234  *  applications (might become obsolete)
00235  ******************************************************/
00236 
00244 int lqt_get_num_audio_codecs();
00245 
00253 int lqt_get_num_video_codecs();
00254 
00263 const lqt_codec_info_t * lqt_get_audio_codec_info(int index);
00264 
00273 const lqt_codec_info_t * lqt_get_video_codec_info(int index);
00274 
00275 /********************************************************************
00276  *  Thread save function for getting codec parameters
00277  *  All these functions return a NULL terminated array of local
00278  *  copies of the codec data which must be freed using 
00279  *  lqt_destroy_codec_info(lqt_codec_info_t ** info) declared below
00280  ********************************************************************/
00281 
00294 lqt_codec_info_t ** lqt_query_registry(int audio, int video,
00295                                        int encode, int decode);
00296 
00307 lqt_codec_info_t ** lqt_find_audio_codec(char * fourcc, int encode);
00308 
00319 lqt_codec_info_t ** lqt_find_audio_codec_by_wav_id(int wav_id, int encode);
00320   
00331 lqt_codec_info_t ** lqt_find_video_codec(char * fourcc, int encode);
00332 
00333 
00334 
00335   
00336 
00337   
00347 lqt_codec_info_t ** lqt_find_audio_codec_by_name(const char * name);
00348 
00358 lqt_codec_info_t ** lqt_find_video_codec_by_name(const char * name);
00359 
00370 lqt_codec_info_t ** lqt_audio_codec_from_file(quicktime_t * file, int track);
00371 
00382 lqt_codec_info_t ** lqt_video_codec_from_file(quicktime_t * file, int track);
00383   
00392 void lqt_destroy_codec_info(lqt_codec_info_t ** info);
00393 
00405 void lqt_reorder_audio_codecs(lqt_codec_info_t ** codec_info);
00406 
00418 void lqt_reorder_video_codecs(lqt_codec_info_t ** codec_info);
00419 
00433 void lqt_set_default_parameter(lqt_codec_type type, int encode,
00434                                const char * codec_name,
00435                                const char * parameter_name,
00436                                lqt_parameter_value_t * val);
00437 
00448 void lqt_restore_default_parameters(lqt_codec_info_t * codec_info,
00449                                     int encode, int decode);
00450     
00451                                       
00460 void lqt_dump_codec_info(const lqt_codec_info_t * info);
00461 
00462 #ifdef __cplusplus
00463 }
00464 #endif /* __cplusplus */
00465 
00466 
00467 #endif /* _LQT_CODEC_INFO_H_ */

Generated on Mon Jul 14 22:58:35 2008 for libquicktime by doxygen 1.3.5