Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Data Fields
ast_format_interface Struct Reference

Optional format interface to extend format operations. More...

#include <format.h>

Collaboration diagram for ast_format_interface:
Collaboration graph
[legend]

Data Fields

const void *(*const format_attribute_get )(const struct ast_format *format, const char *name)
 Retrieve a particular format attribute setting. More...
 
struct ast_format *(*const format_attribute_set )(const struct ast_format *format, const char *name, const char *value)
 Set an attribute on a format. More...
 
int(*const format_clone )(const struct ast_format *src, struct ast_format *dst)
 Callback for when the format is cloned, used to clone attributes. More...
 
enum ast_format_cmp_res(*const format_cmp )(const struct ast_format *format1, const struct ast_format *format2)
 Determine if format 1 is a subset of format 2. More...
 
void(*const format_destroy )(struct ast_format *format)
 Callback for when the format is destroyed, used to release attribute resources. More...
 
void(*const format_generate_sdp_fmtp )(const struct ast_format *format, unsigned int payload, struct ast_str **str)
 Generate SDP attribute information from an ast_format structure. More...
 
struct ast_format *(*const format_get_joint )(const struct ast_format *format1, const struct ast_format *format2)
 Get a format with the joint compatible attributes of both provided formats. More...
 
struct ast_format *(*const format_parse_sdp_fmtp )(const struct ast_format *format, const char *attributes)
 Parse SDP attribute information, interpret it, and store it in the format structure. More...
 

Detailed Description

Optional format interface to extend format operations.

Definition at line 44 of file format.h.

Field Documentation

◆ format_attribute_get

const void*(* const format_attribute_get) (const struct ast_format *format, const char *name)

Retrieve a particular format attribute setting.

Since
13.6.0
Parameters
formatThe format containing attributes
nameThe name of the attribute to retrieve
Return values
NULLif the parameter is not set on the format
non-NULLthe format attribute value

Definition at line 134 of file format.h.

Referenced by ast_format_attribute_get().

◆ format_attribute_set

struct ast_format*(* const format_attribute_set) (const struct ast_format *format, const char *name, const char *value)

Set an attribute on a format.

Parameters
nameThe name of the attribute
valueThe value of the attribute
Return values
non-NULLsuccess
NULLfailure

Definition at line 61 of file format.h.

Referenced by ast_format_attribute_set().

◆ format_clone

int(*const format_clone) (const struct ast_format *src, struct ast_format *dst)

Callback for when the format is cloned, used to clone attributes.

Parameters
srcSource format of attributes
dstDestination format for attributes
Return values
0success
-1failure

Definition at line 61 of file format.h.

Referenced by __ast_format_interface_register(), and ast_format_clone().

◆ format_cmp

enum ast_format_cmp_res(* const format_cmp) (const struct ast_format *format1, const struct ast_format *format2)

Determine if format 1 is a subset of format 2.

Parameters
format1First format to compare
format2Second format which the first is compared against
Returns
ast_format_cmp_res representing the result of comparing format1 and format2.

Definition at line 61 of file format.h.

◆ format_destroy

void(*const format_destroy) (struct ast_format *format)

Callback for when the format is destroyed, used to release attribute resources.

Parameters
formatThe format structure to destroy

Definition at line 50 of file format.h.

Referenced by __ast_format_interface_register().

◆ format_generate_sdp_fmtp

void(* const format_generate_sdp_fmtp) (const struct ast_format *format, unsigned int payload, struct ast_str **str)

Generate SDP attribute information from an ast_format structure.

Parameters
formatThe format containing attributes
payloadThe payload number to place into the fmtp line
strThe generated fmtp line
Note
This callback should generate a full fmtp line using the provided payload number.

Definition at line 121 of file format.h.

Referenced by ast_format_generate_sdp_fmtp().

◆ format_get_joint

struct ast_format*(* const format_get_joint) (const struct ast_format *format1, const struct ast_format *format2)

Get a format with the joint compatible attributes of both provided formats.

Parameters
format1The first format
format2The second format
Return values
non-NULLif joint format
NULLif no joint format
Note
The returned format has its reference count incremented and must be released using ao2_ref or ao2_cleanup.

Definition at line 61 of file format.h.

◆ format_parse_sdp_fmtp

struct ast_format*(* const format_parse_sdp_fmtp) (const struct ast_format *format, const char *attributes)

Parse SDP attribute information, interpret it, and store it in the format structure.

Parameters
formatFormat to set attributes on
attributesA string containing only the attributes from the fmtp line
Return values
non-NULLSuccess, values were valid
NULLFailure, some values were not acceptable

Definition at line 61 of file format.h.

Referenced by ast_format_parse_sdp_fmtp().


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