Changeset a46e56b in mainline for uspace/app/wavplay
- Timestamp:
- 2018-03-22T06:49:35Z (8 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)
- Location:
- uspace/app/wavplay
- Files:
-
- 2 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 -
uspace/app/wavplay/drec.c
r3e242d2 ra46e56b 86 86 87 87 /** 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 */ 96 static 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); 96 100 record_t *rec = arg; 97 101 const size_t buffer_part = rec->buffer.size / BUFFER_PARTS; … … 99 103 while (record) { 100 104 ipc_call_t call; 101 cap_call_handle_t c allid= async_get_call(&call);105 cap_call_handle_t chandle = async_get_call(&call); 102 106 switch(IPC_GET_IMETHOD(call)) { 103 107 case PCM_EVENT_CAPTURE_TERMINATED: … … 110 114 default: 111 115 printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call)); 112 async_answer_0(c allid, ENOTSUP);116 async_answer_0(chandle, ENOTSUP); 113 117 continue; 114 118 } 115 119 116 120 if (!record) { 117 async_answer_0(c allid, EOK);121 async_answer_0(chandle, EOK); 118 122 break; 119 123 } … … 127 131 if (rec->buffer.position >= (rec->buffer.base + rec->buffer.size)) 128 132 rec->buffer.position = rec->buffer.base; 129 async_answer_0(c allid, EOK);133 async_answer_0(chandle, EOK); 130 134 } 131 135 }
Note:
See TracChangeset
for help on using the changeset viewer.
