mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 16:20:37 +00:00
scope_trace: Add/update utilities
* Added a AST_STREAM_STATE_END sentinel * Add ast_stream_to_str() * Add ast_stream_state_to_str() * Add ast_stream_get_format_count() * Add ast_stream_topology_to_str() * Add ast_stream_topology_get_active_count() * Add ast_format_cap_append_names() * Add ast_sip_session_get_name() Change-Id: I132eb5971ea41509c660f64e9113cda8c9013b0b
This commit is contained in:
@@ -699,11 +699,19 @@ int ast_format_cap_identical(const struct ast_format_cap *cap1, const struct ast
|
||||
return internal_format_cap_identical(cap2, cap1);
|
||||
}
|
||||
|
||||
const char *ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
|
||||
static const char *__ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf, int append)
|
||||
{
|
||||
int i;
|
||||
|
||||
ast_str_set(buf, 0, "(");
|
||||
if (!buf || !*buf) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (append) {
|
||||
ast_str_append(buf, 0, "(");
|
||||
} else {
|
||||
ast_str_set(buf, 0, "(");
|
||||
}
|
||||
|
||||
if (!cap || !AST_VECTOR_SIZE(&cap->preference_order)) {
|
||||
ast_str_append(buf, 0, "nothing)");
|
||||
@@ -725,6 +733,16 @@ const char *ast_format_cap_get_names(const struct ast_format_cap *cap, struct as
|
||||
return ast_str_buffer(*buf);
|
||||
}
|
||||
|
||||
const char *ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
|
||||
{
|
||||
return __ast_format_cap_get_names(cap, buf, 0);
|
||||
}
|
||||
|
||||
const char *ast_format_cap_append_names(const struct ast_format_cap *cap, struct ast_str **buf)
|
||||
{
|
||||
return __ast_format_cap_get_names(cap, buf, 1);
|
||||
}
|
||||
|
||||
int ast_format_cap_empty(const struct ast_format_cap *cap)
|
||||
{
|
||||
int count = ast_format_cap_count(cap);
|
||||
|
||||
Reference in New Issue
Block a user