Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
ast_codec Struct Reference

Represents a media codec within Asterisk. More...

#include <codec.h>

Collaboration diagram for ast_codec:
Collaboration graph
[legend]

Data Fields

unsigned int default_ms
 Default length of media carried (in milliseconds) in a frame. More...
 
const char * description
 Brief description. More...
 
int(* get_length )(unsigned int samples)
 Retrieve the length of media from number of samples. More...
 
unsigned int id
 Internal unique identifier for this codec, set at registration time (starts at 1) More...
 
unsigned int maximum_ms
 Maximum length of media that can be carried (in milliseconds) in a frame. More...
 
unsigned int minimum_bytes
 Length in bytes of the data payload of a minimum_ms frame. More...
 
unsigned int minimum_ms
 Minimum length of media that can be carried (in milliseconds) in a frame. More...
 
struct ast_modulemod
 The module that registered this codec. More...
 
const char * name
 Name for this codec. More...
 
unsigned int sample_rate
 Sample rate (number of samples carried in a second) More...
 
int(* samples_count )(struct ast_frame *frame)
 Retrieve the number of samples in a frame. More...
 
unsigned int smooth
 Whether the media can be smoothed or not. More...
 
unsigned int smoother_flags
 Flags to be passed to the smoother. More...
 
enum ast_media_type type
 Type of media this codec contains. More...
 

Detailed Description

Represents a media codec within Asterisk.

Definition at line 42 of file codec.h.

Field Documentation

◆ default_ms

unsigned int default_ms

Default length of media carried (in milliseconds) in a frame.

Definition at line 58 of file codec.h.

Referenced by ast_format_get_default_ms().

◆ description

const char* description

◆ get_length

int(* get_length) (unsigned int samples)

Retrieve the length of media from number of samples.

Parameters
samplesThe number of samples
Returns
The length of media in milliseconds

Definition at line 76 of file codec.h.

Referenced by ast_codec_determine_length().

◆ id

unsigned int id

Internal unique identifier for this codec, set at registration time (starts at 1)

Definition at line 44 of file codec.h.

Referenced by __ast_codec_register_with_format(), add_codec2index(), ast_format_compatibility_codec2bitfield(), ast_format_get_codec_id(), codec2index(), codec_id_cmp(), Model::load(), show_codec(), and show_codecs().

◆ maximum_ms

unsigned int maximum_ms

Maximum length of media that can be carried (in milliseconds) in a frame.

Definition at line 56 of file codec.h.

Referenced by ast_format_get_maximum_ms().

◆ minimum_bytes

unsigned int minimum_bytes

Length in bytes of the data payload of a minimum_ms frame.

Definition at line 60 of file codec.h.

Referenced by ast_format_get_minimum_bytes().

◆ minimum_ms

unsigned int minimum_ms

Minimum length of media that can be carried (in milliseconds) in a frame.

Definition at line 54 of file codec.h.

Referenced by ast_format_get_minimum_ms().

◆ mod

struct ast_module* mod

The module that registered this codec.

Definition at line 82 of file codec.h.

Referenced by codec_dtor().

◆ name

const char* name

◆ sample_rate

unsigned int sample_rate

◆ samples_count

int(* samples_count) (struct ast_frame *frame)

Retrieve the number of samples in a frame.

Parameters
frameThe frame to examine
Returns
the number of samples

Definition at line 68 of file codec.h.

Referenced by ast_codec_samples_count().

◆ smooth

unsigned int smooth

Whether the media can be smoothed or not.

Definition at line 78 of file codec.h.

Referenced by ast_format_can_be_smoothed().

◆ smoother_flags

unsigned int smoother_flags

Flags to be passed to the smoother.

Definition at line 80 of file codec.h.

Referenced by ast_format_get_smoother_flags().

◆ type

enum ast_media_type type

The documentation for this struct was generated from the following file: