We use `family == NULL` as test for the socket being open in several
places, and expect it to match the familt of the addresses. Set it to
zero to make it consistent.
Change-Id: Ide2b41e84fc27b5f47f579dcf4ab2ec2f6b0a37e
(cherry picked from commit 16de9688d6)
ICE drops packets early in media_demux_protocols() (via
ice_peer_address_known()), which means in media_packet_address_check()
we can immediately set any socket as confirmed that has received
anything.
Take receiving socket into account to determine whether the endpoint is
a match.
Disable endpoint learning with ICE. ICE is in charge of determining
endpoint address and local socket.
`media-handover` and `strict-source` handling remains in place. With
`media-handover` set, we allow changing endpoint and local socket based
on what is actually received, overriding the nomination from ICE.
Change-Id: Ieac2893355df6ee560b497867181e6f47d646f2e
(cherry picked from commit d3af013494)
Don't just check for the selected_sfd to be non null, but also for the
socket to actually be open, as this is needed for the translate_ep set
of functions in particular.
Change-Id: I78cb0f7b8c9e4359c9e037485b29f63e0cd9476b
(cherry picked from commit 9cb902319c)
A stream that needs to be unkernelized that wasn't actually kernelized
due to lack of support or information still needs to have the flag reset
so that it can retried.
Change-Id: I7de17236d382d4f4dbfc3225c37688769cc9c8ad
(cherry picked from commit ab8b7fb228)
Pull the kernel in/out checks down below the "out" label, and use the
existing flags from the STUN connect event instead of directly calling
the relevant function.
Change-Id: Ide1ebf0d18446427535d9e63dadf7fdbbddc6c94
(cherry picked from commit 209e5a38dc)
Set the stream as kernelized even if it couldn't be, so that we don't
keep trying.
Change-Id: Icf05c6cab2f52d918ba04e7cb2089347b3f72378
(cherry picked from commit 46e8d6c305)
If SRTP/DTLS isn't yet established, do fully bail out of the kernelize
function, instead of just logging a message and blindly continuing, as
it would eventually fail due to missing or invalid SRTP parameters.
Fix-up for f2d57de078
Change-Id: I3521f54fe2001d3c67118a3502807d8cb6ada7ee
(cherry picked from commit 7ab5cf3ebf)
We can bail right there instead of having to rely on the
`(!reti->local.family)` condition
Change-Id: I584e90dd1a705cfbe1cd3e3d849e1fa88f511448
(cherry picked from commit dbcd657908)
Previously, the ports used for a monologue subscription would leak upon re-subscribe.
``__assign_stream_fds`` cleared the stream fd queue without decrementing the ref count. This
prevented ``monologue_destroy`` from releasing the ports on unsubscribe.
Closes#2125
Change-Id: Ib86290d6a35e2388e34098f2847f1e34b3db2c5d
(cherry picked from commit 250df2af5e)
Similar in spirit to f2d57de078, but for
the encrypt case.
Closes#2127
Change-Id: I06c82f4a1d768a863922e2240aebb6c1d243e269
(cherry picked from commit e6469c006b)
In case of the reverse direction of a subscription, no stream handler will be found. Previously, the
decrypt struct was left zeroed, the kernel module rejected this with ``EINVAL`` and the daemon logged:
```
[core] Failed to push relay stream to kernel: Invalid argument
```
This patch sets ``REC_NULL``/``REH_NULL`` and marks the target as non-forwarding, matching what is
expected by ``validate_srtp``.
Closes#2126
Change-Id: I5aa2b490c65e5d97dc9b2ddd24c09f9ae7b63892
(cherry picked from commit 47371520ee)
Allow invalid payload types for rejected RTP streams.
Allow empty codec store for zero-port streams.
Has some side effects on tests.
Closes#2122
Change-Id: I28c63a3e5b7309084e7899a19ff4550e8f56aac5
(cherry picked from commit 71cceeed5a)
ffmpeg's CNG expects a fixed frame size, or at least a maximum frame
size, as it allocates internal buffers on construction based on that
frame size. Calling the decoder with a larger frame size therefore leads
to an internal buffer overflow. Calling it with a smaller frame size is
fine.
Retain the simple one-shot CNG for the most common case (frame size
smaller than the max). For larger frames, call the CNG in a loop and
manually construct a return frame.
Change-Id: I0ebe0b7a9ad8a08bbabd0d8dea264b08cb44feee
(cherry picked from commit dfcb9a8322)
Currently the helper accepts 0 length, but callers actually
can try to mutate it with `- 1` what means overflowing it.
e.g. `extmap_short_is_valid_data()` has a bitwise operation
including length `(id << 4) | (ext->len - 1)`
Change-Id: I74f7fa134355059b18ba8c2b4e671c735324bdb7
(cherry picked from commit a51332f675)
Currently the function has two cycles (while-outer-cycle and
for-inner-cycle).
The inner one operates on the given `pp` pointer and can potentially
mutate it (the pointer isn't const), hence the outer cycle will
continue with a mutated pointer.
Instead just use a local scope pointer to manipulate linked list's
data.
P.S.: the `pp` pointer isn't a double pointer, so unlikely was
expected (even by design) to be modified (e.g. its address or what
it actually points to).
Change-Id: Ia36bcb6fb47e9e72ae25a838f8005ca99f4c591d
(cherry picked from commit a4875c336e)
Don't test for presence of packages when not needed
Honour build profiles for dependencies and build flags
Closes#2121
Change-Id: Icad346fd1afe14e07d959c8d15778a76abc28477
(cherry picked from commit c2038e035e)
Make both `media_player_opts_t.db_id` and `media_player_content_index.db_id`
unsigned because:
- they aren't used with any guards/init values
- most DB-media API functionality actually uses `unsigned long long`
So this makes the ids consistent with the usage of them
in the actual code.
Change-Id: I6c756c537b3c992099a6857683078c169d5e030d
Currently uses "media player" as a name,
but for debugging purposes of thread dumps/logs, it's clearer
to have according name, so just name it "send timer".
Change-Id: If2a9111d014a659514ccb8c40ee919135a57ca9e
Make this sentinel visible via header, because anywhere
where the `kernel_idx` is declared/used,
this won't be usable due to limited visibility to .c file.
Change-Id: I159fe1a87e92656fdd790dd98569cfebe80d4ddd
For comparison reasons. This last unrefactored condition
was missed during the refactoring here: 93c49e9c2e
Change-Id: Iee7c01e776945a34eaa87d6c0d7bba8d405395a8
To not leak on media changes (ssrc differs), release
previous `->ssrc_out`, then overwrite the pointer.
`get_ssrc()` returns an owned reference.
Change-Id: Iaae6e24fe7b6a28bea06fb58794416d6c79894a2
Before to start the media player, check if the
seek process for the start frame failed, because
otherwise it starts from the unexpected position,
and there is no awareness about it.
Just add log for this case.
Change-Id: I36a912a9ef044825b050f8b7a6ad5562571b7d34
So that their naming is self-evident and correlates
with the actual options flag:
- `media-files-expire` -> `media_files_expire_us`
- `db-cache-expire` -> `db_cache_expire_us`
- `db-media-expire` -> `db_media_expire_us`
Change-Id: I76ebe9f92ba22de7c19fbb2ff47d0bf1952e1480
When accessing the array members via the pointer they
are still read-only, but the entries themselves are mutable.
So just make the elements constant pointers.
Also comply with the indentation style, and use tabs, not spaces.
Change-Id: I2165d0bf0b7b3ee4ad053c235dae4f60f36c1a43
In case the allocation of pcre for streams regex
fails, but not for the info, we never free
the latter one, because on returning an error,
just calling `die()`, hence no de-allocation
procedures are fulfilled.
Change-Id: I4a39b2c3043798c59fa6ec2fe0d70b1b1b27517f