⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quicktime.h

📁 这个库实现了录象功能
💻 H
📖 第 1 页 / 共 3 页
字号:
 */long quicktime_sample_rate(quicktime_t *file, int track);/** \ingroup audio_decode * \brief Get the bits per sample of an audio track * \param file A quicktime handle * \param track index (starting with 0) * \returns The bits per sample (typically 16) * * Don't use this function for anything else than for informational * purposes. Bits per sample is meaningless for compressed codecs, and * sometimes plain wrong even for uncompressed ones. * * To get some better informations about the resolution, a codec will * deliver, use \ref lqt_get_sample_format */int quicktime_audio_bits(quicktime_t *file, int track);/** \ingroup audio_decode * \brief Get the number of channels of an audio track * \param file A quicktime handle * \param track index (starting with 0) * \returns The the number of channels */int quicktime_track_channels(quicktime_t *file, int track);/** \ingroup audio_decode * \brief Get the four character code of an audio track * \param file A quicktime handle * \param track index (starting with 0) * \returns The four character code (fourcc) of the track. * * Note, that this function might return nothing meaningful for AVI files, * since AVI doesn't use four character codes for audio streams. * To get more save information about the codec responsible for the stream, * use \ref lqt_audio_codec_from_file . */char* quicktime_audio_compressor(quicktime_t *file, int track);/** \ingroup video_decode * \brief Check if a file has at least one video track * \param file A quicktime handle * \returns 1 if the file has video tracks, 0 else */int quicktime_has_video(quicktime_t *file);/** \ingroup video_decode * \brief Get the width of a video track * \param file A quicktime handle * \param track index (starting with 0) * \returns The image width in pixels */int quicktime_video_width(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the height of a video track * \param file A quicktime handle * \param track index (starting with 0) * \returns The image height in pixels */int quicktime_video_height(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the depth of a video track * \param file A quicktime handle * \param track index (starting with 0) * \returns The image depth in pixels * * Don't use this function for anything else than for informational * purposes. Depth is meaningless for compressed codecs and * sometimes plain wrong even for uncompressed ones. * * To get some better informations about the pixel format, a codec will * deliver, use \ref lqt_get_cmodel or (better) \ref lqt_get_decoder_colormodel . *  */int quicktime_video_depth(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the framerate of a video track * \param file A quicktime handle * \param track index (starting with 0) * \returns The framerate in frames per second. * * Don't use this unless A/V sync is nor important. The return value is practically * random for tracks with nonconstant framerate. Even for constant framerate, the return * value can never correctly resemble e.g. the NTSC framerate (30000/1001). * * To get the framerate as a rational number (and check if it's constant), use \ref lqt_frame_duration * and \ref lqt_video_time_scale . */  double quicktime_frame_rate(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the four character code of a video track * \param file A quicktime handle * \param track index (starting with 0) * \returns The four character code (fourcc) of the track. * * To get more save information about the codec responsible for the stream, * use \ref lqt_video_codec_from_file . */char* quicktime_video_compressor(quicktime_t *file, int track);/* number of bytes of raw data in this frame *//** \ingroup video_decode * \brief Get the compressed size of frame in a video track * \param file A quicktime handle * \param frame Frame index (starting with 0) * \param track index (starting with 0) * \returns The size in bytes of the frame * * Use this if you want to read compressed frames with \ref quicktime_read_frame */ long quicktime_frame_size(quicktime_t *file, long frame, int track);/** \ingroup audio_decode *  \param file A quicktime handle *  \param quicktime_track Returns the index of the quicktime track *  \param quicktime_channel Returns the channel index inside the quicktime track *  \param channel The channel to query * * Don't use this function (see \ref lqt_decode_audio ) */  int quicktime_channel_location(quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel);/* file positioning *//* Remove these and see what happens :) */// int quicktime_seek_end(quicktime_t *file);/** \ingroup General *  \brief Reposition all tracks to the very beginning *  \param file A quicktime handle *  \returns Always 0 * * Works (of course) only for decoding */int quicktime_seek_start(quicktime_t *file);/* set position of file descriptor relative to a track *//** \ingroup audio_decode *  \brief Seek to a specific audio position * \param file A quicktime handle * \param sample The sample position (starting with 0) * \param track index (starting with 0) * * Use this for seeking. During sequential decode calls, the position will be updated automatically */int quicktime_set_audio_position(quicktime_t *file, int64_t sample, int track);/** \ingroup video_decode *  \brief Seek to a specific video frame * \param file A quicktime handle * \param frame The frame position (starting with 0) * \param track index (starting with 0) * * Use this for seeking. During sequential decode calls, the position will be updated automatically. * If you want to support tracks with nonconmstant framerate, you should use \ref lqt_seek_video . */int quicktime_set_video_position(quicktime_t *file, int64_t frame, int track);/* ========================== Access to raw data follows. *//* write data for one quicktime track *//* the user must handle conversion to the channels in this track */int quicktime_write_audio(quicktime_t *file, uint8_t *audio_buffer, long samples, int track);/** \ingroup video_encode *  \brief Write a compressed video frame *  \param file A quicktime handle *  \param video_buffer The compressed frame *  \param bytes Bytes of the compressed frame *  \param track index (starting with 0) * *  If you get compressed video frames (e.g. from a firewire port), *  use this function to write them into a quicktime container. Before, *  you must set up the track with \ref lqt_add_video_track or, if no *  software codec is present, with \ref quicktime_set_video . */     int quicktime_write_frame(quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track);/** \ingroup video_decode *  \brief Read a compressed video frame *  \param file A quicktime handle *  \param video_buffer The compressed frame *  \param track index (starting with 0) * *  Read a compressed video frame. The size of the frame can be obtained with *  \ref quicktime_frame_size . This function increments all pointers in the *  track, so you can sequentially read all frames without setting the position *  in between. */  long quicktime_read_frame(quicktime_t *file, unsigned char *video_buffer, int track);/* for reading frame using a library that needs a file descriptor *//* Frame caching doesn't work here. */int quicktime_read_frame_init(quicktime_t *file, int track);int quicktime_read_frame_end(quicktime_t *file, int track);/* One keyframe table for each track */long quicktime_get_keyframe_before(quicktime_t *file, long frame, int track);void quicktime_insert_keyframe(quicktime_t *file, long frame, int track);/* Track has keyframes */int quicktime_has_keyframes(quicktime_t *file, int track);/* ===================== Access to built in codecs follows. *//* If the codec for this track is supported in the library return 1. *//** \ingroup video_decode * \brief Check if a video track is supported by libquicktime * \param file A quicktime handle * \param track index (starting with 0) * \returns 1 if a codec for this track is available, 0 else */int quicktime_supported_video(quicktime_t *file, int track);/** \ingroup audio_decode * \brief Check if an audio track is supported by libquicktime * \param file A quicktime handle * \param track index (starting with 0) * \returns 1 if a codec for this track is available, 0 else */int quicktime_supported_audio(quicktime_t *file, int track);/** \ingroup video_decode * \brief Check if a colormodel is supported for decoding * \param file A quicktime handle * \param colormodel A colormodel (see \ref color) * \param track index (starting with 0) * \returns 1 if the colormodel can be used for decoding calls, 0 if it can't. * * To let libquicktime get the best colormodel out of a list of colormodels your application * supports, use \ref lqt_get_best_colormodel instead. */  int quicktime_reads_cmodel(quicktime_t *file, 		int colormodel, 		int track);/** \ingroup video_encode * \brief Check if a colormodel is supported for encoding * \param file A quicktime handle * \param colormodel A colormodel (see \ref color) * \param track index (starting with 0) * \returns 1 if the colormodel can be used for encoding calls, 0 if it can't. * * To let libquicktime get the best colormodel out of a list of colormodels your application * supports, use \ref lqt_get_best_colormodel instead. */int quicktime_writes_cmodel(quicktime_t *file, 		int colormodel, 		int track);/* Hacks for temporal codec */int quicktime_divx_is_key(unsigned char *data, long size);int quicktime_divx_write_vol(unsigned char *data_start,	int vol_width, 	int vol_height, 	int time_increment_resolution, 	double frame_rate);int quicktime_divx_has_vol(unsigned char *data);int quicktime_div3_is_key(unsigned char *data, long size);/** \ingroup video_encode * \brief Encode a video frame * \param file A quicktime handle * \param row_pointers Frame buffer (see \ref lqt_rows_alloc ) * \param track index (starting with 0) * * Encode one video frame. This works only for constant framerate streams. For nonconstant framerates, * you'll want to use \ref lqt_encode_video instead. */  int quicktime_encode_video(quicktime_t *file, 	unsigned char **row_pointers, 	int track);/** \ingroup video_decode * \brief Decode a video frame in \ref BC_RGB888 * \param file A quicktime handle * \param row_pointers Frame buffer (see \ref lqt_rows_alloc ) * \param track index (starting with 0) * * Decode one video frame. All colormodels are converted to \ref BC_RGB888 automatically probably * causing lots of overhead. To decode frames in other colormodels, use \ref lqt_decode_video . */int quicktime_decode_video(quicktime_t *file, 	unsigned char **row_pointers, 	int track);/** \ingroup video_decode * \brief Decode aand optionally scale a video frame * \param file A quicktime handle * \param in_x Horizontal offset of the image relative to the source image * \param in_y Vertical offset of the image relative to the source image * \param in_w Image width in the source image * \param in_h Image height in the source image * \param out_w Width of output frame * \param out_h Height of output frame * \param color_model Colormodel of the output frame * \param row_pointers Frame buffer (see \ref lqt_rows_alloc ) * \param track index (starting with 0) * * This function takes a subwindow of the source image (specified by in_x, in_y, in_w, in_h) * and scales it to the dimensions (out_w, out_h) of the output frame given by row_pointers. Colormodel * conversion from the stream colormodel to the color_model you pass is also done. Scaling is done * by a not very optimized nearest neighbor algorithm. To do high quality video scaling, you should use * something else. */long quicktime_decode_scaled(quicktime_t *file, 	int in_x,                    /* Location of input frame to take picture */	int in_y,	int in_w,	int in_h,	int out_w,                   /* Dimensions of output frame */	int out_h,	int color_model,             /* One of the color models defined above */	unsigned char **row_pointers, 	int track);/* Decode or encode audio for a single channel into the buffer. *//* Pass a buffer for the _i or the _f argument if you want int16 or float data. *//* Notice that encoding requires an array of pointers to each channel. *//** \ingroup audio_decode *  \brief Decode a number of audio samples of a single channel *  \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 channel Channel to decode * * Never use this function: Decoding only one channel at once causes lots of internal overhead * if you need all channels anyway. In this case, \ref lqt_decode_audio_track is the better choice. * Furthermore, you won't be able to decode the full resolution * for 24 and 32 bit codecs. To decode the maximum resolution, use \ref lqt_decode_audio_raw. * * The number of actually decoded samples (and EOF) can be obtained with * \ref lqt_last_audio_position */ int quicktime_decode_audio(quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel);/** \ingroup audio_encode *  \brief Encode a number of audio samples for the first track *  \param file A quicktime handle *  \param input_i 16 bit integer output buffer (or NULL) *  \param input_f floating point output buffer (or NULL) *  \param samples Number of samples to decode * * Never use this function: It won't let you encode more than one audio track. To encode * audio for multiple tracks, use \ref lqt_encode_audio_track . If you want to pass the full * resolution even for 24/32 bit audio, use \ref lqt_encode_audio_raw . */int quicktime_encode_audio(quicktime_t *file, int16_t **input_i, float **input_f, long samples);/** \ingroup general *  \brief Dump the file structures to stdout *  \param file A quicktime handle * * This is used for debugging or by the qtdump utility */   int quicktime_dump(quicktime_t *file);/* Specify the number of cpus to utilize. *//** \ingroup general *  \brief Set the number of CPUs *  \param file A quicktime handle *  \param cpus Number of CPUs to use * *  Libquicktime no longer does multithreaded en-/decoding. Therefore you *  can call this function if you like, but it will have no effect :) */  int quicktime_set_cpus(quicktime_t *file, int cpus);/* Specify whether to read contiguously or not. *//* preload is the number of bytes to read ahead. *//* This is no longer functional to the end user but is used to accelerate *//* reading the header internally. */void quicktime_set_preload(quicktime_t *file, int64_t preload);int64_t quicktime_byte_position(quicktime_t *file);/** \ingroup general *  \brief Write an AVI file instead of quicktime *  \param file A quicktime handle *  \param value Set this to 1. If you want quicktime, simply don't call this function. * * This function must be called AFTER all tracks are set up and BEFORE anything is encoded. */  void quicktime_set_avi(quicktime_t *file, int value);#pragma GCC visibility pop#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -