Asterisk - The Open Source Telephony Project
18.5.0
|
Format Capabilities API. More...
#include "asterisk/codec.h"
Go to the source code of this file.
Macros | |
#define | ast_format_cap_alloc(flags) |
#define | ast_format_cap_append(cap, format, framing) |
#define | AST_FORMAT_CAP_NAMES_LEN 384 |
#define | ast_t_format_cap_alloc(flags, tag) __ast_format_cap_alloc((flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ast_t_format_cap_append(cap, format, framing, tag) |
Enumerations | |
enum | ast_format_cap_flags { AST_FORMAT_CAP_FLAG_DEFAULT = 0 } |
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) |
Allocate a new ast_format_cap structure. More... | |
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) |
Add format capability to capabilities structure. More... | |
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... | |
Format Capabilities API.
Definition in file format_cap.h.
#define ast_format_cap_alloc | ( | flags | ) |
Definition at line 52 of file format_cap.h.
Referenced by __ast_channel_alloc_ap(), __sip_alloc(), action_originate(), add_sdp(), alloc_playback_chan(), announce_to_dial(), ari_channels_handle_originate_with_id(), ast_ari_channels_create(), ast_iax2_new(), ast_local_init(), ast_media_get_format_cap(), ast_openstream_full(), ast_openvstream(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_set_read_format(), ast_set_write_format(), ast_set_write_format_interleaved_stereo(), ast_sip_create_joint_call_cap(), ast_sip_endpoint_alloc(), ast_sip_session_alloc(), ast_speech_new(), ast_stream_alloc(), ast_stream_clone(), ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), ast_stream_topology_get_formats_by_type(), AST_TEST_DEFINE(), ast_translator_best_choice(), audiosocket_request(), begin_dial_prerun(), build_conf(), build_gateway(), build_peer(), build_topology(), build_user(), cb_events(), chan_pjsip_new(), chan_pjsip_read_stream(), channel_do_masquerade(), check_peer_ok(), conf_run(), conf_start_record(), console_new(), create_outgoing_sdp_stream(), dahdi_new(), do_notify(), func_channel_read(), generic_recall(), handle_capabilities_res_message(), handle_speechcreate(), iax2_codec_choose(), iax2_codec_pref_string(), iax2_getformatname_multiple(), iax2_parse_allow_disallow(), iax2_request(), jingle_alloc(), jingle_endpoint_alloc(), jingle_interpret_content(), jingle_new(), jingle_read(), load_module(), local_request_with_stream_topology(), make_channel(), media_offer_write_av(), media_variant_alloc(), mgcp_new(), mgcp_rtp_read(), misdn_new(), multicast_rtp_request(), native_rtp_bridge_compatible_check(), native_rtp_bridge_start(), new_outgoing(), ooh323_alloc(), ooh323_new(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_write_format(), orig_app(), orig_exten(), originate_exec(), phone_new(), prepare_bridge_media_channel(), prepare_bridge_moh_channel(), process_sdp(), rec_request(), recalling_enter(), register_channel_tech(), request_channel(), retransfer_enter(), set_caps(), set_format(), set_incoming_call_offer_cap(), set_test_formats(), sip_new(), sip_rtp_read(), sip_session_refresh(), skinny_device_alloc(), skinny_line_alloc(), skinny_new(), skinny_rtp_read(), socket_process_helper(), stasis_app_control_snoop(), t38_create_media_state(), temp_peer(), test_create_joint(), test_item_alloc(), try_suggested_sip_codec(), unicast_rtp_request(), unistim_line_alloc(), unistim_new(), unistim_rtp_read(), and validate_stream().
#define ast_format_cap_append | ( | cap, | |
format, | |||
framing | |||
) |
Definition at line 103 of file format_cap.h.
Referenced by __ast_channel_alloc_ap(), action_originate(), add_sdp(), alloc_playback_chan(), announce_to_dial(), ari_channels_handle_originate_with_id(), ast_ari_channels_create(), ast_format_cap_append_by_type(), ast_format_cap_append_from_cap(), ast_format_cap_get_compatible(), ast_format_cap_update_by_allow_disallow(), ast_rtp_codecs_payload_formats(), ast_set_read_format(), ast_set_write_format(), ast_set_write_format_interleaved_stereo(), ast_sip_create_joint_call_cap(), ast_stream_create_resolved(), AST_TEST_DEFINE(), ast_translate_available_formats(), audiosocket_request(), build_conf(), cb_events(), chan_pjsip_read_stream(), conf_run(), conf_start_record(), console_new(), dahdi_new(), do_notify(), filehelper(), generic_recall(), handle_capabilities_res_message(), handle_speechcreate(), iax2_codec_pref_best_bitfield2cap(), iax2_codec_pref_to_cap(), iax2_format_compatibility_bitfield2cap(), iax2_request(), jingle_read(), load_module(), local_request_with_stream_topology(), make_channel(), mgcp_rtp_read(), misdn_new(), multicast_rtp_request(), new_outgoing(), ooh323_new(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_write_format(), orig_app(), orig_exten(), originate_exec(), phone_new(), prepare_bridge_media_channel(), prepare_bridge_moh_channel(), process_sdp(), recalling_enter(), reload_config(), request_channel(), retransfer_enter(), set_caps(), set_format(), set_test_formats(), sip_new(), sip_rtp_read(), sip_set_default_format_capabilities(), skinny_rtp_read(), socket_process_helper(), stasis_app_control_snoop(), t38_create_media_state(), test_vm_api_create_mock_channel(), transmit_modify_request(), try_suggested_sip_codec(), unicast_rtp_request(), unistim_rtp_read(), and update_file_format_info().
#define AST_FORMAT_CAP_NAMES_LEN 384 |
Buffer size for callers of ast_format_cap_get_names to allocate.
Definition at line 326 of file format_cap.h.
Referenced by _sip_show_peer(), _skinny_show_device(), _skinny_show_line(), add_sdp(), alsa_request(), ast_stream_create_resolved(), ast_streamfile(), AST_TEST_DEFINE(), ast_write_stream(), chan_pjsip_get_codec(), chan_pjsip_set_rtp_peer(), chan_pjsip_write_stream(), codec_handler_fn(), compatible_formats_exist(), console_request(), func_channel_read(), function_iaxpeer(), function_sippeer(), generate_status(), handle_capabilities_res_message(), handle_cli_core_show_channeltype(), handle_cli_iax2_show_peer(), handle_cli_ooh323_show_config(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_users(), handle_showchan(), iax2_key_rotate(), iax2_request(), jingle_write(), local_request_with_stream_topology(), log_caps(), mbl_request(), mgcp_request(), mgcp_write(), native_rtp_bridge_compatible_check(), nbs_request(), onNewCallCreated(), ooh323_request(), ooh323_set_write_format(), ooh323_write(), oss_request(), phone_request(), process_sdp(), request_channel(), serialize_showchan(), set_caps(), set_format(), show_channels_cb(), sip_new(), sip_request_call(), sip_show_channel(), sip_show_settings(), sip_write(), skinny_new(), skinny_request(), skinny_write(), socket_process_helper(), start_rtp(), test_create_joint(), unistim_new(), unistim_request(), unistim_rtp_read(), unistim_show_info(), and unistim_write().
#define ast_t_format_cap_alloc | ( | flags, | |
tag | |||
) | __ast_format_cap_alloc((flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Definition at line 55 of file format_cap.h.
#define ast_t_format_cap_append | ( | cap, | |
format, | |||
framing, | |||
tag | |||
) |
Definition at line 106 of file format_cap.h.
enum ast_format_cap_flags |
Enumerator | |
---|---|
AST_FORMAT_CAP_FLAG_DEFAULT | Default format capabilities settings |
Definition at line 34 of file format_cap.h.
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 | ||
) |
Allocate a new ast_format_cap structure.
flags | Modifiers of struct behavior. |
ast_format_cap | object on success. |
NULL | on failure. |
Definition at line 117 of file format_cap.c.
References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_ref, 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 | ||
) |
Add format capability to capabilities structure.
cap | The capabilities structure to add to. |
format | The format to add. |
framing | The framing for the format (in milliseconds). |
0 | success |
-1 | failure |
Definition at line 195 of file format_cap.c.
References __ao2_ref(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ast_assert, format_cap_framed::format, format_cap_framed_destroy(), format_cap_framed_init(), format_in_format_cap(), and NULL.
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, codec2, format_cap_framed::format, id, NULL, 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, and format_cap_framed::framing.
Referenced by __sip_alloc(), add_sdp(), 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_gateway(), build_peer(), build_user(), chan_pjsip_get_codec(), chan_pjsip_new(), chan_pjsip_read_stream(), channel_do_masquerade(), check_peer_ok(), config_device(), config_line(), create_addr_from_peer(), create_outgoing_sdp_stream(), func_channel_read(), handle_request_invite(), jingle_alloc(), jingle_call(), jingle_interpret_content(), jingle_new(), load_module(), media_offer_write_av(), mgcp_get_codec(), mgcp_new(), ooh323_alloc(), ooh323_get_codec(), ooh323_onReceivedSetup(), ooh323_request(), phone_new(), process_sdp(), request_channel(), send_direct_media_request(), set_caps(), set_peer_defaults(), sip_get_codec(), sip_new(), sip_request_call(), sip_rtp_read(), sip_set_rtp_peer(), skinny_new(), try_suggested_sip_codec(), 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 741 of file format_cap.c.
References __ast_format_cap_get_names().
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.
Referenced by add_format_information_cb(), add_sdp(), 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_peer_ok(), check_translation_path(), configure_local_rtp(), create_addr(), create_outgoing_sdp_stream(), derive_format_from_cap(), handle_request_invite(), 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(), mgcp_new(), native_rtp_bridge_compatible_check(), ooh323_get_codec(), ooh323_write(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), process_sdp(), send_direct_media_request(), set_caps(), show_sound_info_cb(), sip_new(), sip_session_refresh(), sip_set_rtp_peer(), skinny_new(), transmit_connect(), transmit_connect_with_sdp(), transmit_modify_request(), transmit_modify_with_sdp(), 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 746 of file format_cap.c.
References ast_format_cap_count(), ast_format_none, and AST_VECTOR_GET.
Referenced by ast_sip_create_joint_call_cap(), ast_stream_create_resolved(), ast_translator_best_choice(), chan_pjsip_new(), request_channel(), set_format(), set_incoming_call_offer_cap(), sip_call(), and sip_request_call().
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, and NULL.
Referenced by AST_TEST_DEFINE(), chan_pjsip_new(), set_caps(), set_format(), sip_new(), 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 630 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, and format_cap_framed::framing.
Referenced by add_sdp(), ast_sip_create_joint_call_cap(), ast_speech_new(), ast_stream_create_resolved(), AST_TEST_DEFINE(), ast_translator_best_choice(), check_peer_ok(), create_outgoing_sdp_stream(), handle_capabilities_res_message(), iax2_request(), jingle_interpret_description(), process_sdp(), set_caps(), sip_request_call(), sip_session_refresh(), and skinny_register().
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 548 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, 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, and NULL.
Referenced by add_format_information_cb(), add_sdp(), 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(), function_sippeer(), handle_open_receive_channel_ack_message(), 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(), mgcp_new(), misdn_new(), mp3_exec(), ooh323_new(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), phone_new(), process_sdp(), set_caps(), show_sound_info_cb(), sip_new(), skinny_new(), skinny_set_rtp_peer(), start_rtp(), transmit_connect(), transmit_connect_with_sdp(), transmit_modify_request(), transmit_modify_with_sdp(), 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, format_cap_framed::framing, NULL, and result.
Referenced by add_codec_to_sdp(), AST_TEST_DEFINE(), create_addr(), handle_open_receive_channel_ack_message(), iax2_parse_allow_disallow(), native_rtp_bridge_compatible_check(), ooh323c_set_capability_for_call(), process_sdp(), sip_new(), skinny_set_rtp_peer(), and transmit_connect().
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 |
The | global framing value (in milliseconds) |
Definition at line 438 of file format_cap.c.
Referenced by ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), AST_TEST_DEFINE(), check_peer_ok(), configure_local_rtp(), create_addr_from_peer(), create_outgoing_sdp_stream(), jingle_enable_video(), jingle_new(), set_caps(), and start_rtp().
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 736 of file format_cap.c.
References __ast_format_cap_get_names().
Referenced by _sip_show_peer(), _skinny_show_device(), _skinny_show_line(), add_sdp(), alsa_request(), 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(), codec_handler_fn(), compatible_formats_exist(), console_request(), func_channel_read(), function_sippeer(), generate_status(), handle_capabilities_res_message(), 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_key_rotate(), iax2_request(), jingle_write(), local_request_with_stream_topology(), log_caps(), mbl_request(), mgcp_request(), mgcp_write(), native_rtp_bridge_compatible_check(), nbs_request(), onNewCallCreated(), ooh323_request(), ooh323_set_write_format(), ooh323_write(), oss_request(), phone_request(), process_sdp(), request_channel(), serialize_showchan(), set_caps(), set_format(), show_channels_cb(), sip_new(), sip_request_call(), sip_show_channel(), sip_show_settings(), sip_write(), skinny_new(), skinny_request(), skinny_write(), 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 615 of file format_cap.c.
References ast_format_get_type(), AST_VECTOR_GET, AST_VECTOR_SIZE, and format_cap_framed::format.
Referenced by add_sdp(), 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(), dialog_initialize_rtp(), jingle_enable_video(), jingle_request(), negotiate_incoming_sdp_stream(), ooh323_request(), process_sdp(), sip_call(), sip_new(), and skinny_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 689 of file format_cap.c.
References AST_VECTOR_SIZE, and internal_format_cap_identical().
Referenced by ast_stream_topology_equal(), AST_TEST_DEFINE(), iax2_key_rotate(), send_direct_media_request(), sip_set_rtp_peer(), and validate_stream().
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 655 of file format_cap.c.
References ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, AST_VECTOR_GET, AST_VECTOR_SIZE, and format_cap_framed::format.
Referenced by ast_openvstream(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), AST_TEST_DEFINE(), compatible_formats_exist(), console_request(), mgcp_request(), native_rtp_bridge_compatible_check(), phone_request(), 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.
ast_format_cmp_res | representing the result of the compatibility check between cap and format. |
Definition at line 583 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, and NULL.
Referenced by add_sdp(), alsa_request(), 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(), mgcp_rtp_read(), mgcp_write(), nbs_request(), ooh323_rtp_read(), ooh323_write(), oss_request(), process_sdp(), sip_indicate(), sip_rtp_read(), sip_write(), skinny_rtp_read(), skinny_write(), start_rtp(), try_suggested_sip_codec(), 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 497 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_ELEM_CLEANUP, FORMAT_CAP_FRAMED_ELEM_CMP, and NULL.
Referenced by ast_format_cap_update_by_allow_disallow(), AST_TEST_DEFINE(), check_translation_path(), and phone_new().
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 525 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, and FORMAT_CAP_FRAMED_ELEM_CMP.
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(), build_peer(), chan_pjsip_read_stream(), check_peer_ok(), create_addr_from_peer(), handle_request_invite(), jingle_interpret_description(), load_module(), media_offer_write_av(), originate_exec(), process_sdp(), reload_config(), request_channel(), send_direct_media_request(), set_caps(), sip_new(), sip_rtp_read(), sip_set_default_format_capabilities(), sip_set_rtp_peer(), skinny_session_cleanup(), transmit_modify_request(), and try_suggested_sip_codec().
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(), and format_cap_framed::framing.
Referenced by AST_TEST_DEFINE(), and try_suggested_sip_codec().
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 format_cap_framed::framing.
Referenced by ast_rtp_codecs_payload_formats(), ast_stream_create_resolved(), ast_stream_topology_create_from_format_cap(), AST_TEST_DEFINE(), ooh323_set_write_format(), and process_sdp_a_audio().
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, format_cap_framed::format, LOG_WARNING, NULL, parse(), and strsep().
Referenced by action_originate(), AST_TEST_DEFINE(), build_peer(), build_topology(), build_user(), codec_handler_fn(), config_parse_variables(), iax2_parse_allow_disallow(), media_offer_write_av(), originate_exec(), parse_line(), reload_config(), skinny_session_cleanup(), test_create_joint(), and validate_stream().