From bf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Mon, 13 Feb 2017 10:50:47 -0700 Subject: stream: Add stream topology to channel Adds topology set and get to channel. ASTERISK-26790 Change-Id: Ic379ea82a9486fc79dbd8c4d95c29fa3b46424f4 --- main/stream.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'main/stream.c') diff --git a/main/stream.c b/main/stream.c index 24844c4ab..5112c9593 100644 --- a/main/stream.c +++ b/main/stream.c @@ -337,3 +337,22 @@ struct ast_stream_topology *ast_stream_topology_create_from_format_cap( return topology; } + +struct ast_stream *ast_stream_topology_get_first_stream_by_type( + const struct ast_stream_topology *topology, + enum ast_media_type type) +{ + int i; + + ast_assert(topology != NULL); + + for (i = 0; i < AST_VECTOR_SIZE(&topology->streams); i++) { + struct ast_stream *stream = AST_VECTOR_GET(&topology->streams, i); + + if (stream->type == type) { + return stream; + } + } + + return NULL; +} -- cgit v1.2.3