api_usage.html
来自「这个库实现了录象功能」· HTML 代码 · 共 724 行 · 第 1/3 页
HTML
724 行
<span style="font-family: monospace;">int lqt_colormodel_has_alpha(intcolormodel);</span><br style="font-family: monospace;"><span style="font-family: monospace;">int lqt_colormodel_is_rgb(intcolormodel);</span><br style="font-family: monospace;"><span style="font-family: monospace;">int lqt_colormodel_is_yuv(intcolormodel);</span><br style="font-family: monospace;"><span style="font-family: monospace;"><br>int lqt_num_colormodels();</span><br style="font-family: monospace;"><span style="font-family: monospace;">const char *lqt_get_colormodel_string(int index);</span><br style="font-family: monospace;"><span style="font-family: monospace;">int lqt_get_colormodel(int index);</span><br style="font-family: monospace;"><br>The best idea is to decide, which colormodels you want to support inyour application. <span style="font-family: monospace;">BC_RGB888</span>and <span style="font-family: monospace;">BC_YUV420P</span> shouldalways be supported. Please note, that libquicktimes internalcolorspace converter is not the fastest out there. The more colorspacesyou can handle yourself, the fewer time consuming internal conversionswill be used. A nice library, which converts manylibquicktime colormodels, is <a href="http://gmerlin.soutceforge.net/gavl.html">gavl</a>. Then callfor each video track:<br><br><span style="font-family: monospace;">intlqt_get_best_colormodel(quicktime_t * file, int track, int * supported);</span><br><br><span style="font-family: monospace;">supported</span> is an array ofthe colorspaces, you can handle terminated with <span style="font-family: monospace;">LQT_COLORMODEL_NONE</span>. Thefunction works for both en- and decoding and tries to minimizeconversion overhead and information loss.<br><h3><a name="6._Codec_registry_interface"></a>6. Codec registryinterface</h3>This allows you to access the codecs, which are installed on the systemalong with information about them. To query the registry about theinstalled codecs, use:<br><br><span style="font-family: monospace;">lqt_codec_info_t **lqt_query_registry(int audio, int video,</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int encode, int decode);</span><br style="font-family: monospace;"><br>The return value is a NULL terminated array of <span style="font-family: monospace;">lqt_codec_info_t</span> pointers. Thecodec info is defined in lqt_codecinfo.h:<br><br><span style="font-family: monospace;">typedef struct lqt_codec_info_slqt_codec_info_t;<br><br style="font-family: monospace;"></span><span style="font-family: monospace;">struct lqt_codec_info_s</span><br style="font-family: monospace;"><span style="font-family: monospace;"> {</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int compatibility_flags;/* Compatibility flags (See defines above) */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> </span><span style="font-family: monospace;">char *name; /* Name of thecodec */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char *long_name; /*Long name of the codec */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char *description; /*Description */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> </span><span style="font-family: monospace;"> lqt_codec_type type;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> lqt_codec_directiondirection;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> intnum_fourccs; /* Fourccs, this codec can handle */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char ** fourccs;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int num_wav_ids;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int * wav_ids;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int num_encoding_parameters;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> lqt_parameter_info_t *encoding_parameters;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int num_decoding_parameters;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> lqt_parameter_info_t *decoding_parameters;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> /* Colormodels this codec canhandle */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int num_encoding_colormodels;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int * encoding_colormodels;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int decoding_colormodel;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> /* The following members areset by libquicktime */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> char *module_filename; /* Filename of the module */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> intmodule_index; /*Index inside the module */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> uint32_tfile_time; /* Filemodification time */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> struct lqt_codec_info_s *next; /* For chaining */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> };</span><br style="font-family: monospace;"><br style="font-family: monospace;">Most interesting are the name, long name and description. The <span style="font-family: monospace;">encoding_parameters</span> and <span style="font-family: monospace;">decoding_parameters</span> arrayscontain informations about the parameters you can pass tolqt_set_[audio|video]_parameter. The parameter infos are defined likethis:<br><br><span style="font-family: monospace;">typedef enum</span><br style="font-family: monospace;"><span style="font-family: monospace;"> {</span><br style="font-family: monospace;"><span style="font-family: monospace;"> LQT_PARAMETER_INT,</span><br style="font-family: monospace;"><span style="font-family: monospace;"> LQT_PARAMETER_STRING,</span><br style="font-family: monospace;"><span style="font-family: monospace;"> LQT_PARAMETER_STRINGLIST, /* String with options */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> /* This dummytype is used to separate sections (real_name will be on tab-label) */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> LQT_PARAMETER_SECTION</span><br style="font-family: monospace;"><span style="font-family: monospace;"> } lqt_parameter_type_t;</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">typedef union</span><br style="font-family: monospace;"><span style="font-family: monospace;"> {</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int val_int;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char * val_string;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> } lqt_parameter_value_t;</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">typedef struct</span><br style="font-family: monospace;"><span style="font-family: monospace;"> {</span><br style="font-family: monospace;"><span style="font-family: monospace;"> /* Parameter name (to bepassed to quicktime_set_parameter() ) */</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char * name;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char * real_name; /* Othername (for making dialogs) */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> lqt_parameter_type_t type;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> lqt_parameter_value_tval_default;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> /*</span><br style="font-family: monospace;"><span style="font-family: monospace;"> * Minimum and maximum values:</span><br style="font-family: monospace;"><span style="font-family: monospace;"> * Theseare only valid for numeric types and if val_min < val_max</span><br style="font-family: monospace;"><span style="font-family: monospace;"> */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int val_min;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> int val_max;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> /*</span><br style="font-family: monospace;"><span style="font-family: monospace;"> * Possibleoptions (only valid for LQT_STRINGLIST)</span><br style="font-family: monospace;"><span style="font-family: monospace;"> */</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> int num_stringlist_options;</span><br style="font-family: monospace;"><span style="font-family: monospace;"> char ** stringlist_options;</span><br style="font-family: monospace;"><span style="font-family: monospace;"></span><span style="font-family: monospace;"> } lqt_parameter_info_t;</span><br style="font-family: monospace;"><br>You can also get the codec infos, when you read a file:<br><br><span style="font-family: monospace;">lqt_codec_info_t **lqt_audio_codec_from_file(quicktime_t *, int track);</span><br style="font-family: monospace;"><span style="font-family: monospace;">lqt_codec_info_t **lqt_video_codec_from_file(quicktime_t *, int track);</span><br><br>Codec infos are returned as a local copy, so you must free them. Thisis done with:<br><br><span style="font-family: monospace;">voidlqt_destroy_codec_info(lqt_codec_info_t ** info);</span><br><br></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?