Asterisk - The Open Source Telephony Project GIT-master-0bf3178
|
Format Capabilities API. More...
#include "asterisk.h"
#include "asterisk/logger.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/format_cache.h"
#include "asterisk/codec.h"
#include "asterisk/astobj2.h"
#include "asterisk/strings.h"
#include "asterisk/vector.h"
#include "asterisk/linkedlists.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
struct | ast_format_cap |
Format capabilities structure, holds formats + preference order + etc. More... | |
struct | format_cap_framed |
Structure used for capability formats, adds framing. More... | |
struct | format_cap_framed_list |
Linked list for formats. More... | |
Macros | |
#define | FORMAT_CAP_FRAMED_ELEM_CLEANUP(elem) ao2_cleanup((elem)) |
format_cap_framed vector element cleanup. More... | |
#define | FORMAT_CAP_FRAMED_ELEM_CMP(elem, value) ((elem)->format == (value)) |
format_cap_framed comparator for AST_VECTOR_REMOVE_CMP_ORDERED() More... | |
Functions | |
struct ast_format_cap * | __ast_format_cap_alloc (enum ast_format_cap_flags flags, const char *tag, const char *file, int line, const char *func) |
int | __ast_format_cap_append (struct ast_format_cap *cap, struct ast_format *format, unsigned int framing, const char *tag, const char *file, int line, const char *func) |
static const char * | __ast_format_cap_get_names (const struct ast_format_cap *cap, struct ast_str **buf, int append) |
int | ast_format_cap_append_by_type (struct ast_format_cap *cap, enum ast_media_type type) |
Add all codecs Asterisk knows about for a specific type to the capabilities structure. More... | |
int | ast_format_cap_append_from_cap (struct ast_format_cap *dst, const struct ast_format_cap *src, enum ast_media_type type) |
Append the formats of provided type in src to dst. More... | |
const char * | ast_format_cap_append_names (const struct ast_format_cap *cap, struct ast_str **buf) |
Append the names of codecs of a set of formats to an ast_str buffer. More... | |
size_t | ast_format_cap_count (const struct ast_format_cap *cap) |
Get the number of formats present within the capabilities structure. More... | |
int | ast_format_cap_empty (const struct ast_format_cap *cap) |
Determine if a format cap has no formats in it. More... | |
struct ast_format * | ast_format_cap_get_best_by_type (const struct ast_format_cap *cap, enum ast_media_type type) |
Get the most preferred format for a particular media type. More... | |
int | ast_format_cap_get_compatible (const struct ast_format_cap *cap1, const struct ast_format_cap *cap2, struct ast_format_cap *result) |
Find the compatible formats between two capabilities structures. More... | |
struct ast_format * | ast_format_cap_get_compatible_format (const struct ast_format_cap *cap, const struct ast_format *format) |
Find if input ast_format is within the capabilities of the ast_format_cap object then return the compatible format from the capabilities structure in the result. More... | |
struct ast_format * | ast_format_cap_get_format (const struct ast_format_cap *cap, int position) |
Get the format at a specific index. More... | |
unsigned int | ast_format_cap_get_format_framing (const struct ast_format_cap *cap, const struct ast_format *format) |
Get the framing for a format. More... | |
unsigned int | ast_format_cap_get_framing (const struct ast_format_cap *cap) |
Get the global framing. More... | |
const char * | ast_format_cap_get_names (const struct ast_format_cap *cap, struct ast_str **buf) |
Get the names of codecs of a set of formats. More... | |
int | ast_format_cap_has_type (const struct ast_format_cap *cap, enum ast_media_type type) |
Find out if the capabilities structure has any formats of a specific type. More... | |
int | ast_format_cap_identical (const struct ast_format_cap *cap1, const struct ast_format_cap *cap2) |
Determine if two capabilities structures are identical. More... | |
int | ast_format_cap_iscompatible (const struct ast_format_cap *cap1, const struct ast_format_cap *cap2) |
Determine if any joint capabilities exist between two capabilities structures. More... | |
enum ast_format_cmp_res | ast_format_cap_iscompatible_format (const struct ast_format_cap *cap, const struct ast_format *format) |
Find if ast_format is within the capabilities of the ast_format_cap object. More... | |
int | ast_format_cap_remove (struct ast_format_cap *cap, struct ast_format *format) |
Remove format capability from capability structure. More... | |
void | ast_format_cap_remove_by_type (struct ast_format_cap *cap, enum ast_media_type type) |
Remove all formats matching a specific format type. More... | |
void | ast_format_cap_replace_from_cap (struct ast_format_cap *dst, const struct ast_format_cap *src, enum ast_media_type type) |
Replace the formats of provided type in dst with equivalent formats from src. More... | |
void | ast_format_cap_set_framing (struct ast_format_cap *cap, unsigned int framing) |
Set the global framing. More... | |
int | ast_format_cap_update_by_allow_disallow (struct ast_format_cap *cap, const char *list, int allowing) |
Parse an "allow" or "deny" list and modify a format capabilities structure accordingly. More... | |
static void | format_cap_destroy (void *obj) |
Destructor for format capabilities structure. More... | |
static void | format_cap_framed_destroy (void *obj) |
Destructor for format capabilities framed structure. More... | |
static int | format_cap_framed_init (struct format_cap_framed *framed, struct ast_format_cap *cap, struct ast_format *format, unsigned int framing) |
static int | format_cap_init (struct ast_format_cap *cap, enum ast_format_cap_flags flags) |
Initialize values on an ast_format_cap. More... | |
static int | format_cap_replace (struct ast_format_cap *cap, struct ast_format *format, unsigned int framing) |
static int | format_in_format_cap (struct ast_format_cap *cap, struct ast_format *format) |
static int | internal_format_cap_identical (const struct ast_format_cap *cap1, const struct ast_format_cap *cap2) |
Variables | |
static const struct format_cap_framed_list | format_cap_framed_list_empty = AST_LIST_HEAD_NOLOCK_INIT_VALUE |
Dummy empty list for when we are inserting a new list. More... | |
Format Capabilities API.
Definition in file format_cap.c.
#define FORMAT_CAP_FRAMED_ELEM_CLEANUP | ( | elem | ) | ao2_cleanup((elem)) |
format_cap_framed vector element cleanup.
elem | Element to cleanup |
Definition at line 493 of file format_cap.c.
format_cap_framed comparator for AST_VECTOR_REMOVE_CMP_ORDERED()
elem | Element to compare against |
value | Value to compare with the vector element. |
0 | if element does not match. |
Non-zero | if element matches. |
Definition at line 486 of file format_cap.c.
struct ast_format_cap * __ast_format_cap_alloc | ( | enum ast_format_cap_flags | flags, |
const char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 117 of file format_cap.c.
References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_ref, make_ari_stubs::file, format_cap_destroy(), format_cap_init(), and NULL.
int __ast_format_cap_append | ( | struct ast_format_cap * | cap, |
struct ast_format * | format, | ||
unsigned int | framing, | ||
const char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 195 of file format_cap.c.
References __ao2_ref(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ast_assert, make_ari_stubs::file, format_cap_framed::format, format_cap_framed_destroy(), format_cap_framed_init(), format_in_format_cap(), format_cap_framed::framing, and NULL.
|
static |
Definition at line 700 of file format_cap.c.
References ast_format_get_name(), ast_str_append(), ast_str_buffer(), ast_str_set(), AST_VECTOR_GET, AST_VECTOR_SIZE, buf, format_cap_framed::format, and ast_format_cap::preference_order.
Referenced by ast_format_cap_append_names(), and ast_format_cap_get_names().
int ast_format_cap_append_by_type | ( | struct ast_format_cap * | cap, |
enum ast_media_type | type | ||
) |
Add all codecs Asterisk knows about for a specific type to the capabilities structure.
cap | The capabilities structure to add to. |
type | The type of formats to add. |
0 | success |
-1 | failure |
Definition at line 216 of file format_cap.c.
References ao2_cleanup, ao2_ref, ast_codec_get_by_id(), ast_codec_get_max(), ast_format_cache_get_by_codec(), ast_format_cap_append, ast_format_create(), ast_format_get_codec(), ast_format_none, AST_MEDIA_TYPE_UNKNOWN, ast_format::codec, codec2, id, NULL, type, and ast_codec::type.
Referenced by ast_ari_channels_create(), ast_format_cap_update_by_allow_disallow(), ast_local_init(), AST_TEST_DEFINE(), begin_dial_prerun(), load_module(), rec_request(), and register_channel_tech().
int ast_format_cap_append_from_cap | ( | struct ast_format_cap * | dst, |
const struct ast_format_cap * | src, | ||
enum ast_media_type | type | ||
) |
Append the formats of provided type in src to dst.
dst | The destination capabilities structure |
src | The source capabilities structure |
type | The type of formats to append. |
0 | success |
-1 | failure |
Definition at line 269 of file format_cap.c.
References ast_format_cap_append, ast_format_get_type(), AST_MEDIA_TYPE_UNKNOWN, AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, format_cap_framed::framing, ast_format_cap::preference_order, and type.
Referenced by ast_media_get_format_cap(), ast_sip_create_joint_call_cap(), ast_stream_clone(), ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), ast_stream_topology_get_formats_by_type(), AST_TEST_DEFINE(), build_device(), build_peer(), build_user(), chan_pjsip_get_codec(), chan_pjsip_new(), chan_pjsip_read_stream(), chan_rtp_get_codec(), channel_do_masquerade(), create_outgoing_sdp_stream(), func_channel_read(), jingle_alloc(), jingle_call(), jingle_interpret_content(), jingle_new(), load_module(), media_offer_write_av(), ooh323_alloc(), ooh323_get_codec(), ooh323_onReceivedSetup(), ooh323_request(), request_channel(), send_direct_media_request(), set_caps(), speech_engine_alloc_and_register(), unistim_line_copy(), unistim_new(), and unistim_request().
const char * ast_format_cap_append_names | ( | const struct ast_format_cap * | cap, |
struct ast_str ** | buf | ||
) |
Append the names of codecs of a set of formats to an ast_str buffer.
cap | The capabilities structure containing the formats |
buf | A ast_str buffer to append the names of the formats to |
buf
Definition at line 739 of file format_cap.c.
References __ast_format_cap_get_names(), and buf.
Referenced by ast_stream_create_resolved(), and ast_stream_to_str().
size_t ast_format_cap_count | ( | const struct ast_format_cap * | cap | ) |
Get the number of formats present within the capabilities structure.
cap | The capabilities structure |
Definition at line 395 of file format_cap.c.
References AST_VECTOR_SIZE, and ast_format_cap::preference_order.
Referenced by add_format_information_cb(), apply_cap_to_bundled(), ast_format_cap_empty(), ast_iax2_new(), ast_openvstream(), ast_rtp_instance_available_formats(), ast_rtp_lookup_mime_multiple2(), ast_stream_get_format_count(), ast_stream_topology_create_from_format_cap(), ast_stream_topology_equal(), AST_TEST_DEFINE(), ast_translate_available_formats(), ast_translator_best_choice(), begin_dial_prerun(), check_translation_path(), configure_local_rtp(), create_addr(), create_outgoing_sdp_stream(), derive_format_from_cap(), iax2_codec_pref_string(), iax2_format_compatibility_cap2bitfield(), iax2_parse_allow_disallow(), iax2_request(), jingle_add_payloads_to_description(), jingle_interpret_description(), jingle_new(), media_offer_read_av(), native_rtp_bridge_compatible_check(), ooh323_get_codec(), ooh323_write(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), send_direct_media_request(), set_caps(), show_sound_info_cb(), sip_session_refresh(), and unistim_new().
int ast_format_cap_empty | ( | const struct ast_format_cap * | cap | ) |
Determine if a format cap has no formats in it.
cap | The format cap to check for emptiness |
1 | The format cap has zero formats or only ast_format_none |
0 | The format cap has at least one format |
Definition at line 744 of file format_cap.c.
References ast_format_cap_count(), ast_format_none, AST_VECTOR_GET, and ast_format_cap::preference_order.
Referenced by ast_sip_create_joint_call_cap(), ast_stream_create_resolved(), ast_translator_best_choice(), chan_pjsip_new(), request_channel(), set_format(), and set_incoming_call_offer_cap().
struct ast_format * ast_format_cap_get_best_by_type | ( | const struct ast_format_cap * | cap, |
enum ast_media_type | type | ||
) |
Get the most preferred format for a particular media type.
cap | The capabilities structure |
type | The type of media to get |
non-NULL | the preferred format |
NULL | no media of type present |
Definition at line 417 of file format_cap.c.
References ao2_ref, ast_assert, ast_format_cap_get_format(), ast_format_get_type(), ast_format_none, AST_MEDIA_TYPE_UNKNOWN, AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, NULL, ast_format_cap::preference_order, and type.
Referenced by AST_TEST_DEFINE(), chan_pjsip_new(), set_caps(), set_format(), and sip_session_response_cb().
int ast_format_cap_get_compatible | ( | const struct ast_format_cap * | cap1, |
const struct ast_format_cap * | cap2, | ||
struct ast_format_cap * | result | ||
) |
Find the compatible formats between two capabilities structures.
cap1 | The first capabilities structure | |
cap2 | The second capabilities structure | |
[out] | result | The capabilities structure to place the results into |
0 | success |
-1 | failure |
Definition at line 628 of file format_cap.c.
References ao2_ref, ast_format_cap_append, ast_format_cap_get_compatible_format(), AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, format_cap_framed::framing, ast_format_cap::preference_order, and result.
Referenced by ast_sip_create_joint_call_cap(), ast_speech_new(), ast_stream_create_resolved(), AST_TEST_DEFINE(), ast_translator_best_choice(), create_outgoing_sdp_stream(), iax2_request(), jingle_interpret_description(), set_caps(), and sip_session_refresh().
struct ast_format * ast_format_cap_get_compatible_format | ( | const struct ast_format_cap * | cap, |
const struct ast_format * | format | ||
) |
Find if input ast_format is within the capabilities of the ast_format_cap object then return the compatible format from the capabilities structure in the result.
non-NULL | if format is compatible |
NULL | if not compatible |
Definition at line 546 of file format_cap.c.
References ao2_cleanup, ast_assert, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_codec_id(), ast_format_joint(), AST_LIST_TRAVERSE, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, format_cap_framed::format, ast_format_cap::formats, NULL, and result.
Referenced by ast_format_cap_get_compatible(), AST_TEST_DEFINE(), ast_translate_available_formats(), and codec_choose_from_prefs().
struct ast_format * ast_format_cap_get_format | ( | const struct ast_format_cap * | cap, |
int | position | ||
) |
Get the format at a specific index.
cap | The capabilities structure |
position | The position to get |
non-NULL | success |
NULL | failure |
Definition at line 400 of file format_cap.c.
References ao2_ref, ast_assert, ast_format_none, AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, NULL, and ast_format_cap::preference_order.
Referenced by add_format_information_cb(), apply_cap_to_bundled(), ast_format_cap_get_best_by_type(), ast_iax2_new(), ast_openvstream(), ast_rtp_lookup_mime_multiple2(), ast_sip_create_joint_call_cap(), ast_speech_new(), ast_stream_create_resolved(), AST_TEST_DEFINE(), ast_translate_available_formats(), ast_translator_best_choice(), ast_unreal_new_channels(), audiosocket_request(), chan_pjsip_new(), check_translation_path(), configure_local_rtp(), create_addr(), create_outgoing_sdp_stream(), derive_format_from_cap(), iax2_codec_pref_string(), iax2_format_compatibility_cap2bitfield(), iax2_parse_allow_disallow(), iax2_request(), internal_format_cap_identical(), jingle_add_payloads_to_description(), jingle_interpret_content(), jingle_new(), media_offer_read_av(), mp3_exec(), ooh323_new(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), set_caps(), show_sound_info_cb(), start_rtp(), and unistim_new().
unsigned int ast_format_cap_get_format_framing | ( | const struct ast_format_cap * | cap, |
const struct ast_format * | format | ||
) |
Get the framing for a format.
cap | The capabilities structure |
format | The format to retrieve |
Definition at line 443 of file format_cap.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_codec_id(), ast_format_get_default_ms(), AST_LIST_TRAVERSE, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, format_cap_framed::format, ast_format_cap::formats, format_cap_framed::framing, ast_format_cap::framing, NULL, and result.
Referenced by AST_TEST_DEFINE(), create_addr(), iax2_parse_allow_disallow(), native_rtp_bridge_compatible_check(), and ooh323c_set_capability_for_call().
unsigned int ast_format_cap_get_framing | ( | const struct ast_format_cap * | cap | ) |
Get the global framing.
cap | The capabilities structure. |
0 | if no formats are in the structure and no framing has been provided |
Definition at line 438 of file format_cap.c.
References ast_format_cap::framing.
Referenced by ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), AST_TEST_DEFINE(), configure_local_rtp(), create_outgoing_sdp_stream(), jingle_enable_video(), jingle_new(), and set_caps().
const char * ast_format_cap_get_names | ( | const struct ast_format_cap * | cap, |
struct ast_str ** | buf | ||
) |
Get the names of codecs of a set of formats.
cap | The capabilities structure containing the formats |
buf | A ast_str buffer to populate with the names of the formats |
buf
Definition at line 734 of file format_cap.c.
References __ast_format_cap_get_names(), and buf.
Referenced by ast_channel_nativeformats_set(), ast_streamfile(), AST_TEST_DEFINE(), ast_write_stream(), chan_pjsip_get_codec(), chan_pjsip_set_rtp_peer(), chan_pjsip_write_stream(), chan_rtp_get_codec(), codec_handler_fn(), compatible_formats_exist(), console_request(), func_channel_read(), generate_status(), handle_cli_core_show_channeltype(), handle_cli_ooh323_show_config(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_users(), handle_showchan(), iax2_getformatname_multiple(), iax2_request(), jingle_write(), local_request_with_stream_topology(), log_caps(), mbl_request(), native_rtp_bridge_compatible_check(), onNewCallCreated(), ooh323_request(), ooh323_set_write_format(), ooh323_write(), request_channel(), serialize_showchan(), set_caps(), set_format(), socket_process_helper(), start_rtp(), test_create_joint(), unistim_new(), unistim_request(), unistim_rtp_read(), unistim_show_info(), and unistim_write().
int ast_format_cap_has_type | ( | const struct ast_format_cap * | cap, |
enum ast_media_type | type | ||
) |
Find out if the capabilities structure has any formats of a specific type.
1 | true |
0 | false, no formats of specific type. |
Definition at line 613 of file format_cap.c.
References ast_format_get_type(), AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, ast_format_cap::preference_order, and type.
Referenced by ast_bridge_update_talker_src_video_mode(), ast_channel_make_compatible_helper(), ast_openstream_full(), ast_openvstream(), ast_sendtext_data(), ast_stream_topology_create_from_format_cap(), AST_TEST_DEFINE(), jingle_enable_video(), jingle_request(), negotiate_incoming_sdp_stream(), and ooh323_request().
int ast_format_cap_identical | ( | const struct ast_format_cap * | cap1, |
const struct ast_format_cap * | cap2 | ||
) |
Determine if two capabilities structures are identical.
cap1 | The first capabilities structure |
cap2 | The second capabilities structure |
0 | capabilities are not identical |
1 | capabilities are identical |
Definition at line 687 of file format_cap.c.
References AST_VECTOR_SIZE, internal_format_cap_identical(), and ast_format_cap::preference_order.
Referenced by ast_stream_topology_equal(), AST_TEST_DEFINE(), load_engine(), and send_direct_media_request().
int ast_format_cap_iscompatible | ( | const struct ast_format_cap * | cap1, |
const struct ast_format_cap * | cap2 | ||
) |
Determine if any joint capabilities exist between two capabilities structures.
cap1 | The first capabilities structure |
cap2 | The second capabilities structure |
0 | no joint capabilities exist |
1 | joint capabilities exist |
Definition at line 653 of file format_cap.c.
References ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, and ast_format_cap::preference_order.
Referenced by ast_openvstream(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), AST_TEST_DEFINE(), compatible_formats_exist(), console_request(), native_rtp_bridge_compatible_check(), and unistim_request().
enum ast_format_cmp_res ast_format_cap_iscompatible_format | ( | const struct ast_format_cap * | cap, |
const struct ast_format * | format | ||
) |
Find if ast_format is within the capabilities of the ast_format_cap object.
Definition at line 581 of file format_cap.c.
References ast_assert, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_codec_id(), AST_LIST_TRAVERSE, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, format_cap_framed::format, ast_format_cap::formats, and NULL.
Referenced by ast_format_cap_iscompatible(), ast_speech_new(), AST_TEST_DEFINE(), chan_pjsip_indicate(), chan_pjsip_read_stream(), chan_pjsip_write_stream(), check_translation_path(), internal_format_cap_identical(), is_compatible_format(), jingle_read(), jingle_write(), mbl_request(), ooh323_rtp_read(), ooh323_write(), start_rtp(), unistim_rtp_read(), and unistim_write().
int ast_format_cap_remove | ( | struct ast_format_cap * | cap, |
struct ast_format * | format | ||
) |
Remove format capability from capability structure.
0 | remove was successful |
-1 | remove failed. Could not find format to remove |
Definition at line 495 of file format_cap.c.
References ast_assert, ast_format_get_codec_id(), AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_VECTOR_GET_ADDR, AST_VECTOR_REMOVE_CMP_ORDERED, AST_VECTOR_SIZE, format_cap_framed::format, FORMAT_CAP_FRAMED_ELEM_CLEANUP, FORMAT_CAP_FRAMED_ELEM_CMP, ast_format_cap::formats, NULL, and ast_format_cap::preference_order.
Referenced by ast_format_cap_update_by_allow_disallow(), AST_TEST_DEFINE(), and check_translation_path().
void ast_format_cap_remove_by_type | ( | struct ast_format_cap * | cap, |
enum ast_media_type | type | ||
) |
Remove all formats matching a specific format type.
cap | The capabilities structure |
type | The media type to remove formats of |
Definition at line 523 of file format_cap.c.
References ao2_ref, ast_format_get_type(), AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_MEDIA_TYPE_UNKNOWN, AST_VECTOR_GET_ADDR, AST_VECTOR_REMOVE_CMP_ORDERED, AST_VECTOR_SIZE, format_cap_framed::format, FORMAT_CAP_FRAMED_ELEM_CLEANUP, FORMAT_CAP_FRAMED_ELEM_CMP, ast_format_cap::formats, ast_format_cap::preference_order, and type.
Referenced by action_originate(), ast_format_cap_update_by_allow_disallow(), ast_rtp_codecs_payload_formats(), ast_sip_create_joint_call_cap(), ast_stream_create_resolved(), AST_TEST_DEFINE(), chan_pjsip_read_stream(), get_codecs(), jingle_interpret_description(), media_offer_write_av(), originate_exec(), reload_config(), request_channel(), send_direct_media_request(), and set_caps().
void ast_format_cap_replace_from_cap | ( | struct ast_format_cap * | dst, |
const struct ast_format_cap * | src, | ||
enum ast_media_type | type | ||
) |
Replace the formats of provided type in dst with equivalent formats from src.
dst | The destination capabilities structure |
src | The source capabilities structure |
type | The type of formats to replace. |
Definition at line 306 of file format_cap.c.
References ast_format_get_type(), AST_MEDIA_TYPE_UNKNOWN, AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, format_cap_replace(), format_cap_framed::framing, ast_format_cap::preference_order, and type.
Referenced by AST_TEST_DEFINE().
void ast_format_cap_set_framing | ( | struct ast_format_cap * | cap, |
unsigned int | framing | ||
) |
Set the global framing.
cap | The capabilities structure. |
framing | The framing value (in milliseconds). |
ast_format_cap
structure may override this value, if the framing they require is less than the value set by this function. Definition at line 136 of file format_cap.c.
References ast_format_cap::framing.
Referenced by ast_rtp_codecs_payload_formats(), ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), AST_TEST_DEFINE(), get_codecs(), and ooh323_set_write_format().
int ast_format_cap_update_by_allow_disallow | ( | struct ast_format_cap * | cap, |
const char * | list, | ||
int | allowing | ||
) |
Parse an "allow" or "deny" list and modify a format capabilities structure accordingly.
cap | The capabilities structure to modify |
list | The list containing formats to append or remove |
allowing | If zero, start removing formats specified in the list. If non-zero, start appending formats specified in the list. |
0 | on success |
-1 | on failure |
Definition at line 320 of file format_cap.c.
References ao2_cleanup, ast_debug, ast_format_cache_get, ast_format_cap_append, ast_format_cap_append_by_type(), ast_format_cap_remove(), ast_format_cap_remove_by_type(), ast_log, AST_MEDIA_TYPE_UNKNOWN, ast_strdupa, ast_strip(), ast_strlen_zero(), LOG_WARNING, NULL, and strsep().
Referenced by action_originate(), AST_TEST_DEFINE(), build_peer(), build_user(), codec_handler_fn(), iax2_parse_allow_disallow(), media_offer_write_av(), originate_exec(), parse_line(), reload_config(), and test_create_joint().
|
static |
Destructor for format capabilities structure.
Definition at line 70 of file format_cap.c.
References ao2_ref, AST_LIST_REMOVE_HEAD, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, ast_format_cap::formats, and ast_format_cap::preference_order.
Referenced by __ast_format_cap_alloc().
|
static |
Destructor for format capabilities framed structure.
Definition at line 142 of file format_cap.c.
References ao2_cleanup, and format_cap_framed::format.
Referenced by __ast_format_cap_append().
|
inlinestatic |
Definition at line 149 of file format_cap.c.
References ao2_ref, ast_format_get_codec_id(), ast_format_get_default_ms(), AST_LIST_INSERT_HEAD, AST_VECTOR_APPEND, AST_VECTOR_GET_ADDR, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, format_cap_framed_list_empty, ast_format_cap::formats, format_cap_framed::framing, ast_format_cap::framing, MIN, and ast_format_cap::preference_order.
Referenced by __ast_format_cap_append().
|
inlinestatic |
Initialize values on an ast_format_cap.
cap | ast_format_cap to initialize |
flags | Unused. |
0 | Success |
-1 | Failure |
Definition at line 102 of file format_cap.c.
References AST_VECTOR_INIT, ast_format_cap::formats, ast_format_cap::framing, and ast_format_cap::preference_order.
Referenced by __ast_format_cap_alloc().
|
static |
Definition at line 286 of file format_cap.c.
References ao2_t_replace, ast_assert, ast_format_get_codec_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, format_cap_framed::framing, NULL, and ast_format_cap::preference_order.
Referenced by ast_format_cap_replace_from_cap().
|
static |
Definition at line 179 of file format_cap.c.
References ast_format_get_codec_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, format_cap_framed::format, and ast_format_cap::preference_order.
Referenced by __ast_format_cap_append().
|
static |
Definition at line 668 of file format_cap.c.
References ao2_ref, ast_format_cap_get_format(), ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_EQUAL, AST_VECTOR_SIZE, ast_format_cap::preference_order, and tmp().
Referenced by ast_format_cap_identical().
|
static |
Dummy empty list for when we are inserting a new list.
Definition at line 67 of file format_cap.c.
Referenced by format_cap_framed_init().