Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

pa_operation* pa_context_proplist_update ( pa_context c,
pa_update_mode_t  mode,
pa_proplist *  p,
pa_context_success_cb_t  cb,
void *  userdata 
)

Update the property list of the client, adding new entries. Please note that it is highly recommended to set as much properties initially via pa_context_new_with_proplist() as possible instead a posteriori with this function, since that information may then be used to route streams of the client to the right device.

Since:
0.9.11

Definition at line 1341 of file context.c.

References PA_CONTEXT_READY, PA_ERR_BADSTATE, PA_ERR_FORKED, PA_ERR_INVALID, and PA_ERR_NOTSUPPORTED.

                                                                                                                                           {
    pa_operation *o;
    pa_tagstruct *t;
    uint32_t tag;

    pa_assert(c);
    pa_assert(PA_REFCNT_VALUE(c) >= 1);

    PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
    PA_CHECK_VALIDITY_RETURN_NULL(c, mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE, PA_ERR_INVALID);
    PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 13, PA_ERR_NOTSUPPORTED);

    o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);

    t = pa_tagstruct_command(c, PA_COMMAND_UPDATE_CLIENT_PROPLIST, &tag);
    pa_tagstruct_putu32(t, (uint32_t) mode);
    pa_tagstruct_put_proplist(t, p);

    pa_pstream_send_tagstruct(c->pstream, t);
    pa_pdispatch_register_reply(c->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);

    /* Please note that we don't update c->proplist here, because we
     * don't export that field */

    return o;
}


Generated by  Doxygen 1.6.0   Back to index