Changeset a46e56b in mainline for uspace/app/wavplay


Ignore:
Timestamp:
2018-03-22T06:49:35Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77f0a1d
Parents:
3e242d2
git-author:
Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
git-committer:
Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
Message:

Prefer handle over ID in naming handle variables

Location:
uspace/app/wavplay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/dplay.c

    r3e242d2 ra46e56b  
    9090/**
    9191 * Fragment playback callback function.
    92  * @param iid IPC call id.
    93  * @param icall Pointer to the call structure
    94  * @param arg Argument, pointer to the playback helper function
    95  */
    96 static void device_event_callback(cap_call_handle_t iid, ipc_call_t *icall, void* arg)
    97 {
    98         async_answer_0(iid, EOK);
     92 *
     93 * @param icall_handle  Call capability handle.
     94 * @param icall         Pointer to the call structure
     95 * @param arg           Argument, pointer to the playback helper function
     96 */
     97static void device_event_callback(cap_call_handle_t icall_handle,
     98    ipc_call_t *icall, void *arg)
     99{
     100        async_answer_0(icall_handle, EOK);
    99101        playback_t *pb = arg;
    100102        const size_t fragment_size = pb->buffer.size / DEFAULT_FRAGMENTS;
    101103        while (1) {
    102104                ipc_call_t call;
    103                 cap_call_handle_t callid = async_get_call(&call);
     105                cap_call_handle_t chandle = async_get_call(&call);
    104106                switch(IPC_GET_IMETHOD(call)) {
    105107                case PCM_EVENT_PLAYBACK_STARTED:
    106108                case PCM_EVENT_FRAMES_PLAYED:
    107109                        printf("%" PRIun " frames: ", IPC_GET_ARG1(call));
    108                         async_answer_0(callid, EOK);
     110                        async_answer_0(chandle, EOK);
    109111                        break;
    110112                case PCM_EVENT_PLAYBACK_TERMINATED:
     
    113115                        pb->playing = false;
    114116                        fibril_condvar_signal(&pb->cv);
    115                         async_answer_0(callid, EOK);
     117                        async_answer_0(chandle, EOK);
    116118                        fibril_mutex_unlock(&pb->mutex);
    117119                        return;
    118120                default:
    119121                        printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call));
    120                         async_answer_0(callid, ENOTSUP);
     122                        async_answer_0(chandle, ENOTSUP);
    121123                        continue;
    122124
  • uspace/app/wavplay/drec.c

    r3e242d2 ra46e56b  
    8686
    8787/**
    88  * Recording callback. Writes recorded data.
    89  * @param iid IPC call id.
    90  * @param icall Poitner to IPC call structure.
    91  * @param arg Argument. Poitner to recording helper structure.
    92  */
    93 static void device_event_callback(cap_call_handle_t iid, ipc_call_t *icall, void* arg)
    94 {
    95         async_answer_0(iid, EOK);
     88 * Recording callback.
     89 *
     90 * Writes recorded data.
     91 *
     92 * @param icall_handle  IPC call id.
     93 * @param icall         Poitner to IPC call structure.
     94 * @param arg           Argument. Poitner to recording helper structure.
     95 */
     96static void device_event_callback(cap_call_handle_t icall_handle,
     97    ipc_call_t *icall, void *arg)
     98{
     99        async_answer_0(icall_handle, EOK);
    96100        record_t *rec = arg;
    97101        const size_t buffer_part = rec->buffer.size / BUFFER_PARTS;
     
    99103        while (record) {
    100104                ipc_call_t call;
    101                 cap_call_handle_t callid = async_get_call(&call);
     105                cap_call_handle_t chandle = async_get_call(&call);
    102106                switch(IPC_GET_IMETHOD(call)) {
    103107                case PCM_EVENT_CAPTURE_TERMINATED:
     
    110114                default:
    111115                        printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call));
    112                         async_answer_0(callid, ENOTSUP);
     116                        async_answer_0(chandle, ENOTSUP);
    113117                        continue;
    114118                }
    115119
    116120                if (!record) {
    117                         async_answer_0(callid, EOK);
     121                        async_answer_0(chandle, EOK);
    118122                        break;
    119123                }
     
    127131                if (rec->buffer.position >= (rec->buffer.base + rec->buffer.size))
    128132                        rec->buffer.position = rec->buffer.base;
    129                 async_answer_0(callid, EOK);
     133                async_answer_0(chandle, EOK);
    130134        }
    131135}
Note: See TracChangeset for help on using the changeset viewer.