40 #define FORMAT_INTERFACE_BUCKETS 53 96 ast_log(
LOG_ERROR,
"Format interface for codec '%s' does not implement required callbacks\n", codec);
101 if (format_interface) {
102 ast_log(
LOG_ERROR,
"A format interface is already present for codec '%s'\n", codec);
107 format_interface =
ao2_alloc_options(
sizeof(*format_interface) + strlen(codec) + 1,
109 if (!format_interface) {
113 strcpy(format_interface->
codec, codec);
120 ast_verb(2,
"Registered format interface for codec '%s'\n", codec);
167 format->
name = format_name;
172 if (format_interface) {
205 if (format1 ==
NULL || format2 ==
NULL) {
209 if (format1 == format2) {
217 interface = format1->interface ? format1->interface : format2->interface;
219 if (interface && interface->format_cmp) {
220 return interface->format_cmp(format1, format2);
242 interface = format1->interface ? format1->interface : format2->interface;
245 return interface->format_get_joint(format1, format2);
254 if (format_interface) {
255 interface = format_interface->interface;
260 if (!interface || !interface->format_attribute_set) {
273 if (format_interface) {
274 interface = format_interface->interface;
279 if (!interface || !interface->format_attribute_get) {
283 return interface->format_attribute_get(format, name);
292 if (format_interface) {
293 interface = format_interface->interface;
298 if (!interface || !interface->format_parse_sdp_fmtp) {
302 return interface->format_parse_sdp_fmtp(format, attributes);
311 if (format_interface) {
312 interface = format_interface->interface;
317 if (!interface || !interface->format_generate_sdp_fmtp) {
321 interface->format_generate_sdp_fmtp(format, payload, str);
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.
Asterisk main include file. File version handling, generic pbx functions.
String manipulation functions.
#define AO2_STRING_FIELD_HASH_FN(stype, field)
Creates a hash function for a structure string field.
The arg parameter is a search key, but is not an object.
unsigned int id
Internal unique identifier for this codec, set at registration time (starts at 1) ...
Assume that the ao2_container is already locked.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_link_flags(container, obj, flags)
#define ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg)
Allocate and initialize an object.
#define ast_verb(level,...)
unsigned int default_ms
Default length of media carried (in milliseconds) in a frame.
#define SCOPED_AO2WRLOCK(varname, obj)
scoped lock specialization for ao2 write locks.
unsigned int maximum_ms
Maximum length of media that can be carried (in milliseconds) in a frame.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ao2_ref(o, delta)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
const char * description
Brief description.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
#define ast_module_shutdown_ref(mod)
Prevent unload of the module before shutdown.
#define ao2_find(container, arg, flags)
unsigned int sample_rate
Sample rate (number of samples carried in a second)
Support for logging to various files, console and syslog Configuration in file logger.conf.
#define AO2_STRING_FIELD_CMP_FN(stype, field)
Creates a compare function for a structure string field.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
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.
Asterisk module definitions.
static snd_pcm_format_t format
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.