Return the index of the sink or source this stream is connected to in the server. This is useful for usage with the introspection functions, such as pa_context_get_sink_info_by_index() resp. pa_context_get_source_info_by_index(). Please note that streams may be moved between sinks/sources and thus it is recommended to use pa_stream_set_moved_callback() to be notified about this. This function will return with PA_ERR_NOTSUPPORTED when the server is older than 0.9.8.
Definition at line 2496 of file stream.c. References PA_ERR_BADSTATE, PA_ERR_FORKED, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX, PA_STREAM_READY, and PA_STREAM_UPLOAD. { pa_assert(s); pa_assert(PA_REFCNT_VALUE(s) >= 1); PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX); PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX); PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE, PA_INVALID_INDEX); PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX); PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->device_index != PA_INVALID_INDEX, PA_ERR_BADSTATE, PA_INVALID_INDEX); return s->device_index; }
|