libquicktime
Macros | Typedefs | Enumerations | Functions
quicktime.h File Reference
#include <inttypes.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define QUICKTIME_DIVX   "DIVX"
 Non compatible divx. More...
 
#define QUICKTIME_DIV3   "DIV3"
 Divx for AVI files. More...
 
#define QUICKTIME_DV   "dvc "
 DV. More...
 
#define QUICKTIME_DV_AVID   "AVdv"
 DV. More...
 
#define QUICKTIME_DV_AVID_A   "dvcp"
 DV. More...
 
#define QUICKTIME_RAW   "raw "
 Uncompressed RGB. More...
 
#define QUICKTIME_JPEG   "jpeg"
 JPEG-Photo. More...
 
#define QUICKTIME_PNG   "png "
 JPEG-Photo. More...
 
#define QUICKTIME_MJPA   "mjpa"
 Motion JPEG-A. More...
 
#define QUICKTIME_YUV2   "yuv2"
 8 bit Packed full-range (not video) YUV 4:2:2 More...
 
#define QUICKTIME_YUV4   "yuv4"
 YUV 4:2:0. More...
 
#define QUICKTIME_YUV420   "yv12"
 8 bit planar YUV 4:2:0 More...
 
#define QUICKTIME_2VUY   "2vuy"
 8 bit Packed YUV (video range) 4:2:2 More...
 
#define QUICKTIME_YUVS   "yuvs"
 8 bit Packed YUV (video range) 4:2:2 More...
 
#define QUICKTIME_V308   "v308"
 8 bit Packed YUV 4:4:4 More...
 
#define QUICKTIME_V408   "v408"
 8 bit Packed YUVA 4:4:4:4 More...
 
#define QUICKTIME_V210   "v210"
 10 bit Packed YUV 4:2:2 More...
 
#define QUICKTIME_V410   "v410"
 10 bit Packed YUV 4:4:4 More...
 
#define QUICKTIME_RAWAUDIO   "raw "
 Unsigned 8 bit. More...
 
#define QUICKTIME_IMA4   "ima4"
 IMA4. More...
 
#define QUICKTIME_TWOS   "twos"
 Twos compliment 16 bit. More...
 
#define QUICKTIME_ULAW   "ulaw"
 mu-law 2:1 More...
 
#define QUICKTIME_VORBIS   "OggS"
 Ogg Vorbis. More...
 
#define QUICKTIME_MP3   ".mp3"
 MP3. More...
 

Typedefs

typedef struct lqt_codec_info_s lqt_codec_info_t
 
typedef void(* lqt_log_callback_t) (lqt_log_level_t level, const char *domain, const char *message, void *data)
 Log callback. More...
 
typedef struct quicktime_s quicktime_t
 Quicktime handle. More...
 

Enumerations

enum  lqt_log_level_t {
  LQT_LOG_ERROR = (1<<0),
  LQT_LOG_WARNING = (1<<1),
  LQT_LOG_INFO = (1<<2),
  LQT_LOG_DEBUG = (1<<3)
}
 Log level. More...
 
enum  lqt_file_type_t {
  LQT_FILE_NONE = 0,
  LQT_FILE_QT_OLD = (1<<0),
  LQT_FILE_QT = (1<<1),
  LQT_FILE_AVI = (1<<2),
  LQT_FILE_AVI_ODML = (1<<3),
  LQT_FILE_MP4 = (1<<4),
  LQT_FILE_M4A = (1<<5),
  LQT_FILE_3GP = (1<<6)
}
 File types. More...
 
enum  lqt_channel_t {
  LQT_CHANNEL_UNKNOWN,
  LQT_CHANNEL_FRONT_LEFT,
  LQT_CHANNEL_FRONT_RIGHT,
  LQT_CHANNEL_FRONT_CENTER,
  LQT_CHANNEL_FRONT_CENTER_LEFT,
  LQT_CHANNEL_FRONT_CENTER_RIGHT,
  LQT_CHANNEL_BACK_CENTER,
  LQT_CHANNEL_BACK_LEFT,
  LQT_CHANNEL_BACK_RIGHT,
  LQT_CHANNEL_SIDE_LEFT,
  LQT_CHANNEL_SIDE_RIGHT,
  LQT_CHANNEL_LFE,
  LQT_CHANNEL_Ls,
  LQT_CHANNEL_Rs,
  LQT_CHANNEL_MONO,
  LQT_CHANNEL_Lt,
  LQT_CHANNEL_Rt
}
 Channel definitions. More...
 
