libquicktime
Modules | Data Structures | Macros | Enumerations | Functions
Codec registry

Informations about installed codecs. More...

Modules

 Structures describing codec parameters
 Informations about supported codec parameters.
 

Data Structures

struct  lqt_image_size_t
 Image size. More...
 
struct  lqt_codec_info_s
 Structure describing a codec. More...
 

Macros

#define LQT_CODEC_OBSOLETE   (1<<24)
 compatibility flags contain this for obsolete/unmaintained codecs More...
 

Enumerations

enum  lqt_codec_type {
  LQT_CODEC_AUDIO,
  LQT_CODEC_VIDEO
}
 Type of a codec (Audio or video) More...
 
enum  lqt_codec_direction {
  LQT_DIRECTION_ENCODE,
  LQT_DIRECTION_DECODE,
  LQT_DIRECTION_BOTH
}
 Direction of the codec. More...
 

Functions

void lqt_registry_init ()
 Initialize the codec registry. More...
 
void lqt_registry_destroy ()
 Destroy the codec registry. More...
 
int lqt_get_num_audio_codecs ()
 Return the number of installed audio codecs. More...
 
int lqt_get_num_video_codecs ()
 Return the number of installed video codecs. More...
 
const lqt_codec_info_tlqt_get_audio_codec_info (int index)
 Return an audio codec. More...
 
const lqt_codec_info_tlqt_get_video_codec_info (int index)
 Return a video codec. More...
 
lqt_codec_info_t ** lqt_query_registry (int audio, int video, int encode, int decode)
 Return an array of any combination of audio/video en/decoders. More...
 
lqt_codec_info_t ** lqt_find_audio_codec (char *fourcc, int encode)
 Find an audio codec for a given fourcc. More...
 
lqt_codec_info_t ** lqt_find_audio_codec_by_wav_id (int wav_id, int encode)
 Find an audio codec for a given WAV ID. More...
 
lqt_codec_info_t ** lqt_find_video_codec (char *fourcc, int encode)
 Find a video codec for a given fourcc. More...
 
lqt_codec_info_t ** lqt_find_audio_codec_by_name (const char *name)
 Find an audio codec by its name. More...
 
lqt_codec_info_t ** lqt_find_video_codec_by_name (const char *name)
 Find a video codec by its name. More...
 
lqt_codec_info_t ** lqt_audio_codec_from_file (quicktime_t *file, int track)
 Get an audio codec from an open file. More...
 
lqt_codec_info_t ** lqt_video_codec_from_file (quicktime_t *file, int track)
 Get a video codec from an open file. More...
 
void lqt_destroy_codec_info (lqt_codec_info_t **info)
 Destroy a codec info array. More...
 
void lqt_reorder_audio_codecs (lqt_codec_info_t **codec_info)
 Reorder audio codecs. More...
 
void lqt_reorder_video_codecs (lqt_codec_info_t **codec_info)
 Reorder video codecs. More...
 
void lqt_set_default_parameter (lqt_codec_type type, int encode, const char *codec_name, const char *parameter_name, lqt_parameter_value_t *val)
 Change a default value for a codec parameter. More...
 
void lqt_restore_default_parameters (lqt_codec_info_t *codec_info, int encode, int decode)
 Restore a default parameter from the codec module. More...
 
void lqt_dump_codec_info (const lqt_codec_info_t *info)
 Dump a codec info to stderr. More...
 

Detailed Description

Informations about installed codecs.

One of the goals when forking libquicktime was to have a modular structure. Codecs were moved to plugins and were compiled according to the dependencies found by the configure script. As a result, a mechanism became necessary for finding informations about available codecs at runtime, their properties, supported parameters etc.

The codec parameters are defined in a way that GUI configuration dialogs can be built at runtime. An example for this is the libquicktime_config utility.

Libquicktime saves data of the codecs in the file .libquicktime_codecs in your home directory. This saves the long time needed for opening each codec module to see what's inside. The codec registry can be configured with the libquicktime_config program.

Macro Definition Documentation

◆ LQT_CODEC_OBSOLETE

#define LQT_CODEC_OBSOLETE   (1<<24)

compatibility flags contain this for obsolete/unmaintained codecs

Enumeration Type Documentation

◆ lqt_codec_type

Type of a codec (Audio or video)

◆ lqt_codec_direction

Direction of the codec.

Function Documentation

◆ lqt_registry_init()

void lqt_registry_init ( )

Initialize the codec registry.

Under normal circumstances, you never need to call this function, since the registry is always initialized on demand.

◆ lqt_registry_destroy()

void lqt_registry_destroy ( )

Destroy the codec registry.

This frees memory for the whole codec database. It is normally called automatically, but you will need to call it exclicitely, if you want to reinitialize the codec registry at runtime

◆ lqt_get_num_audio_codecs()

int lqt_get_num_audio_codecs ( )

Return the number of installed audio codecs.

Returns
Number of installed audio codecs

This function is obsolete, use lqt_query_registry instead

◆ lqt_get_num_video_codecs()

int lqt_get_num_video_codecs ( )

Return the number of installed video codecs.

Returns
Number of installed video codecs

This function is obsolete, use lqt_query_registry instead

◆ lqt_get_audio_codec_info()

const lqt_codec_info_t* lqt_get_audio_codec_info ( int  index)

