summaryrefslogtreecommitdiff
path: root/main/stream.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-02-16 07:28:33 -0700
committerGeorge Joseph <gjoseph@digium.com>2017-02-16 09:10:02 -0600
commitf8f513d363fd10148976c592cbc8be860cda28ab (patch)
tree1ec0ac62c5300d992096708e8855ea6086b51f6d /main/stream.c
parenta9c15a0e4c987d053b0ab43312946719d7655a3f (diff)
stream: Rename creates/destroys to allocs/frees
To be consistent with sdp implementation. Change-Id: I714e300939b4188f58ca66ce9d1e84b287009500
Diffstat (limited to 'main/stream.c')
-rw-r--r--main/stream.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/main/stream.c b/main/stream.c
index 5112c9593..aacd33f17 100644
--- a/main/stream.c
+++ b/main/stream.c
@@ -69,7 +69,7 @@ struct ast_stream_topology {
AST_VECTOR(, struct ast_stream *) streams;
};
-struct ast_stream *ast_stream_create(const char *name, enum ast_media_type type)
+struct ast_stream *ast_stream_alloc(const char *name, enum ast_media_type type)
{
struct ast_stream *stream;
@@ -108,7 +108,7 @@ struct ast_stream *ast_stream_clone(const struct ast_stream *stream)
return new_stream;
}
-void ast_stream_destroy(struct ast_stream *stream)
+void ast_stream_free(struct ast_stream *stream)
{
if (!stream) {
return;
@@ -176,7 +176,7 @@ int ast_stream_get_position(const struct ast_stream *stream)
}
#define TOPOLOGY_INITIAL_STREAM_COUNT 2
-struct ast_stream_topology *ast_stream_topology_create(void)
+struct ast_stream_topology *ast_stream_topology_alloc(void)
{
struct ast_stream_topology *topology;
@@ -201,7 +201,7 @@ struct ast_stream_topology *ast_stream_topology_clone(
ast_assert(topology != NULL);
- new_topology = ast_stream_topology_create();
+ new_topology = ast_stream_topology_alloc();
if (!new_topology) {
return NULL;
}
@@ -211,8 +211,8 @@ struct ast_stream_topology *ast_stream_topology_clone(
ast_stream_clone(AST_VECTOR_GET(&topology->streams, i));
if (!stream || AST_VECTOR_APPEND(&new_topology->streams, stream)) {
- ast_stream_destroy(stream);
- ast_stream_topology_destroy(new_topology);
+ ast_stream_free(stream);
+ ast_stream_topology_free(new_topology);
return NULL;
}
}
@@ -220,13 +220,13 @@ struct ast_stream_topology *ast_stream_topology_clone(
return new_topology;
}
-void ast_stream_topology_destroy(struct ast_stream_topology *topology)
+void ast_stream_topology_free(struct ast_stream_topology *topology)
{
if (!topology) {
return;
}
- AST_VECTOR_CALLBACK_VOID(&topology->streams, ast_stream_destroy);
+ AST_VECTOR_CALLBACK_VOID(&topology->streams, ast_stream_free);
AST_VECTOR_FREE(&topology->streams);
ast_free(topology);
}
@@ -272,7 +272,7 @@ int ast_stream_topology_set_stream(struct ast_stream_topology *topology,
if (position < AST_VECTOR_SIZE(&topology->streams)) {
existing_stream = AST_VECTOR_GET(&topology->streams, position);
- ast_stream_destroy(existing_stream);
+ ast_stream_free(existing_stream);
}
stream->position = position;
@@ -293,7 +293,7 @@ struct ast_stream_topology *ast_stream_topology_create_from_format_cap(
ast_assert(cap != NULL);
- topology = ast_stream_topology_create();
+ topology = ast_stream_topology_alloc();
if (!topology) {
return NULL;
}
@@ -308,29 +308,29 @@ struct ast_stream_topology *ast_stream_topology_create_from_format_cap(
new_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!new_cap) {
- ast_stream_topology_destroy(topology);
+ ast_stream_topology_free(topology);
return NULL;
}
ast_format_cap_set_framing(new_cap, ast_format_cap_get_framing(cap));
if (ast_format_cap_append_from_cap(new_cap, cap, type)) {
ao2_cleanup(new_cap);
- ast_stream_topology_destroy(topology);
+ ast_stream_topology_free(topology);
return NULL;
}
- stream = ast_stream_create(ast_codec_media_type2str(type), type);
+ stream = ast_stream_alloc(ast_codec_media_type2str(type), type);
if (!stream) {
ao2_cleanup(new_cap);
- ast_stream_topology_destroy(topology);
+ ast_stream_topology_free(topology);
return NULL;
}
/* We're transferring the initial ref so no bump needed */
stream->formats = new_cap;
stream->state = AST_STREAM_STATE_SENDRECV;
if (ast_stream_topology_append_stream(topology, stream) == -1) {
- ast_stream_destroy(stream);
- ast_stream_topology_destroy(topology);
+ ast_stream_free(stream);
+ ast_stream_topology_free(topology);
return NULL;
}
}