Changeset a46e56b in mainline for uspace/app/wavplay/dplay.c
- Timestamp:
- 2018-03-22T06:49:35Z (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r3e242d2 ra46e56b 90 90 /** 91 91 * 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 */ 97 static 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); 99 101 playback_t *pb = arg; 100 102 const size_t fragment_size = pb->buffer.size / DEFAULT_FRAGMENTS; 101 103 while (1) { 102 104 ipc_call_t call; 103 cap_call_handle_t c allid= async_get_call(&call);105 cap_call_handle_t chandle = async_get_call(&call); 104 106 switch(IPC_GET_IMETHOD(call)) { 105 107 case PCM_EVENT_PLAYBACK_STARTED: 106 108 case PCM_EVENT_FRAMES_PLAYED: 107 109 printf("%" PRIun " frames: ", IPC_GET_ARG1(call)); 108 async_answer_0(c allid, EOK);110 async_answer_0(chandle, EOK); 109 111 break; 110 112 case PCM_EVENT_PLAYBACK_TERMINATED: … … 113 115 pb->playing = false; 114 116 fibril_condvar_signal(&pb->cv); 115 async_answer_0(c allid, EOK);117 async_answer_0(chandle, EOK); 116 118 fibril_mutex_unlock(&pb->mutex); 117 119 return; 118 120 default: 119 121 printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call)); 120 async_answer_0(c allid, ENOTSUP);122 async_answer_0(chandle, ENOTSUP); 121 123 continue; 122 124
Note:
See TracChangeset
for help on using the changeset viewer.