40#define _stream_maps_to_str(_mapname, _value) \
42 const char *_rtn = ""; \
43 if (ARRAY_IN_BOUNDS(_value, _mapname)) { \
44 _rtn = _mapname[_value]; \
116#define ast_stream_state_to_str(stream_state) _stream_maps_to_str(ast_stream_state_map, stream_state)
244#define ast_stream_codec_param_to_str(value) _stream_maps_to_str(ast_stream_codec_negotiation_params_map, value)
254#define ast_stream_codec_prefer_to_str(value) _stream_maps_to_str(ast_stream_codec_negotiation_prefer_map, value)
264#define ast_stream_codec_operation_to_str(value) _stream_maps_to_str(ast_stream_codec_negotiation_operation_map, value)
274#define ast_stream_codec_keep_to_str(value) _stream_maps_to_str(ast_stream_codec_negotiation_keep_map, value)
284#define ast_stream_codec_transcode_to_str(value) _stream_maps_to_str(ast_stream_codec_negotiation_transcode_map, value)
307#define AST_STREAM_MAX_CODEC_PREFS_LENGTH (128)
360 struct ast_str **error_message);
487#define ast_stream_to_stra(__stream) ast_str_tmp(128, ast_stream_to_str(__stream, &STR_TMP))
658 struct ast_str **error_message);
970 struct ast_str **error_message);
983#define ast_stream_topology_to_stra(__topology) ast_str_tmp(256, ast_stream_topology_to_str(__topology, &STR_TMP))
ast_media_type
Types of media.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
struct ast_rtp_codecs * ast_stream_get_rtp_codecs(const struct ast_stream *stream)
Get rtp_codecs associated with the stream.
void ast_stream_set_rtp_codecs(struct ast_stream *stream, struct ast_rtp_codecs *rtp_codecs)
Set rtp_codecs associated with the stream.
const char * ast_stream_codec_negotiation_operation_map[CODEC_NEGOTIATION_OPERATION_END]
"operation" enum to string map
const char * ast_stream_codec_negotiation_prefer_map[CODEC_NEGOTIATION_PREFER_END]
"prefer" enum to string map
const char * ast_stream_to_str(const struct ast_stream *stream, struct ast_str **buf)
Get a string representing the stream for debugging/display purposes.
struct ast_stream * ast_stream_alloc(const char *name, enum ast_media_type type)
Create a new media stream representation.
int ast_stream_topology_set_stream(struct ast_stream_topology *topology, unsigned int position, struct ast_stream *stream)
Set a specific position in a topology.
const char * ast_stream_get_metadata(const struct ast_stream *stream, const char *m_key)
Get a stream metadata value.
struct ast_format_cap * ast_stream_topology_get_formats_by_type(struct ast_stream_topology *topology, enum ast_media_type type)
Create a format capabilities structure containing all the formats from all the streams of a particula...
struct ast_stream_topology * ast_stream_topology_create_resolved(struct ast_stream_topology *pending_topology, struct ast_stream_topology *validation_topology, struct ast_stream_codec_negotiation_prefs *prefs, struct ast_str **error_message)
Create a resolved stream topology from 2 topologies.
const char * ast_stream_get_name(const struct ast_stream *stream)
Get the name of a stream.
ast_stream_codec_negotiation_prefs_operation_values
The "operation" values.
@ CODEC_NEGOTIATION_OPERATION_ONLY_PREFERRED
@ CODEC_NEGOTIATION_OPERATION_UNSPECIFIED
@ CODEC_NEGOTIATION_OPERATION_ONLY_NONPREFERRED
@ CODEC_NEGOTIATION_OPERATION_UNION
@ CODEC_NEGOTIATION_OPERATION_END
@ CODEC_NEGOTIATION_OPERATION_INTERSECT
int ast_stream_set_metadata(struct ast_stream *stream, const char *m_key, const char *value)
Set a stream metadata value.
ast_stream_state
States that a stream may be in.
@ AST_STREAM_STATE_RECVONLY
Set when the stream is receiving media only.
@ AST_STREAM_STATE_END
Sentinel.
@ AST_STREAM_STATE_INACTIVE
Set when the stream is not sending OR receiving media.
@ AST_STREAM_STATE_REMOVED
Set when the stream has been removed/declined.
@ AST_STREAM_STATE_SENDRECV
Set when the stream is sending and receiving media.
@ AST_STREAM_STATE_SENDONLY
Set when the stream is sending media only.
int ast_stream_get_position(const struct ast_stream *stream)
Get the position of the stream in the topology.
const char * ast_stream_state2str(enum ast_stream_state state)
Convert the state of a stream into a string.
void(* ast_stream_data_free_fn)(void *)
void ast_stream_set_state(struct ast_stream *stream, enum ast_stream_state state)
Set the state of a stream.
int ast_stream_topology_append_stream(struct ast_stream_topology *topology, struct ast_stream *stream)
Append a stream to the topology.
const char * ast_stream_topology_to_str(const struct ast_stream_topology *topology, struct ast_str **buf)
Get a string representing the topology for debugging/display purposes.
ast_stream_codec_negotiation_prefs_keep_values
The "keep" values.
@ CODEC_NEGOTIATION_KEEP_FIRST
@ CODEC_NEGOTIATION_KEEP_UNSPECIFIED
@ CODEC_NEGOTIATION_KEEP_END
@ CODEC_NEGOTIATION_KEEP_ALL
struct ast_stream * ast_stream_clone(const struct ast_stream *stream, const char *name)
Create a deep clone of an existing stream.
enum ast_stream_state ast_stream_str2state(const char *str)
Convert a string to a stream state.
int ast_stream_codec_prefs_parse(const char *pref_string, struct ast_stream_codec_negotiation_prefs *prefs, struct ast_str **error_message)
Parses a string representing the codec prefs into a ast_stream_codec_negotiation_pref structure.
struct ast_stream * ast_stream_topology_get_stream(const struct ast_stream_topology *topology, unsigned int position)
Get a specific stream from the topology.
int ast_stream_topology_get_count(const struct ast_stream_topology *topology)
Get the number of streams in a topology.
int ast_stream_get_format_count(const struct ast_stream *stream)
Get the count of the current negotiated formats of a stream.
enum ast_stream_state ast_stream_get_state(const struct ast_stream *stream)
Get the current state of a stream.
int ast_stream_topology_del_stream(struct ast_stream_topology *topology, unsigned int position)
Delete a specified stream from the given topology.
int ast_stream_get_group(const struct ast_stream *stream)
Get the stream group that a stream is part of.
const char * ast_stream_codec_negotiation_transcode_map[CODEC_NEGOTIATION_TRANSCODE_END]
"transcode" state enum to string map
enum ast_media_type ast_stream_get_type(const struct ast_stream *stream)
Get the media type of a stream.
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
const char * ast_stream_codec_negotiation_keep_map[CODEC_NEGOTIATION_KEEP_END]
"keep" enum to string map
void ast_stream_set_formats(struct ast_stream *stream, struct ast_format_cap *caps)
Set the current negotiated formats of a stream.
int ast_stream_topology_get_active_count(const struct ast_stream_topology *topology)
Get the number of active (non-REMOVED) streams in a topology.
void ast_stream_set_type(struct ast_stream *stream, enum ast_media_type type)
Change the media type of a stream.
const char * ast_stream_codec_prefs_to_str(const struct ast_stream_codec_negotiation_prefs *prefs, struct ast_str **buf)
Return a string representing the codec preferences.
ast_stream_codec_negotiation_prefs_transcode_values
The "transcode" values.
@ CODEC_NEGOTIATION_TRANSCODE_UNSPECIFIED
@ CODEC_NEGOTIATION_TRANSCODE_END
@ CODEC_NEGOTIATION_TRANSCODE_PREVENT
@ CODEC_NEGOTIATION_TRANSCODE_ALLOW
struct ast_stream_topology * ast_stream_topology_create_from_format_cap(struct ast_format_cap *cap)
A helper function that, given a format capabilities structure, creates a topology and separates the m...
struct ast_variable * ast_stream_get_metadata_list(const struct ast_stream *stream)
Get all stream metadata keys.
ast_stream_codec_negotiation_params
Advanced Codec Negotiation Preferences.
@ CODEC_NEGOTIATION_PARAM_PREFER
@ CODEC_NEGOTIATION_PARAM_TRANSCODE
@ CODEC_NEGOTIATION_PARAM_KEEP
@ CODEC_NEGOTIATION_PARAM_END
@ CODEC_NEGOTIATION_PARAM_OPERATION
@ CODEC_NEGOTIATION_PARAM_UNSPECIFIED
const char * ast_stream_state_map[AST_STREAM_STATE_END]
Stream state enum to string map.
struct ast_format_cap * ast_stream_topology_get_formats(struct ast_stream_topology *topology)
Create a format capabilities structure representing the topology.
void ast_stream_free(struct ast_stream *stream)
Destroy a media stream representation.
void ast_stream_set_group(struct ast_stream *stream, int group)
Set the stream group for a stream.
void ast_stream_topology_map(const struct ast_stream_topology *topology, struct ast_vector_int *types, struct ast_vector_int *v0, struct ast_vector_int *v1)
Map a given topology's streams to the given types.
const struct ast_format_cap * ast_stream_get_formats(const struct ast_stream *stream)
Get the current negotiated formats of a stream.
const char * ast_stream_codec_negotiation_params_map[CODEC_NEGOTIATION_PARAM_END]
Preference enum to string map.
int ast_stream_topology_equal(const struct ast_stream_topology *left, const struct ast_stream_topology *right)
Compare two stream topologies to see if they are equal.
struct ast_stream * ast_stream_create_resolved(struct ast_stream *pending_stream, struct ast_stream *configured_stream, struct ast_stream_codec_negotiation_prefs *prefs, struct ast_str **error_message)
Create a resolved stream from 2 streams.
struct ast_stream_topology * ast_stream_topology_clone(const struct ast_stream_topology *topology)
Create a deep clone of an existing stream topology.
ast_stream_codec_negotiation_prefs_prefer_values
The "prefer" values.
@ CODEC_NEGOTIATION_PREFER_CONFIGURED
@ CODEC_NEGOTIATION_PREFER_UNSPECIFIED
@ CODEC_NEGOTIATION_PREFER_PENDING
@ CODEC_NEGOTIATION_PREFER_END
struct ast_stream * ast_stream_topology_get_first_stream_by_type(const struct ast_stream_topology *topology, enum ast_media_type type)
Gets the first active stream of a specific type from the topology.
Support for dynamic strings.
enum ast_stream_codec_negotiation_prefs_transcode_values transcode
enum ast_stream_codec_negotiation_prefs_operation_values operation
enum ast_stream_codec_negotiation_prefs_keep_values keep
enum ast_stream_codec_negotiation_prefs_prefer_values prefer
unsigned int position
The position of the stream in the topology.
Structure for variables, used for configurations and for channel variables.
Integer vector definition.
Vector container support.