Return an audio codec.

Parameters
indexIndex of the codec
Returns
Pointer to the codec info in the internal database

This function is obsolete, use lqt_query_registry instead

◆ lqt_get_video_codec_info()

const lqt_codec_info_t* lqt_get_video_codec_info ( int  index)

Return a video codec.

Parameters
indexIndex of the codec
Returns
Pointer to the codec info in the internal database

This function is obsolete, use lqt_query_registry instead

◆ lqt_query_registry()

lqt_codec_info_t** lqt_query_registry ( int  audio,
int  video,
int  encode,
int  decode 
)

Return an array of any combination of audio/video en/decoders.

Parameters
audioSet this to 1 if you want audio codecs to be returned
videoSet this to 1 if you want video codecs to be returned
encodeSet this to 1 if you want encoders to be returned
decodeSet this to 1 if you want decoders to be returned
Returns
A NULL terminated array of codec infos.

This function copies the codec infos. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_find_audio_codec()

lqt_codec_info_t** lqt_find_audio_codec ( char *  fourcc,
int  encode 
)

Find an audio codec for a given fourcc.

Parameters
fourccA four character code
encodeSet to 1 to return encoders, 0 to return decoders
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_find_audio_codec_by_wav_id()

lqt_codec_info_t** lqt_find_audio_codec_by_wav_id ( int  wav_id,
int  encode 
)

Find an audio codec for a given WAV ID.

Parameters
wav_idA 16 bit audio codec ID as found in WAV and AVI files
encodeSet to 1 to return encoders, 0 to return decoders
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_find_video_codec()

lqt_codec_info_t** lqt_find_video_codec ( char *  fourcc,
int  encode 
)

Find a video codec for a given fourcc.

Parameters
fourccA four character code
encodeSet to 1 to return encoders, 0 to return decoders
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_find_audio_codec_by_name()

lqt_codec_info_t** lqt_find_audio_codec_by_name ( const char *  name)

Find an audio codec by its name.

Parameters
nameShort name of the codec (see lqt_codec_info_s)
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_find_video_codec_by_name()

lqt_codec_info_t** lqt_find_video_codec_by_name ( const char *  name)

Find a video codec by its name.

Parameters
nameShort name of the codec (see lqt_codec_info_s)
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_audio_codec_from_file()

lqt_codec_info_t** lqt_audio_codec_from_file ( quicktime_t file,
int  track 
)

Get an audio codec from an open file.

Parameters
fileA quicktime handle
trackIndex if the track (starting with 0)
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_video_codec_from_file()

lqt_codec_info_t** lqt_video_codec_from_file ( quicktime_t file,
int  track 
)

Get a video codec from an open file.

Parameters
fileA quicktime handle
trackIndex if the track (starting with 0)
Returns
A NULL terminated array containing one codec info if the codec was found

This function copies the codec info. Use lqt_destroy_codec_info to free the returned array.

◆ lqt_destroy_codec_info()

void lqt_destroy_codec_info ( lqt_codec_info_t **  info)

Destroy a codec info array.

Parameters
infoA NULL terminated array of codec infos returned by one of the query functions.

Destroys a NULL terminared codec info structure returned by any of the query functions and frees all associated memory.

◆ lqt_reorder_audio_codecs()

void lqt_reorder_audio_codecs ( lqt_codec_info_t **  codec_info)

Reorder audio codecs.

Parameters
codec_infoA NULL terminated array of codec infos

The codec order is important if there is more than one codec available for a given fourcc. In this case, the first one will be used. You can simply call lqt_query_registry for getting audio codecs, reorder the returned array and pass this to the functions below.

◆ lqt_reorder_video_codecs()

void lqt_reorder_video_codecs ( lqt_codec_info_t **  codec_info)

Reorder video codecs.

Parameters
codec_infoA NULL terminated array of codec infos

The codec order is important if there is more than one codec available for a given fourcc. In this case, the first one will be used. You can simply call lqt_query_registry for getting video codecs, reorder the returned array and pass this to the functions below.

◆ lqt_set_default_parameter()

void lqt_set_default_parameter ( lqt_codec_type  type,
int  encode,
const char *  codec_name,
const char *  parameter_name,
lqt_parameter_value_t val 
)

Change a default value for a codec parameter.

Parameters
typeThe type of the codec (audio or video)
encode1 for encode parameter, 0 for decode parameter
codec_nameThe short name of the codec
parameter_nameThe short name of the parameter to change
valThe new value for the parameter

This stores a new default parameter value in the codec registry. It will become the new default for all files, you open after. This will also be saved in $HOME/.libquicktime_config.

◆ lqt_restore_default_parameters()

void lqt_restore_default_parameters ( lqt_codec_info_t codec_info,
int  encode,
int  decode 
)

Restore a default parameter from the codec module.

Parameters
codec_infoA codec info referring to the codec
encodeSet this to 1 to restore encoding parameters, 0 else
decodeSet this to 1 to restore decoding parameters, 0 else

This will revert previous calls to lqt_set_default_parameter by loading the module and getting the hardcoded values.

◆ lqt_dump_codec_info()

void lqt_dump_codec_info ( const lqt_codec_info_t info)

Dump a codec info to stderr.

Parameters
infoA codec info

Dump a human readable description of the codec info to stderr. For testing and debugging only.