diff options
author | George Joseph <gjoseph@digium.com> | 2017-02-15 19:29:52 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-15 19:29:52 -0600 |
commit | ca7fa7bbd2d54766f6b5911d7aa046cdcfd0dfe8 (patch) | |
tree | 54d74f4ffaf19eede3f07224526f9922d1eaf9f9 /main/stream.c | |
parent | 11886dea82b2d342c946f669144d5afaa667a26a (diff) | |
parent | bf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 (diff) |
Merge "stream: Add stream topology to channel"
Diffstat (limited to 'main/stream.c')
-rw-r--r-- | main/stream.c | 19 |
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; +} |