124#define ast_codec_register(codec) __ast_codec_register(codec, AST_MODULE_SELF)
unsigned int ast_codec_determine_length(const struct ast_codec *codec, unsigned int samples)
Get the length of media (in milliseconds) given a number of samples.
int __ast_codec_register(struct ast_codec *codec, struct ast_module *mod)
This function is used to register a codec with the Asterisk core. Registering allows it to be passed ...
ast_media_type
Types of media.
enum ast_media_type ast_media_type_from_str(const char *media_type_str)
Conversion function to take a media string and convert it to a media type.
int ast_codec_init(void)
Initialize codec support within the core.
struct ast_codec * ast_codec_get(const char *name, enum ast_media_type type, unsigned int sample_rate)
Retrieve a codec given a name, type, and sample rate.
unsigned int ast_codec_samples_count(struct ast_frame *frame)
Get the number of samples contained within a frame.
struct ast_codec * ast_codec_get_by_id(int id)
Retrieve a codec given the unique identifier.
const char * ast_codec_media_type2str(enum ast_media_type type)
Conversion function to take a media type and turn it into a string.
int ast_codec_get_max(void)
Retrieve the current maximum identifier for codec iteration.
int ast_codec_builtin_init(void)
Initialize built-in codecs within the core.
Represents a media codec within Asterisk.
unsigned int sample_rate
Sample rate (number of samples carried in a second)
unsigned int maximum_ms
Maximum length of media that can be carried (in milliseconds) in a frame.
unsigned int minimum_bytes
Length in bytes of the data payload of a minimum_ms frame.
unsigned int smoother_flags
Flags to be passed to the smoother.
unsigned int default_ms
Default length of media carried (in milliseconds) in a frame.
int(* samples_count)(struct ast_frame *frame)
Retrieve the number of samples in a frame.
enum ast_media_type type
Type of media this codec contains.
int(* get_length)(unsigned int samples)
Retrieve the length of media from number of samples.
unsigned int minimum_ms
Minimum length of media that can be carried (in milliseconds) in a frame.
const char * description
Brief description.
unsigned int quality
Format quality, on scale from 0 to 150 (100 is ulaw, the reference). This allows better format to be ...
unsigned int smooth
Whether the media can be smoothed or not.
struct ast_module * mod
The module that registered this codec.
const char * name
Name for this codec.
unsigned int id
Internal unique identifier for this codec, set at registration time (starts at 1)
Data structure associated with a single frame of data.