📄 lqt.h
字号:
/** \brief Get the timescale for a text track * \param file A quicktime handle * \param track Track index (starting with 0) * \returns The timescale of the track. */int lqt_text_time_scale(quicktime_t * file, int track);/** \brief Set the text box of a text track * \param file A quicktime handle * \param track Track index (starting with 0) * \param top Returns the top border * \param left Returns the left border * \param bottom Returns the bottom border * \param right Returns the right border */ void lqt_get_text_box(quicktime_t * file, int track, uint16_t * top, uint16_t * left, uint16_t * bottom, uint16_t * right); /** \brief Read a text sample * \param file A quicktime handle * \param track Track index (starting with 0) * \param text Address of a buffer * \param text_alloc Allocated bytes for this buffer (will be changed) * \param timestamp Returns the timestamp of the sample * \param duration Returns the duration of the sample * \returns 1 if a sample was decoded, 0 if the track is finished * * This funtion calls realloc() to make sure there is enough space for * for the text. It's a good idea to always pass the same buffer to this * function (set to NULL initially) and free it after the file is closed. */ int lqt_read_text(quicktime_t * file, int track, char ** text, int * text_alloc, int64_t * timestamp, int64_t * duration);/** \brief Check if a track is a chapter track * \param file A quicktime handle * \param track Track index (starting with 0) * \returns 1 if the text track is a chapter track, 0 else */ int lqt_is_chapter_track(quicktime_t * file, int track);/** \brief Get the total number of text samples * \param file A quicktime handle * \param track Track index (starting with 0) * \returns The number of samples */int64_t lqt_text_samples(quicktime_t * file, int track);/** \brief Go to a specific sample * \param file A quicktime handle * \param track Track index (starting with 0) * \param position The sample position (starting with 0) */void lqt_set_text_position(quicktime_t * file, int track, int64_t position);/** \brief Go to a specific time * \param file A quicktime handle * \param track Track index (starting with 0) * \param time Time * * This wil reposition the text track such, that the next call * to \ref lqt_read_text will return a sample with at least the * timestamp you specified. */void lqt_set_text_time(quicktime_t * file, int track, int64_t time);/** \brief Get the foreground color of a text track * \param file A quicktime handle * \param track Track index (starting with 0) * \param r Returns red * \param g Returns green * \param b Returns blue * \param a Returns alpha * * Color values are between 0x0000 and 0xffff. */ void lqt_get_text_fg_color(quicktime_t * file, int track, uint16_t * r, uint16_t * g, uint16_t * b, uint16_t * a);/** \brief Get the background color of a text track * \param file A quicktime handle * \param track Track index (starting with 0) * \param r Returns red * \param g Returns green * \param b Returns blue * \param a Returns alpha * * Color values are between 0x0000 and 0xffff. */ void lqt_get_text_bg_color(quicktime_t * file, int track, uint16_t * r, uint16_t * g, uint16_t * b, uint16_t * a);/** @}*//** \defgroup timecodes Timecodes \brief Timecode support Timecodes are passed to/from libquicktime in the same format as they are stored in the file: 32 bit unsigned integers. For the meaning of the bits, see the section "Timecode Sample Data" in the Quicktime file format specification. @{*/ #define LQT_TIMECODE_DROP 0x0001 //!< Indicates whether the timecode is drop frame#define LQT_TIMECODE_24HMAX 0x0002 //!< Indicates whether the timecode wraps after 24 hours#define LQT_TIMECODE_NEG_OK 0x0004 //!< Indicates whether negative time values are allowed#define LQT_TIMECODE_COUNTER 0x0008 //!< Indicates whether the time value corresponds to a tape counter value/** \brief Attach a timecode track to a video track * \param file A quicktime handle * \param track Video track index (starting with 0) * \param flags Zero or more of the LQT_TIMECODE_* flags * \param framerate The integer framerate * * If the format (e.g. AVI) doesn't support timecode, this * function emits a warning. * */void lqt_add_timecode_track(quicktime_t * file, int track, uint32_t flags, int framerate);/** \brief Write a timecode for the next video frame to be encoded * \param file A quicktime handle * \param track Video track index (starting with 0) * * Call this function @b before encoding the actual video frame. */ void lqt_write_timecode(quicktime_t * file, int track, uint32_t timecode);/** \brief Check, if a video track has timecodes * \param file A quicktime handle * \param track Video track index (starting with 0) * \param flags If non NULL returns zero or more of the LQT_TIMECODE_* flags * \param framerate If non NULL returns the integer framerate * \returns 1 if timecodes are available, 0 else */ int lqt_has_timecode_track(quicktime_t * file, int track, uint32_t * flags, int * framerate);/** \brief Read the timecode for the next frame to be decoded * \param file A quicktime handle * \param track Video track index (starting with 0) * \param timecode Returns the timecode if available * \returns 1 if a timecode is available for this frame, 0 else * * For frames, which have no timecode attached, you can increment the * last timecode accordingly in your application. * Call this function @b before decoding the actual video frame. */ int lqt_read_timecode(quicktime_t * file, int track, uint32_t * timecode);/** \brief Get the tape name stored in a timecode track * \param file A quicktime handle * \param track Video track index (starting with 0) * \returns pointer to tape name (might be NULL if no tape name) * * Returned pointer should remain valid as long as the file is open. * Do not free it. */ const char * lqt_get_timecode_tape_name(quicktime_t * file, int track);/** \brief Set the tapename for a timecode track * \param file A quicktime handle * \param track Video track index (starting with 0) * \param tapename Tape name string * * A copy is made of the string passed in */ void lqt_set_timecode_tape_name(quicktime_t * file, int track, const char * tapename);/** \brief Get the enabled flag of a timecode track * \param file A quicktime handle * \param track Video track index (starting with 0) * \returns 1 if enabled, 0 if not enabled */int lqt_get_timecode_track_enabled(quicktime_t * file, int track);/** \brief Enable or disable a timecode track * \param file A quicktime handle * \param track Video track index (starting with 0) * \param enabled 0=>disable otherwise enable */void lqt_set_timecode_track_enabled(quicktime_t * file, int track, int enabled);/** @}*/ /*********************************************** * Advanced colormodel handling. * (defined in lqt_color.c) ***********************************************//** \ingroup color * * This value is used for termination of colormodel arrays */ #define LQT_COLORMODEL_NONE -1 /* Colormodel <-> string conversion (used by registry file routines) *//** \ingroup color \brief Convert a colormodel to a human readable string \param colormodel A colormodel \returns A description of the colormodel*/ const char * lqt_colormodel_to_string(int colormodel);/** \ingroup color \brief Convert a description string to a colormodel \param str A colormodel description (as returned by \ref lqt_colormodel_to_string) \returns The corresponding colormodel or \ref LQT_COLORMODEL_NONE*/ int lqt_string_to_colormodel(const char * str);/* Query information about the colormodel *//** \ingroup color \brief Check if a colormodel is planar \param colormodel A colormodel \returns 1 if the colormodel is planar, 0 else*/int lqt_colormodel_is_planar(int colormodel); /** \ingroup color \brief Check if a colormodel has an alpha (transperency) channel \param colormodel A colormodel \returns 1 if the colormodel has an alpha channel, 0 else*/int lqt_colormodel_has_alpha(int colormodel);/** \ingroup color \brief Check, if a colormodel is RGB based \param colormodel A colormodel \returns 1 if the colormodel is RGB based, 0 else*/ int lqt_colormodel_is_rgb(int colormodel);/** \ingroup color \brief Check, if a colormodel is YUV based \param colormodel A colormodel \returns 1 if the colormodel is YUV based, 0 else*/int lqt_colormodel_is_yuv(int colormodel);/** \ingroup color \brief Get the chroma subsampling factors \param colormodel A colormodel \param sub_h Returns the horizontal subsampling factor \param sub_v Returns the vertical subsampling factor */void lqt_colormodel_get_chroma_sub(int colormodel, int * sub_h, int * sub_v);/** \ingroup color \brief Get the default row span for a colormodel and an image width \param colormodel A colormodel \param width Image width \param rowspan Returns the rowspan for the luminance (Y) plane \param rowspan_uv Returns the rowspan for the chrominance (U/V) planes The rowspan is the byte offset between scanlines. It can be calculated from the colormodel and the image width. Some APIs however, padd the scanlines to certain boundaries, so the rowspans might become larger here (see \ref lqt_set_row_span and \ref lqt_set_row_span_uv).*/void lqt_get_default_rowspan(int colormodel, int width, int * rowspan, int * rowspan_uv);/** \ingroup color * \brief Check if a colormodel conversion is supported by libquicktime * \param in_cmodel Input colormodel * \param out_cmodel Output colormodel * \returns 1 if the requested conversion is possible, 0 else * * As noted before, the colormodel converter is not complete, and this function * checks it. As a fallback, conversions from and to \ref BC_RGB888 are always supported. * If you need a converison, which is not present, contact the authors for hints how to * write it :) */ int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel); /* Query supported colormodels *//** \ingroup color \brief Get number of supported colormodels \returns The number of colormodels known to your version of libquicktime*/ int lqt_num_colormodels();/** \ingroup color \brief Get a colormodel string \param index Index of the colormodel (between 0 and the return value of \ref lqt_num_colormodels - 1) \returns A description of the colormodel according to index or NULL.*/ const char * lqt_get_colormodel_string(int index);/** \ingroup color \brief Get a colormodel \param index Index of the colormodel (between 0 and the return value of \ref lqt_num_colormodels - 1) \returns The colormodel according to index or \ref LQT_COLORMODEL_NONE*/ int lqt_get_colormodel(int index);/** \ingroup video_decode * \brief Get the native colormodel of the decoder * \param file A quicktime handle * \param track Track index (starting with 0) * * This returns the colormodel, which is used by the stream natively. If your * application can handle the colormodel, you can use \ref lqt_decode_video for * decoding in the native colormodel. This will bypass all internal colormodel conversions. */int lqt_get_decoder_colormodel(quicktime_t * file, int track);/** \ingroup video * \brief Get the best colormodel out of a list of supported colormodels * \param file A quicktime handle * \param track Track index (starting with 0) * \param supported An array with supported colormodels. * \returns The best colormodel * * This is a convenience function for application developers: * It takes an array with supported colormodels (Terminated with LQT_COLORMODEL_NONE) * and returns the best colormodel. The decision is done according to the conversion
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -