Switch all memory buffers used for RTP I/O from generic stack or heap
allocated memory to the bufferpool implementation. Use a per-thread
bufferpool to minimise lock contention.
This commit is just a one-for-one swap and doesn't use the bufferpool's
reference counting semantics yet.
Change-Id: I9cba4ec97bd0afcd374bf6c0be2b608a46e73e57
Synchronize the `enum call_opmode` with the
kamailio module list of operation modes, as well
as with the `enum ng_command`.
This allows to operate based on `call_opmode`
in a more specific way, for example for a proper
setting of From/To tags based on directional flag,
which in its turn is being set using `call_opmode`.
Additionally introduce a macro checker, which covers
all previously non-existent operation mode types
as OP_OTHER, for backwards compatibility in conditions.
Change-Id: Idf4b9d910b81ee24be51008996c3fd02d8336a38
Turn repeat count into an int. No need for a long long.
Store start_pos in media_player.
Set start_pos and repeat count at the relevant code points once, instead
of passing it into multiple functions.
Take the opportunity to turn these shared options into a struct.
Change-Id: I758e899784fe1a6531f443d6a14fa59cf71bd4eb
Fix a regression from 4291c858
send_timer_rtcp() does its own locking of the SSRC. Release the lock
before calling it.
Change-Id: I185fb2fb4b47a343ab4be00d16629b5f330ee965
In the file implementations follow the rules:
1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.
In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.
Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
Make sure we don't try to send on closed sockets or to endpoints which
haven't been initialised.
Fixes unexpected fallout from 83c7336e
Change-Id: If73d61e52edeb72257515adab7428ecef82c2797
Using a pointer array instead of a linked lists allows us to directly
reference a media section by index number, without having to spool into
the linked list.
No functional changes.
Change-Id: I8b0e93f0c2e9addbcb4c938894118ed4a6aec768
Since the function has been swapped to the 'bool' return value,
we must comply with it.
media_player.c: In function ‘media_player_read_decoded_packet’:
media_player.c:374:17: warning: ‘return’ with no value,
in function returning non-void
374 | return;
| ^~~~~~
media_player.c:371:13: note: declared here
371 | static bool media_player_read_decoded_packet(struct media_player *mp) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: If4034164de1325b780dcb1792c6a1674ec7b55b4
We use next_run.tv_sec as flag to signal shut down of the media player
timer. Don't even call the run function when the timer has already been
shut down.
Change-Id: I68248ce05e368bd17ed1a6d346f125c035d0da07
Return true/false from media player run functions to signal whether
playback is finished and whether codec handlers should be reset.
Change-Id: Ieb2e0861190ad2851d986bae28becc5548e215ce
Convenience function to check whether any formats have changed, which
would indicate that a restart of the media player is needed.
Functional no-op.
Change-Id: I2bc9b57b95bb229bc4f8cfc49ca662fa724d3642
We're already determining the destination media section in
media_player_play_init() (looking for audio media), so it makes sense to
determine the payload type there as well.
Change-Id: I33d4a15005c2146864f74663fe8de2893454345b
Split out the logic to determine the destination payload type into a
separate functions. This makes it possible to supply a different, or
pre-determined, payload type instead.
Change-Id: I9b67b29cafc0c6ce4e18eede64dea3d1973f8b63
It makes more sense to set up the codec handler from the init function
rather than from the function reading the media packet.
Change-Id: I0bea3d0fc0669a54f93b2598251df69274950365
This makes it possible to have codecs running at variable clock rates
that differ from their RTP clock rates.
Change-Id: Ia2f5effb82eefe8c3028573ba0a6697da28473b1
Instead of just having an integer multiplier, support a fractional
factor. This allows us to have the RTP clock rate run faster than the
audio clock rate, and not just slower by an integer factor.
Change-Id: I7681cf369c43d8424ca2d2ebeffe932595d271ec