122 #define ast_codec_register(codec) __ast_codec_register(codec, AST_MODULE_SELF) int ast_codec_builtin_init(void)
Initialize built-in codecs within the core.
unsigned int smoother_flags
Flags to be passed to the smoother.
unsigned int minimum_bytes
Length in bytes of the data payload of a minimum_ms frame.
const char * name
Name for this codec.
struct ast_codec * ast_codec_get_by_id(int id)
Retrieve a codec given the unique identifier.
unsigned int id
Internal unique identifier for this codec, set at registration time (starts at 1) ...
const char * ast_codec_media_type2str(enum ast_media_type type)
Conversion function to take a media type and turn it into a string.
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.
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.
struct ast_module * mod
The module that registered this codec.
unsigned int default_ms
Default length of media carried (in milliseconds) in a frame.
int ast_codec_init(void)
Initialize codec support within the core.
int ast_codec_get_max(void)
Retrieve the current maximum identifier for codec iteration.
unsigned int maximum_ms
Maximum length of media that can be carried (in milliseconds) in a frame.
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 ...
unsigned int ast_codec_samples_count(struct ast_frame *frame)
Get the number of samples contained within a frame.
const char * description
Brief description.
int(* get_length)(unsigned int samples)
Retrieve the length of media from number of samples.
unsigned int sample_rate
Sample rate (number of samples carried in a second)
int(* samples_count)(struct ast_frame *frame)
Retrieve the number of samples in a frame.
Data structure associated with a single frame of data.
enum ast_media_type type
Type of media this codec contains.
unsigned int smooth
Whether the media can be smoothed or not.
ast_media_type
Types of media.
unsigned int minimum_ms
Minimum length of media that can be carried (in milliseconds) in a frame.
Represents a media codec within Asterisk.
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.