Merge "stream: Add stream topology to channel"

This commit is contained in:
George Joseph
2017-02-15 19:29:52 -06:00
committed by Gerrit Code Review
7 changed files with 186 additions and 4 deletions

View File

@@ -884,6 +884,10 @@ enum {
* world
*/
AST_CHAN_TP_INTERNAL = (1 << 2),
/*!
* \brief Channels with this particular technology support multiple simultaneous streams
*/
AST_CHAN_TP_MULTISTREAM = (1 << 3),
};
/*! \brief ast_channel flags */
@@ -4734,4 +4738,34 @@ enum ast_channel_error ast_channel_errno(void);
*/
int ast_channel_get_intercept_mode(void);
/*!
* \brief Retrieve the topology of streams on a channel
*
* \param chan The channel to get the stream topology of
*
* \pre chan is locked
*
* \retval non-NULL success
* \retval NULL failure
*/
struct ast_stream_topology *ast_channel_get_stream_topology(
const struct ast_channel *chan);
/*!
* \brief Set the topology of streams on a channel
*
* \param chan The channel to set the stream topology on
* \param topology The stream topology to set
*
* \pre chan is locked
*
* \note If topology is NULL a new empty topology will be created
* and returned.
*
* \retval non-NULL Success
* \retval NULL failure
*/
struct ast_stream_topology *ast_channel_set_stream_topology(
struct ast_channel *chan, struct ast_stream_topology *topology);
#endif /* _ASTERISK_CHANNEL_H */

View File

@@ -27,3 +27,7 @@ int ast_channel_internal_setup_topics(struct ast_channel *chan);
void ast_channel_internal_errno_set(enum ast_channel_error error);
enum ast_channel_error ast_channel_internal_errno(void);
void ast_channel_internal_set_stream_topology(struct ast_channel *chan,
struct ast_stream_topology *topology);
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1,
struct ast_channel *chan2);

View File

@@ -316,4 +316,19 @@ int ast_stream_topology_set_stream(struct ast_stream_topology *topology,
struct ast_stream_topology *ast_stream_topology_create_from_format_cap(
struct ast_format_cap *cap);
/*!
* \brief Gets the first stream of a specific type from the topology
*
* \param topology The topology of streams
* \param type The media type
*
* \retval non-NULL success
* \retval NULL failure
*
* \since 15
*/
struct ast_stream *ast_stream_topology_get_first_stream_by_type(
const struct ast_stream_topology *topology,
enum ast_media_type type);
#endif /* _AST_STREAM_H */