]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Cache string values of formats on ast_format_cap() to save processing.
authorMark Michelson <mmichelson@digium.com>
Wed, 2 Oct 2013 22:34:05 +0000 (22:34 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 2 Oct 2013 22:34:05 +0000 (22:34 +0000)
commit23cea9e44b8dd828d16d47a5c1f7a62ae2d534b9
treea08dcddc29d732ea97ac7a36abf20be2949a5b6b
parente8dd0da34bed2b6c91db0f6f0a423ef5c894a964
Cache string values of formats on ast_format_cap() to save processing.

Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

Review: https://reviewboard.asterisk.org/r/2879

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
51 files changed:
addons/chan_mobile.c
addons/chan_ooh323.c
apps/app_confbridge.c
apps/app_meetme.c
apps/app_originate.c
bridges/bridge_holding.c
bridges/bridge_native_rtp.c
bridges/bridge_simple.c
bridges/bridge_softmix.c
channels/chan_alsa.c
channels/chan_bridge_media.c
channels/chan_console.c
channels/chan_dahdi.c
channels/chan_gtalk.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_jingle.c
channels/chan_mgcp.c
channels/chan_misdn.c
channels/chan_motif.c
channels/chan_multicast_rtp.c
channels/chan_nbs.c
channels/chan_oss.c
channels/chan_phone.c
channels/chan_pjsip.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_unistim.c
channels/dahdi/bridge_native_dahdi.c
include/asterisk/format_cap.h
main/bridge_basic.c
main/ccss.c
main/channel.c
main/core_local.c
main/dial.c
main/file.c
main/format_cap.c
main/manager.c
main/media_index.c
main/rtp_engine.c
pbx/pbx_spool.c
res/ari/resource_bridges.c
res/parking/parking_applications.c
res/res_agi.c
res/res_clioriginate.c
res/res_pjsip/pjsip_configuration.c
res/res_pjsip_sdp_rtp.c
res/res_pjsip_session.c
res/res_stasis.c
tests/test_config.c
tests/test_format_api.c