diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-02-16 13:24:30 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-16 13:24:30 -0600 |
commit | ab34e46b3a5ed53d3a28dfc7d38762691ddccf37 (patch) | |
tree | 5b7fd3ee985b494b6046aef2e70ba91def7017cc /main | |
parent | 11da7b510643d116ea1f209330cff56b5ee6585a (diff) | |
parent | f8f513d363fd10148976c592cbc8be860cda28ab (diff) |
Merge "stream: Rename creates/destroys to allocs/frees"
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 2 | ||||
-rw-r--r-- | main/channel_internal_api.c | 6 | ||||
-rw-r--r-- | main/stream.c | 32 |
3 files changed, 20 insertions, 20 deletions
diff --git a/main/channel.c b/main/channel.c index c74e9475f..1e7bc563e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -897,7 +897,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char return ast_channel_unref(tmp); } - if (!(topology = ast_stream_topology_create())) { + if (!(topology = ast_stream_topology_alloc())) { return ast_channel_unref(tmp); } ast_channel_internal_set_stream_topology(tmp, topology); diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 235b99604..1934eb9a4 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -848,7 +848,7 @@ static void channel_set_default_streams(struct ast_channel *chan) void ast_channel_internal_set_stream_topology(struct ast_channel *chan, struct ast_stream_topology *topology) { - ast_stream_topology_destroy(chan->stream_topology); + ast_stream_topology_free(chan->stream_topology); chan->stream_topology = topology; channel_set_default_streams(chan); } @@ -871,7 +871,7 @@ void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_stream_topology *new_topology; if (!value) { - new_topology = ast_stream_topology_create(); + new_topology = ast_stream_topology_alloc(); } else { new_topology = ast_stream_topology_create_from_format_cap(value); } @@ -1804,7 +1804,7 @@ struct ast_stream_topology *ast_channel_set_stream_topology(struct ast_channel * * it even if its empty. */ if (!topology) { - new_topology = ast_stream_topology_create(); + new_topology = ast_stream_topology_alloc(); } else { new_topology = topology; } 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; } } |