enum  lqt_interlace_mode_t {
  LQT_INTERLACE_NONE = 0,
  LQT_INTERLACE_TOP_FIRST,
  LQT_INTERLACE_BOTTOM_FIRST
}
 interlace modes More...
 
enum  lqt_chroma_placement_t {
  LQT_CHROMA_PLACEMENT_DEFAULT = 0,
  LQT_CHROMA_PLACEMENT_MPEG2,
  LQT_CHROMA_PLACEMENT_DVPAL
}
 Chroma placement. More...
 
enum  lqt_sample_format_t {
  LQT_SAMPLE_UNDEFINED = 0,
  LQT_SAMPLE_INT8,
  LQT_SAMPLE_UINT8,
  LQT_SAMPLE_INT16,
  LQT_SAMPLE_INT32,
  LQT_SAMPLE_FLOAT,
  LQT_SAMPLE_DOUBLE
}
 Sample format definitions for audio. More...
 

Functions

int quicktime_major ()
 Get the quicktime4linux major version. More...
 
int quicktime_minor ()
 Get the quicktime4linux minor version. More...
 
int quicktime_release ()
 Get the quicktime4linux release number. More...
 
int quicktime_check_sig (char *path)
 Test file compatibility. More...
 
quicktime_tquicktime_open (const char *filename, int rd, int wr)
 Open a file. More...
 
int quicktime_make_streamable (char *in_path, char *out_path)
 Make a file streamable. More...
 
void quicktime_set_copyright (quicktime_t *file, char *string)
 Set the copyright info for the file. More...
 
void quicktime_set_name (quicktime_t *file, char *string)
 Set the name for the file. More...
 
void quicktime_set_info (quicktime_t *file, char *string)
 Set info for the file. More...
 
char * quicktime_get_copyright (quicktime_t *file)
 Get the copyright info from the file. More...
 
char * quicktime_get_name (quicktime_t *file)
 Get the name from the file. More...
 
char * quicktime_get_info (quicktime_t *file)
 Get the info string from the file. More...
 
int quicktime_set_audio (quicktime_t *file, int channels, long sample_rate, int bits, char *compressor)
 Set up tracks in a new file after opening and before writing. More...
 
void quicktime_set_framerate (quicktime_t *file, double framerate)
 Set the framerate for encoding. More...
 
int quicktime_set_video (quicktime_t *file, int tracks, int frame_w, int frame_h, double frame_rate, char *compressor)
 Set up video tracks for encoding. More...
 
void quicktime_set_jpeg (quicktime_t *file, int quality, int use_float)
 Set jpeg encoding quality. More...
 
void quicktime_set_parameter (quicktime_t *file, char *key, void *value)
 Set a codec parameter. More...
 
void quicktime_set_depth (quicktime_t *file, int depth, int track)
 Set the depth of a video track. More...
 
void quicktime_set_cmodel (quicktime_t *file, int colormodel)
 Set the colormodel for en-/decoding. More...
 
void quicktime_set_row_span (quicktime_t *file, int row_span)
 Set the row_span for en-/decoding. More...
 
int quicktime_close (quicktime_t *file)
 Close a quicktime handle and free all associated memory. More...
 
long quicktime_audio_length (quicktime_t *file, int track)
 Get the audio length. More...
 
long quicktime_video_length (quicktime_t *file, int track)
 Get the video length. More...
 
long quicktime_audio_position (quicktime_t *file, int track)
 Get the audio position. More...
 
long quicktime_video_position (quicktime_t *file, int track)
 Get the video position. More...
 
int quicktime_video_tracks (quicktime_t *file)
 Get the number of video tracks. More...
 
int quicktime_audio_tracks (quicktime_t *file)
 Get the number of audio tracks. More...
 
int quicktime_has_audio (quicktime_t *file)
 Check if a file has at least one audio track. More...
 
long quicktime_sample_rate (quicktime_t *file, int track)
 Get the samplerate of an audio track. More...
 
int quicktime_audio_bits (quicktime_t *file, int track)
 Get the bits per sample of an audio track. More...
 
int quicktime_track_channels (quicktime_t *file, int track)
 Get the number of channels of an audio track. More...
 
char * quicktime_audio_compressor (quicktime_t *file, int track)
 Get the four character code of an audio track. More...
 
int quicktime_has_video (quicktime_t *file)
 Check if a file has at least one video track. More...
 
int quicktime_video_width (quicktime_t *file, int track)
 Get the width of a video track. More...
 
int quicktime_video_height (quicktime_t *file, int track)
 Get the height of a video track. More...
 
int quicktime_video_depth (quicktime_t *file, int track)
 Get the depth of a video track. More...
 
