stream: Enforce formats immutability and ensure formats exist.
authorJoshua C. Colp <jcolp@sangoma.com>
Tue, 21 Apr 2020 09:52:24 +0000 (06:52 -0300)
committerKevin Harwell <kharwell@digium.com>
Thu, 23 Apr 2020 14:16:51 +0000 (09:16 -0500)
commit1c5e68580af4556de86c2c33200fe3d43d499bed
treef7d8484b3a8b6551cbbb28d8c88c25adc79c1b1b
parent9ad3d2829c58da0a2f75acae72ba456cafc6f593
stream: Enforce formats immutability and ensure formats exist.

Some places in Asterisk did not treat the formats on a stream
as immutable when they are.

The ast_stream_get_formats function is now const to enforce this
and parts of Asterisk have been updated to take this into account.
Some violations of this were also fixed along the way.

An additional minor tweak is that streams are now allocated with
an empty format capabilities structure removing the need in various
places to check that one is present on the stream.

ASTERISK-28846

Change-Id: I32f29715330db4ff48edd6f1f359090458a9bfbe
bridges/bridge_native_rtp.c
bridges/bridge_simple.c
bridges/bridge_softmix.c
channels/chan_pjsip.c
channels/pjsip/dialplan_functions.c
doc/UPGRADE-staging/stream_immutable_formats.txt [new file with mode: 0644]
include/asterisk/stream.h
main/stream.c
res/res_pjsip_session.c
res/res_pjsip_session/pjsip_session_caps.c