libquicktime
Typedefs | Functions
General

General structures and functions. More...

Typedefs

typedef struct quicktime_s quicktime_t
 Quicktime handle. 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...
 
int quicktime_close (quicktime_t *file)
 Close a quicktime handle and free all associated memory. 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_avi (quicktime_t *file, int value)
 Write an AVI file instead of quicktime. More...
 
int lqt_fileno (quicktime_t *file)
 Return the raw filedescriptor associated with the file. More...
 
int lqt_get_codec_api_version ()
 Get the codec API version. More...
 
int lqt_is_avi (quicktime_t *file)
 Query if the function is an AVI. More...
 
int lqt_get_wav_id (quicktime_t *file, int track)
 Get the WAVE id of an audio track. More...
 
const char * lqt_file_type_to_string (lqt_file_type_t type)
 Get a human readable filetype. More...
 
lqt_file_type_t lqt_get_file_type (quicktime_t *file)
 Get the filetype. More...
 
quicktime_tlqt_open_read (const char *filename)
 Open a file for reading. More...
 
quicktime_tlqt_open_read_with_log (const char *filename, lqt_log_callback_t cb, void *log_data)
 Open a file for reading. More...
 
quicktime_tlqt_open_write (const char *filename, lqt_file_type_t type)
 Open a file for writing. More...
 
quicktime_tlqt_open_write_with_log (const char *filename, lqt_file_type_t type, lqt_log_callback_t cb, void *log_data)
 Open a file for writing. More...
 
void lqt_set_max_riff_size (quicktime_t *file, int size)
 Set the segment size for ODML AVIs. More...
 

Detailed Description

General structures and functions.

Typedef Documentation

typedef struct quicktime_s quicktime_t

Quicktime handle.

Opaque file handle used both for reading and writing. In quicktime4linux, this structure is public, resulting in programmers doing wrong things with it. In libquicktime, this is a private structure, which is accessed exclusively by functions.

Function Documentation

int quicktime_major ( )

Get the quicktime4linux major version.

This returns the major quicktime4linux version. The complete version is 2.0.0, which was the last qt4l version from which we ported code. It's not usable for detecting the libquicktime version.

int quicktime_minor ( )

Get the quicktime4linux minor version.

This returns the minor quicktime4linux version. The complete version is 2.0.0, which was the last qt4l version from which we ported code. It's not usable for detecting the libquicktime version.

int quicktime_release ( )

Get the quicktime4linux release number.

This returns the release number of quicktime4linux. The complete version is 2.0.0, which was the last qt4l version from which we ported code. It's not usable for detecting the libquicktime version.

int quicktime_check_sig ( char *  path)

Test file compatibility.

Parameters
pathA path to a regular file
Returns
1 if the file is decodable by libquicktime.

Check the signature of a path and return 1 is the file is likely to ba decodable by libquicktime. This check might return false positives or false negatives. In general it's better (although slower) to check, if quicktime_open return NULL or not.

quicktime_t* quicktime_open ( const char *  filename,
int  rd,
int  wr 
)

Open a file.

Parameters
filenameA path to a regular file
rd1 for open readonly, 0 else
wr1 for open writeonly, 0 else
Returns
An initialized file handle or NULL if opening failed.

Note, that files can never be opened read/write mode.

int quicktime_make_streamable ( char *  in_path,
char *  out_path 
)

Make a file streamable.

Parameters
in_pathExisting non streamable file
out_pathOutput file
Returns
1 if an error occurred, 0 else

This function makes a file streamable by placing the moov header at the beginning of the file. Note that you need approximately the twice the disk-space of the file. It is recommended, that this function is called only for files, which are encoded by libquicktime. Other files might not be correctly written.

int quicktime_close ( quicktime_t file)

Close a quicktime handle and free all associated memory.

Parameters
fileA quicktime handle
int quicktime_dump ( quicktime_t file)

Dump the file structures to stdout.

Parameters
fileA quicktime handle

This is used for debugging or by the qtdump utility

int quicktime_set_cpus ( quicktime_t file,
int  cpus 
)

Set the number of CPUs.

Parameters
fileA quicktime handle
cpusNumber 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 :)

void quicktime_set_avi ( quicktime_t file,
int  value 
)

Write an AVI file instead of quicktime.

Parameters
fileA quicktime handle
valueSet 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.

int lqt_fileno ( quicktime_t file)

Return the raw filedescriptor associated with the file.

Parameters
fileA quicktime handle
Returns
The filesecriptor

Use this of you want to call some low-level functions of the file. Note, that this routine should be used with care, since it's easy to screw things up.

int lqt_get_codec_api_version ( )

Get the codec API version.

Returns
The codec API version, libquicktime was compiled with

Normally you don't need this function. It is used internally to detect codec modules, which were compiled with an incompatible libquicktime version.

int lqt_is_avi ( quicktime_t file)

Query if the function is an AVI.

Parameters
fileA quicktime handle
Returns
1 if the file is an AVI, 0 else
int lqt_get_wav_id ( quicktime_t file,
int  track 
)

Get the WAVE id of an audio track.

Parameters
fileA quicktime handle
trackindex (starting with 0)
Returns
The WAVE id of the file.

This is the counterpart of quicktime_audio_compressor for AVI files. It returns the 16 bit compression ID of the track.

const char* lqt_file_type_to_string ( lqt_file_type_t  type)

Get a human readable filetype.

Parameters
typeAn lqt filetype
Returns
A human readable description of the fileformat
lqt_file_type_t lqt_get_file_type ( quicktime_t file)

Get the filetype.

Parameters
fileA quicktime handle
Returns
The file type
quicktime_t* lqt_open_read ( const char *  filename)

Open a file for reading.

Parameters
filenameA path to a regular file
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 
)

Open a file for reading.

Parameters
filenameA path to a regular file
cbLog callback
log_dataData for log callback
Returns
An initialized file handle or NULL if opening failed.
quicktime_t* lqt_open_write ( const char *  filename,
lqt_file_type_t  type 
)

Open a file for writing.

Parameters
filenameA path to a regular file
typeThe type of the file, you want to create
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 
)

Open a file for writing.

Parameters
filenameA path to a regular file
typeThe type of the file, you want to create
cbLog callback
log_dataData for log callback
Returns
An initialized file handle or NULL if opening failed.
void lqt_set_max_riff_size ( quicktime_t file,
int  size 
)

Set the segment size for ODML AVIs.

Parameters
fileA quicktime handle
sizeMaximum 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.