Simply stripping a supplemental codec doesn't actually affect the
remaining real codecs. Add a special-cased version of codec_touched() to
ignore such a manipulation.
Add a matching test case.
Change-Id: I4a91292dd38e1114837c2dc841afe07d87cff6cb
Don't try to interpret or schedule DTMF packets if we're just doing RTP
passthrough.
Without tracking the seqencing and timestamping of the primary media
stream, we cannot actually schedule DTMF packets properly. Use the
presence of a defined output sequence number to make this determination.
The other case that uses a predefined output sequence number is when
media is coming from a pre-coded media player stream. The same thing
applies: These packets are already scheduled, so we can skip trying to
schedule them again.
closes#1638
Change-Id: I2d2c20e731f20a3136ca3eee37f0b521062cdb11
This replicates the code to replace audio packets with injected DTMF
events. Unfortunately the code paths between forwarding audio and
processing/forwarding DTMF events is quite different, so some slight
duplication is needed.
Additionally the case of blocked DTMF + injected DTMF must be handled.
Change-Id: Ieb576b4b6644c9b154ba4c6ebd48fe12ff08e1de
Add special return value to indicate that an event was a duplicate and
should be discarded.
Functional no-op.
Change-Id: I5d40bcc4a0bc45ba7875f4132873e7b8d747e132
Add a flag to inhibit kernel mode while DTMF injection is active. Tie in
DTMF playback trigger function: Remove stream from kernel, set inhibit
flag, play DTMF, then unset inhibit flag when all events have been
injected.
Change-Id: I533ec95a676bc7edf4dd973217f8d9499f1e22b6
Support using the SSRC TS derived from received RTP packets as "encoder"
TS (the "next" expected TS) for passthrough RTP in addition to the FIFO
TS of an actual encoder.
Change-Id: I7c49c27651eb89c5349bbf290b1c0ad160f77e3b
Make the decision whether or not to use SSRC passthrough handlers in the
upper level calling function, instead of implicitly in
__make_passthrough_gsl()
Change-Id: Ied88120ea4f12d50e3c5afb96023bdd86c42c6e1
__make_passthrough_ssrc() is only used after a passthrough handler has
already been created via __make_passthrough(), and the two functions do
exactly the same thing other than using a different handler functions.
So we can skip completely shutting down the handler and creating a new
one, and only update the handler function instead.
Change-Id: I5acdb5f5508b385320dda6b8bbb18cccd315f99d
Instead of just setting the "force transcoding" flag when DTMF injection
is required, check it on a per-codec basis, so we can be more granular
with this decision.
Functional no-op.
Change-Id: I496f3d1fba5840e7870c373f94190243392db438
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
Track audio writes in the mix buffer to set the `active` flag to true
whenever a write occurs, which makes it possible to create the buffer in
an inactivate state and implicitly set it active on demand.
Handle the mix buffer not returning any data in the RTP sending logic
(which is what happens for an inactive buffer) by simply not sending any
packets.
Change-Id: Iaeb0f6deadb3d90020c8c62872735cc94db80504
Similar to the existing media_player, but instead of simply producing
its own standalone output media stream, the audio_player takes over the
entire media stream flowing to the receiver, including media forwarded
from the opposite side of the call, as well as media produced by the
media_player.
Change-Id: Ic34ecf08fc73b04210cfffb1a7d795b462ece5ea
Extend __make_transcoder_full with a custom callback function to create
the SSRC handlers.
Functional no-op.
Change-Id: I79cfabf6e9758b105a89908f9023bd773b838d9e
Support creating transcoders with different "packet decoded" callback
functions.
Functional no-op.
Change-Id: I49ba720841161999dc0ae166ea0841dc094e8bc7
Split out the parts of __ssrc_handler_transcode_new that are related to
the decoder only, leaving the encoder-related code in a separate
function. Allow re-use of the decoder setup code.
Functional no-op.
Change-Id: Ifb91c388a872a4ca14c0cc4571f4d0578271407f
Only parse out a codec type if the codec is given with any parameters
set (and not just by name). Parsing out a codec type when just its name
is given leads to a codec type with default parameters set (such as the
number of channels) which can lead to a stricter matching than desired.
When a codec is given just by name we want to match all codecs of that
type, not just the ones with the same parameters as the default ones.
Change-Id: I583bf4045dbd55291d8dc596310730024853d386
Use dedicated functions and different code paths for the different use
cases, instead of just a single function which does if/else all the
time.
Change-Id: Ic3ab928c3605cfe4a2f48889e95a3a1ddccdbbec
This type is used as const everywhere except internally, so make it part
of the typedef for brevity.
Change-Id: Ic4afe037b392239a991d5380c6708903011da29e
1) Read dtxb->start while the lock is held (not strictly necessary as
the read should be atomic anyway)
2) Expect that dtxb->start can be larger than rtpe_now.tv
The latter can happen as `rtpe_now` in a timer thread is faked to be
exactly the time when the timer was supposed to run, and not the actual
current time, which means that a newly added packet can have a later
time stamp than the "now" the timer thread is using.
Change-Id: I48fd7f78af97c6d5b802e5151d69855a90f4032d
Some codecs (e.g. Opus) can natively encode audio with various clock
rates without producing an output that is locked to that clock rate and
without requiring resampling the input. Add an appropriate callback
function and adapt tests.
Change-Id: Id788c4d4c05e20f93cce7e910f9f265b381cbe34
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