This change adds a few things to facilitate stream topology changing:
1. Control frame types have been added for use by the channel driver
to notify the application that the channel wants to change the stream
topology or that a stream topology change has been accepted. They are
also used by the indicate interface to the channel that the application
uses to indicate it wants to do the same.
2. Legacy behavior has been adopted in ast_read() such that if a
channel requests a stream topology change it is denied automatically
and the current stream topology is preserved if the application is
not capable of handling streams.
Tests have also been written which confirm the multistream and
non-multistream behavior.
ASTERISK-26839
Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9
* Removed the AST_CHAN_TP_MULTISTREAM tech property. We now rely
on read_stream being set to indicate a multi stream channel.
* Added ast_channel_is_multistream convenience function.
* Fixed issue where stream and default_stream weren't being set on
a frame retrieved from the queue.
* Now testing for NULL being returned from the driver's read or
read_stream callback.
* Fixed issue where the dropnondefault code was crashing on a
NULL f.
* Now enforcing that if either read_stream or write_stream are
set when ast_channel_tech_set is called that BOTH are set.
* Added the unit tests.
ASTERISK-26816
Change-Id: If7792b20d782e71e823dabd3124572cf0a4caab2
This change adds an ast_write_stream function which allows
writing a frame to a specific media stream. It also moves
ast_write() to using this underneath by writing media
frames provided to it to the default streams of the channel.
Existing functionality (such as audiohooks, framehooks, etc)
are limited to being applied to the default stream only.
Unit tests have also been added which test the behavior of
both non-multistream and multistream channels to confirm that
the write() and write_stream() callbacks are invoked
appropriately.
ASTERISK-26793
Change-Id: I4df20d1b65bd4d787fce0b4b478e19d2dfea245c
This change adds unit tests cover the following:
1. That retrieving the first media stream of a specific media
type from a stream topology retrieves the expected media
stream.
2. That setting the native formats of a channel which does
not support streams results in the creation of streams on
its behalf according to the formats of the channel.
3. That setting a stream topology on a channel which supports
streams sets the topology to the provided one.
ASTERISK-26790
Change-Id: Ic53176dd3e4532e8c3e97d9e22f8a4b66a2bb755
This change adds unit tests for the various API calls relating
to stream topologies. This includes creation, destruction,
inspection, and manipulation.
Through this a few bugs were uncovered in the implementation:
1. Creating a topology using a format capabilities would fail as
the code considered a return value of 0 from the append stream
function to indicate an error which is incorrect.
2. Not all functions which placed a stream into a topology
set the position on the stream itself.
3. Appending a stream would cause a frack if the position
provided was the last one. This occurred because the existing
stream was queried but the index was outside of what the
vector was currently at for size.
ASTERISK-26786
Change-Id: Id5590e87c8a605deea1a89e53169a9c011d66fa0
This change adds the media stream definition and API for
accessing and using it. Unit tests have also been written
which exercise aspects of the API.
ASTERISK-26773
Change-Id: I3dbe54065b55aaa51f467e1a3bafd67fb48cac87