Logo Search packages:      
Sourcecode: pulseaudio version File versions

const char* pa_stream_get_device_name ( pa_stream s  ) 

Return the name 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_name() resp. pa_context_get_source_info_by_name(). 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.

Since:
0.9.8

Definition at line 2121 of file stream.c.

References PA_ERR_BADSTATE, PA_ERR_NOTSUPPORTED, PA_STREAM_READY, and PA_STREAM_UPLOAD.

                                                    {
    pa_assert(s);
    pa_assert(PA_REFCNT_VALUE(s) >= 1);

    PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED);
    PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->device_name, PA_ERR_BADSTATE);

    return s->device_name;
}


Generated by  Doxygen 1.6.0   Back to index