double quicktime_frame_rate (quicktime_t *file, int track)
 Get the framerate of a video track. More...
 
char * quicktime_video_compressor (quicktime_t *file, int track)
 Get the four character code of a video track. More...
 
long quicktime_frame_size (quicktime_t *file, long frame, int track)
 Get the compressed size of frame in a video track. More...
 
int quicktime_channel_location (quicktime_t *file, int *quicktime_track, int *quicktime_channel, int channel)
 
int quicktime_seek_start (quicktime_t *file)
 Reposition all tracks to the very beginning. More...
 
int quicktime_set_audio_position (quicktime_t *file, int64_t sample, int track)
 Seek to a specific audio position. More...
 
int quicktime_set_video_position (quicktime_t *file, int64_t frame, int track)
 Seek to a specific video frame. More...
 
int quicktime_write_audio (quicktime_t *file, uint8_t *audio_buffer, long samples, int track)
 
int quicktime_write_frame (quicktime_t *file, uint8_t *video_buffer, int64_t bytes, int track)
 Write a compressed video frame. More...
 
long quicktime_read_frame (quicktime_t *file, unsigned char *video_buffer, int track)
 Read a compressed video frame. More...
 
int quicktime_read_frame_init (quicktime_t *file, int track)
 
int quicktime_read_frame_end (quicktime_t *file, int track)
 
long quicktime_get_keyframe_before (quicktime_t *file, long frame, int track)
 
long quicktime_get_partial_keyframe_before (quicktime_t *file, long frame, int track)
 
void quicktime_insert_keyframe (quicktime_t *file, long frame, int track)
 
void quicktime_insert_partial_keyframe (quicktime_t *file, long frame, int track)
 
int quicktime_has_keyframes (quicktime_t *file, int track)
 
void quicktime_insert_sdtp_entry (quicktime_t *file, long frame, int track, uint8_t flags)
 
int quicktime_supported_video (quicktime_t *file, int track)
 Check if a video track is supported by libquicktime. More...
 
int quicktime_supported_audio (quicktime_t *file, int track)
 Check if an audio track is supported by libquicktime. More...
 
int quicktime_reads_cmodel (quicktime_t *file, int colormodel, int track)
 Check if a colormodel is supported for decoding. More...
 
int quicktime_writes_cmodel (quicktime_t *file, int colormodel, int track)
 Check if a colormodel is supported for encoding. More...
 
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)
 
int quicktime_encode_video (quicktime_t *file, unsigned char **row_pointers, int track)
 Encode a video frame. More...
 
int quicktime_decode_video (quicktime_t *file, unsigned char **row_pointers, int track)
 Decode a video frame in BC_RGB888. More...
 
long quicktime_decode_scaled (quicktime_t *file, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, int color_model, unsigned char **row_pointers, int track)
 Decode aand optionally scale a video frame. More...
 
int quicktime_decode_audio (quicktime_t *file, int16_t *output_i, float *output_f, long samples, int channel)
 Decode a number of audio samples of a single channel. More...
 
int quicktime_encode_audio (quicktime_t *file, int16_t **input_i, float **input_f, long samples)
 Encode a number of audio samples for the first track. More...
 
int quicktime_dump (quicktime_t *file)
 Dump the file structures to stdout. More...
 
int quicktime_set_cpus (quicktime_t *file, int cpus)
 Set the number of CPUs. More...
 
void quicktime_set_preload (quicktime_t *file, int64_t preload)
 
int64_t quicktime_byte_position (quicktime_t *file)
 
void quicktime_set_avi (quicktime_t *file, int value)
 Write an AVI file instead of quicktime. More...
 

Detailed Description

Public api header for the quicktime4linux compatibility layer.

Enumeration Type Documentation

◆ lqt_file_type_t

File types.

These are bitmasks since codecs need lists of supported file formats

Enumerator
LQT_FILE_NONE 

Undefined or not yet set

LQT_FILE_QT_OLD 

Old libquicktime format (without ftyp)

LQT_FILE_QT 

New libquicktime format (ftyp = "qt ")

LQT_FILE_AVI 

AVI

LQT_FILE_AVI_ODML 

Opendml AVI (> 2G)

LQT_FILE_MP4 

.mp4 (ftyp = "mp42")

LQT_FILE_M4A 

.m4a

LQT_FILE_3GP 

.3gp

Function Documentation

◆ quicktime_seek_start()

int quicktime_seek_start ( quicktime_t file)

Reposition all tracks to the very beginning.

Parameters
fileA quicktime handle
Returns
Always 0

Works (of course) only for decoding