libquicktime: General

# General

General structures and functions. More...

## Typedefs
typedef struct quicktime_s | quicktime_t
| Quicktime handle.
## Functions
int | quicktime_major ()
| Get the quicktime4linux major version.
int | quicktime_minor ()
| Get the quicktime4linux minor version.
int | quicktime_release ()
| Get the quicktime4linux release number.
int | quicktime_check_sig (char *path)
| Test file compatibility.
quicktime_t * | quicktime_open (const char *filename, int rd, int wr)
| Open a file.
int | quicktime_make_streamable (char *in_path, char *out_path)
| Make a file streamable.
int | quicktime_close (quicktime_t *file)
| Close a quicktime handle and free all associated memory.
int | quicktime_dump (quicktime_t *file)
| Dump the file structures to stdout.
int | quicktime_set_cpus (quicktime_t *file, int cpus)
| Set the number of CPUs.
void | quicktime_set_avi (quicktime_t *file, int value)
| Write an AVI file instead of quicktime.
int | lqt_fileno (quicktime_t *file)
| Return the raw filedescriptor associated with the file.
int | lqt_get_codec_api_version ()
| Get the codec API version.
int | lqt_is_avi (quicktime_t *file)
| Query if the function is an AVI.
int | lqt_get_wav_id (quicktime_t *file, int track)
| Get the WAVE id of an audio track.
const char * | lqt_file_type_to_string (lqt_file_type_t type)
| Get a human readable filetype.
lqt_file_type_t | lqt_get_file_type (quicktime_t *file)
| Get the filetype.
quicktime_t * | lqt_open_read (const char *filename)
| Open a file for reading.
quicktime_t * | lqt_open_read_with_log (const char *filename, lqt_log_callback_t cb, void *log_data)
| Open a file for reading.
quicktime_t * | lqt_open_write (const char *filename, lqt_file_type_t type)
| Open a file for writing.
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.
void | lqt_set_max_riff_size (quicktime_t *file, int size)
| Set the segment size for ODML AVIs.

## 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:

  | path | A 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:

  | filename | A path to a regular file
  | rd | 1 for open readonly, 0 else
  | wr | 1 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_path | Existing non streamable file
  | out_path | Output 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:

  | file | A quicktime handle

int quicktime_dump | ( | quicktime_t * | file | ) |

Dump the file structures to stdout.

Parameters:

  | file | A 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:

  | file | A quicktime handle
  | 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 :)

void quicktime_set_avi | ( | quicktime_t * | file,
|  | int | value |
| ) |  |  |

Write an AVI file instead of quicktime.

Parameters:

  | file | A quicktime handle
  | 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.

int lqt_fileno | ( | quicktime_t * | file | ) |

Return the raw filedescriptor associated with the file.

Parameters:

  | file | A 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:

  | file | A 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:

  | file | A quicktime handle
  | track | index (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:

  | type | An 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:

  | file | A quicktime handle

Returns:
  The file type

quicktime_t* lqt_open_read | ( | const char * | filename | ) |

Open a file for reading.

Parameters:

  | filename | A 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:

  | filename | A path to a regular file
  | cb | Log callback
  | log_data | Data 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:

  | filename | A path to a regular file
  | 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_with_log | ( | const char * | filename,
|  | lqt_file_type_t | type,
|  | lqt_log_callback_t | cb,
|  | void * | log_data |
| ) |  |  |

Open a file for writing.

Parameters:

  | filename | A path to a regular file
  | type | The type of the file, you want to create
  | cb | Log callback
  | log_data | Data 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:

  | file | A quicktime handle
  | 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.