summaryrefslogtreecommitdiff
path: root/main/stream.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-02-15 19:29:52 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-15 19:29:52 -0600
commitca7fa7bbd2d54766f6b5911d7aa046cdcfd0dfe8 (patch)
tree54d74f4ffaf19eede3f07224526f9922d1eaf9f9 /main/stream.c
parent11886dea82b2d342c946f669144d5afaa667a26a (diff)
parentbf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 (diff)
Merge "stream: Add stream topology to channel"
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;
+}