summaryrefslogtreecommitdiff
path: root/main/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/stream.c')
-rw-r--r--main/stream.c19
1 files changed, 19 insertions, 0 deletions
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;
+}