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 solves problems when the same SSRC is looped through the same call
multiple times in different mono/dialogues, with different parameters.
Change-Id: I1d033cb1f012574d82b5bcbfffe11eb5f983cfd8
The only reason the wait time in timer threads is capped at 100 ms is to
catch the daemon's shutdown. Since these threads already use a
condition variable to be woken up, we can use the same condition to wake
up the threads during a shutdown, allowing for a much longer (possibly
unlimited) sleep time in timer threads.
Change-Id: I3b5f280a4d502176a731e8b52b1b731022c8db4f
Recent ffmpeg versions have removed AVPacket from the public ABI,
therefore deprecating av_init_packet on statically allocated objects.
The replacement is av_packet_alloc()/av_packet_free().
Change-Id: I5f93fbd19e43413c3328e143cc9147fbdf12d910
The glib macro for g_atomic_pointer_get() uses typeof() with an
intermediate variable, resulting in a stray compiler warning if the
argument uses `const` as the intermediate variable also ends up being
const. Use an extra non-const intermediate variable to work around this.
closes#1270
Change-Id: I3bf1404240d3b8571aaf40c38b524f578e0fdbd9
These functions can return negative values to signal errors, therefore
use ssize_t as appropriate type.
Change-Id: I810b2d40e9d6df47269af54c59940d114bb5a672
Some invocations of ssrc_ctx_put() are deliberately passed a memory
reference, which produces an undesired compiler warning. Use an
intermediate variable to suppress it.
Change-Id: I7a5000df4d66ffadd374475907460919763c95b0
When the compiler does not have support for the __error__ attribute,
fallback to use the GCC posion pragma, which works on both gcc and
clang. It ha the advantage of being more portable and working at the
preprocessor level, which means is not affected by symbol redirection
due to builtin conversion or stack-protector remapping, at the cost of
worse diagnostics.
Change-Id: I322396f8a0d1b993637e8aca27f27f6868ecba3c
Warned-by: clang-12
The function argument where the cast is applied is volatile void *,
use the same type on the cast.
Change-Id: I2e39c433962df4f31ff8cad4d7561d358e94928a
Warned-by: clang-12
Convert ssrc_ctx_put() and ssrc_ctx_hold() to macros to aide in
debugging reference leaks. Having them as inline functions hides the
actual location of the refcount changes.
Obsolete ssrc_ctx_get() as returning values from macros is awkward and
it was only used in two locations.
Also fix a function invocation mishap: obj_get_o() should be used
instead of __obj_get() as the latter is an internal macro.
Change-Id: Icc0d63f04b3816632fd120c1c749cafabbbfa331
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 we receive an SDP with a DTLS fingerprint, by default we adopt the
hash function used for that fingerprint in subsequent communication with
that peer. However, if the SDP is an answer, and we previously used a
different hash function in the offer towards that peer, then a later
re-invite offer would be sent with a different fingerprint, causing an
unexpected DTLS restart. Instead, make sure we don't change fingerprints
if one was already sent.
Change-Id: I603bb86ce2d7121556c161749ed08128dd0b63b2
Whether a bit-field is signed or unsigned is implementation specific, so
we should be explicit about this.
Change-Id: I744df3d24bc08e95fa816ba4135f19cd3a5dcb17
Warned-by: lgtm