Media IDs are supposed to be unique. Non-RFC OSRTP may however lead to
duplicated media sections with the same media ID. Use a hash table to
track which media IDs have already been seen, and ignore any duplicates.
Change-Id: I9de5fdf3165fc4326862af708aec3d4f6736cb12
Change old code to directly return `str` objects instead of pointers to
allocated ones. Largely a no-op change but makes some code easier and
eliminates some old kludges.
Change-Id: I2be19dd24bb7ff046d86cc32a3af235283e65dd0
If a string is already stored within the call's memory arena, skip
duplicating the string content when making a copy, and simply return the
same pointer.
Change-Id: I50107d87b2625234a395da21e1e4551585966a60
Convenience wrapper for &STR()
This is useful so that STR() and STR_DUP() can be extended to avoid
duplicate expansion of its macro arguments.
Change-Id: Ieae170807c11b0cdd8b52fac9bab98dccdc2b951
If there are no more tokens, instead of returning a null string as
remainder, set the remainder to the end of the original string with a
zero length.
Update two places in the code where this makes a difference.
Change-Id: I137fbce3e7d88ccba65f6b23a36aa1dfbbd3867e
Use str_cmp() to implement str_eq()
Use str_shift_cmp() in place of str_prefix()
Update return types to bool
Change-Id: If7927d957e20780408e77da1d04baffa082a6914
This should give slightly better performance due to not having to look
for the terminator byte twice. Not benchmarked. No-op.
Change-Id: I458a06b492393fcf5b186a61b69acabdf63a216e
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
These helper functions were largely unused or inconsistently used.
Create a new type and streamline usage.
Change-Id: I5cd9756a26994d027dd4ff6a2d01a8c6c3cffe30
For typed hash tables, enforce the correct type in the arguments to the
hashing and equality functions.
Adapt existing affected callback functions and change their arguments
from void* to the respective types.
Add reverse casts to GHashFunc and GEqualFunc in instances where these
functions are used in non-typed hash tables (that should be converted at
a later point).
Add convenience macro to create typed wrapper functions for hash tables
that use "direct" hashing (i.e. the pointer value).
Add wrappers for existing GLib functions that have generic arguments so
that they can be used in typed hash tables.
Change-Id: I43bb32969208f4aae49584d95c0df8353df6e2a0
Some source strings are `const char *` and we don't have an alternative
`str` type pointing to a const buffer. Strictly speaking some buffers
aren't even char buffers, yet we use the `str` type to manage them. This
eliminates the need to explicitly cast every usage.
Change-Id: Ifd3cdd3d400fc483e6c488a95e9381938e63cc7f
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
This makes the type in line with string(3) functions and eliminates some
compiler warnings.
Also update the related bencode data type.
Change-Id: I7ef4024f4b5a0f737b3dbe03bcd078032395bce6
If the length of the string is zero, the pointer to the buffer may be
null. ASAN flags these as invalid/undefined, so don't do that.
Change-Id: Ic55498465c53a78e1bd44c42d1a60f9bd3336473