diff options
author | George Joseph <gjoseph@digium.com> | 2017-02-13 10:50:47 -0700 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-02-14 14:09:37 -0700 |
commit | bf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 (patch) | |
tree | 3ebbbb4a3a9235f221bb0df50587e9873905b5f9 /main/stream.c | |
parent | 6c4657e28ebf9cbe6d952750142d9631ff600657 (diff) |
stream: Add stream topology to channel
Adds topology set and get to channel.
ASTERISK-26790
Change-Id: Ic379ea82a9486fc79dbd8c4d95c29fa3b46424f4
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; +} |