📄 lqt.h
字号:
int16_t **output_i, float **output_f, long samples, int track); /** \ingroup audio_decode * \brief Decode a number of audio samples * \param file A quicktime handle * \param output_i 16 bit integer output buffer (or NULL) * \param output_f floating point output buffer (or NULL) * \param samples Number of samples to decode * \param track index (starting with 0) * * Decode a number of samples from an audio track. All channels are decoded at once. * output_i and output_f point to noninterleaved arrays for each channel. Depending * on what you need, set either output_i or output_f to NULL. If you want the full resolution * also for 24/32 bits, use \ref lqt_decode_audio_raw . * * The number of actually decoded samples (and EOF) can be obtained with * \ref lqt_last_audio_position */ int lqt_decode_audio_track(quicktime_t *file, int16_t **output_i, float **output_f, long samples, int track);/* * Support for "raw" audio en-/decoding: This bypasses all * internal sampleformat conversions, and allows access to audio * samples in a format, which is closest to the internal representation. */ /* * Query the internal sample format. Works for decoding (call after quicktime_open) * and encoding (call after lqt_add_audio_track, lqt_set_audio or quicktime_set_audio). *//** \ingroup audio * \brief Get a human readable description for a sample format * \param sampleformat A sampleformat * \returns The description or NULL */ const char * lqt_sample_format_to_string(lqt_sample_format_t sampleformat);/** \ingroup audio * \brief Return the sample format used natively by the codec. * \param file A quicktime handle * \param track Track index (starting with 0) * \returns The sampleformat * * Use this function if you want to use \ref lqt_decode_audio_raw or * \ref lqt_encode_audio_raw * to bypass libquicktimes internal sample format conversion routines. * * *Note* * Some codecs call * */ lqt_sample_format_t lqt_get_sample_format(quicktime_t * file, int track);/* The following return the actual number of en-/decoded frames *//** \ingroup audio_decode * \brief Decode audio in the native sampleformat of the codec * \param file A quicktime handle * \param output An array of interleaved samples * \param samples Number of samples to decode * \param track Track index (starting with 0) * \returns The number of actually decoded samples. 0 means end of track. * * This function bypasses all internal sampleformat conversion and allows * full resolution output for up to 32 bit integer and 32 bit float. * To check, which dataformat the samples will have, use \ref lqt_get_sample_format . * * The number of actually decoded samples (and EOF) can be obtained with * \ref lqt_last_audio_position */int lqt_decode_audio_raw(quicktime_t *file, void * output, long samples, int track);/** \ingroup audio_decode * \brief Get the audio language * \param file A quicktime handle * \param track Track index (starting with 0) * \param language Returns ISO-639 Language code * \returns 1 on success, 0 on error. * * The language code is a 3-character code, English is "eng", * Japanese is "jpn". */int lqt_get_audio_language(quicktime_t * file, int track, char * language); /** \ingroup audio_encode * \brief Encode audio in the native sampleformat of the codec * \param file A quicktime handle * \param input An array of interleaved samples * \param samples Number of samples to encode * \param track Track index (starting with 0) * \returns The number of encoded samples or 0 if an error occurred. * * This function bypasses all internal sampleformat conversion and allows * full resolution input for up to 32 bit integer and 32 bit float. * To check, which dataformat the samples will have, use \ref lqt_get_sample_format . */ int lqt_encode_audio_raw(quicktime_t *file, void * input, long samples, int track);/** \ingroup video_decode * \brief Seek to a specific video time * \param file A quicktime handle * \param time The desired time of the next frame in timescale tics (starting with 0) * \param track index (starting with 0) * * Use this for seeking. During sequential decode calls, the position will be updated automatically. * Replacement of \ref quicktime_set_video_position * which also works for streams with nonconstant framerate */void lqt_seek_video(quicktime_t * file, int track, int64_t time); /* * AVI Specific stuff *//** \ingroup general * \brief Query if the function is an AVI * \param file A quicktime handle * \returns 1 if the file is an AVI, 0 else */ int lqt_is_avi(quicktime_t *file);/** \ingroup general * \brief Get the WAVE id of an audio track * \param file A quicktime handle * \param track index (starting with 0) * \returns The WAVE id of the file. * * This is the counterpart of \ref quicktime_audio_compressor for AVI files. * It returns the 16 bit compression ID of the track. */int lqt_get_wav_id(quicktime_t *file, int track); /** \ingroup audio_decode * \brief Get the total number of audio channels across all tracks * \param file A quicktime handle * \returns The total channel count * * The result of this function is only meaningful in conjunction with * \ref lqt_decode_audio . In the general case, you should expect the audio tracks * in the file as completely independent. Use \ref quicktime_track_channels instead. */ int lqt_total_channels(quicktime_t *file);/* Extended metadata support *//** \ingroup metadata \brief Set the album for the file \param file A quicktime handle \param string The album*/ void lqt_set_album(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the artist for the file \param file A quicktime handle \param string The artist*/ void lqt_set_artist(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the genre for the file \param file A quicktime handle \param string The genre*/void lqt_set_genre(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the track number for the file \param file A quicktime handle \param string The track number (as string)*/ void lqt_set_track(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the comment for the file \param file A quicktime handle \param string The comment*/void lqt_set_comment(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the author for the file \param file A quicktime handle \param string The author*/void lqt_set_author(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the creation time for the file \param file A quicktime handle \param time The creation time*/void lqt_set_creation_time(quicktime_t *file, unsigned long time); /** \ingroup metadata \brief Get the album from the file \param file A quicktime handle \returns The album or NULL*/char * lqt_get_album(quicktime_t * file); /** \ingroup metadata \brief Get the artist from the file \param file A quicktime handle \returns The artist or NULL*/char * lqt_get_artist(quicktime_t * file);/** \ingroup metadata \brief Get the genre from the file \param file A quicktime handle \returns The genre or NULL*/char * lqt_get_genre(quicktime_t * file);/** \ingroup metadata \brief Get the track number from the file \param file A quicktime handle \returns The track number (as string) or NULL*/char * lqt_get_track(quicktime_t * file);/** \ingroup metadata \brief Get the comment from the file \param file A quicktime handle \returns The comment or NULL*/char * lqt_get_comment(quicktime_t *file);/** \ingroup metadata \brief Get the author from the file \param file A quicktime handle \returns The author or NULL*/char * lqt_get_author(quicktime_t *file);/** \ingroup metadata \brief Get the creation time from the file \param file A quicktime handle \returns The creation time*/unsigned long lqt_get_creation_time(quicktime_t * file); /* get track number from track id */int lqt_track_from_id(quicktime_t *file, int track_id);/** \ingroup general \brief Get a human readable filetype \param type An lqt filetype \returns A human readable description of the fileformat*/const char * lqt_file_type_to_string(lqt_file_type_t type);/** \ingroup general \brief Get the filetype \param file A quicktime handle \returns The file type*/lqt_file_type_t lqt_get_file_type(quicktime_t * file); /** \ingroup general \brief Open a file for reading \param filename A path to a regular file \returns An initialized file handle or NULL if opening failed. */quicktime_t * lqt_open_read(const char * filename);/** \ingroup general \brief Open a file for reading \param filename A path to a regular file \param cb Log callback \param log_data Data for log callback \returns An initialized file handle or NULL if opening failed. */ quicktime_t * lqt_open_read_with_log(const char * filename, lqt_log_callback_t cb, void * log_data); /** \ingroup general \brief Open a file for writing \param filename A path to a regular file \param type The type of the file, you want to create \returns An initialized file handle or NULL if opening failed. */quicktime_t * lqt_open_write(const char * filename, lqt_file_type_t type);/** \ingroup general \brief Open a file for writing \param filename A path to a regular file \param type The type of the file, you want to create \param cb Log callback \param log_data Data for log callback \returns An initialized file handle or NULL if opening failed. */quicktime_t * lqt_open_write_with_log(const char * filename, lqt_file_type_t type, lqt_log_callback_t cb, void * log_data); /** \ingroup general \brief Set the segment size for ODML AVIs \param file A quicktime handle \param size Maximum size of one RIFF in megabytes The actual sizes of the RIFFs will be slightly larger, therefore, you shouldn't set this to exactly to 2 GB. The default is 1 GB, which is reasonable, so there might be no reason to call this function at all.*/void lqt_set_max_riff_size(quicktime_t * file, int size); #ifdef __cplusplus}#endif /* __cplusplus */#pragma GCC visibility pop #endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -