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
No functional changes. Refactors are:
- use `UINT_MAX` instead of `-1`
- add definition `KERNEL_IDX_NONE = UINT_MAX`
- use `KERNEL_IDX_NONE` to se none value
- use `KERNEL_IDX_NONE` to check the none in conditions
Change-Id: I132d39607acd2c8d3b229bc3fba4d16e07e3d12c
In case when adding blob id, we allocate a list of things, like:
`AVFormatContext`, `AVIO` buffer, `AVIOContext`,
and we manage to copy it before returning an error.
On immediate failure this leaves the player
in a partially initialized state, just be explicit and
use the `media_player_coder_shutdown()` before to
return an error.
Change-Id: I9620e7b78f02e22d77f01bac3af6afc9dd5773fb
The `name` is caller-owned, while the cache itself
also keeps a separate key object
in the `media_player_media_files_names`.
This can desynchronize the hash key and the list key.
Hence prefer using the owned key instead.
Change-Id: I9b85c306cc4e2c32675bada3dec0d049ff5645fe
`media_player_media_files_insert()` stores keys allocated
with `str_dup()`, but during the eviction,
the key is freed with `g_free()`. Use `str_free()` instead.
Change-Id: I17a8498f7cf850a3cc2015130d1aa689f3f7c553
The `media_player_expire_cache_entry()` appears
to use the `db_expire_us` instead of the `media_expire_us`.
Was most probably a copy-paste typo in the past,
just fix it.
Change-Id: I6a4938406a6fb43459c99a354616d5f5ce10bae2
The only caller of `media_player_get_cache_times()`
does comparisons based on microseconds, but the called
function to calculate `mtime` and `atime` does this in seconds.
Hence the result is used incorrectly, because it compares
that value against `rtpe_now - rtpe_config.db_expire_us`,
which is again in microseconds.
Change-Id: Iea4b5b1c6d36c202bdce477ee8147e84e1974210
Both the play media and the music on hold use
the `media_player::call_play_media_for_ml()` as an entrance
towards the `media_player::media_player_new()` and
`media_player::media_player_play_init()`.
Prevent allocation of new MoH over ongoing one,
as well as the `play media` command over ongoing MoH.
Otherwise a media player will be re-used to override
ongoing activity.
Explicit policy must be used:
First the MoH has to be stopped
by getting back to the SDP `sendrecv` state, before
any other MoH request, or play media request can be fulfilled.
Change-Id: Ia5fdc10cfa8f491109ade9a2225b182ccdaa4778
To show that player has been created.
Additionally: add one more log line
to track that the play media is being requested.
Change-Id: I4e8eb8f282654902a96bffb70c7c241e9c78b8d5
Resolve file name conflicts between different components
Ensure shared log levels are identical across components
Encapsulates lib/*
Change-Id: If848d6fa0e4cd8eac88ce9e63ee77fc5a7a481fd
Some containers (MP3) fill the audio format information only after
reading the first frame. Do that if the information is missing.
Change-Id: I7865dee130e2a109e289eca5119d38a4e00f2a32
Use a pointer to the arena plus a comparison test to determine whether
to ref or to dup the string, instead of a function pointer. The function
pointer alone wasn't enough as there can be multiple arenas.
Change-Id: Icd317e524fc2e5842f90d172ef7089d2cb0a5a28
Fixes regression from Ib4285e7aae
RTCP multiplexing requires the RTCP sender to maybe lock the same output
stream, maybe lock some other one. Allow for both.
Change-Id: I6fcef32e656f8f0de46ad777f11a19c259ce35c7
With selected_sfd being protected by in_lock, we pretty much have to
hold at least in_lock everywhere, and end up requiring both locks in
many places. The distinction has become pointless.
Change-Id: Ic0ad976c2d68d9639b9434da7f0e6e9c0d84c185