Changeset fa91c0f in mainline
- Timestamp:
- 2012-08-19T16:08:14Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ba95ba
- Parents:
- d86c9736
- Location:
- uspace/lib/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm.c
rd86c9736 rfa91c0f 49 49 IPC_M_AUDIO_PCM_GET_BUFFER, 50 50 IPC_M_AUDIO_PCM_RELEASE_BUFFER, 51 IPC_M_AUDIO_PCM_GET_BUFFER_POS, 51 52 IPC_M_AUDIO_PCM_START_PLAYBACK, 52 53 IPC_M_AUDIO_PCM_STOP_PLAYBACK, … … 113 114 return EINVAL; 114 115 async_exch_t *exch = async_exchange_begin(sess); 115 sysarg_t value = *val;116 sysarg_t value = 0; 116 117 const int ret = async_req_2_1(exch, 117 118 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_QUERY_CAPS, 118 value, &value);119 cap, &value); 119 120 if (ret == EOK) 120 121 *val = value; 122 async_exchange_end(exch); 123 return ret; 124 } 125 126 int audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos) 127 { 128 if (!pos) 129 return EINVAL; 130 async_exch_t *exch = async_exchange_begin(sess); 131 sysarg_t value = 0;; 132 const int ret = async_req_1_1(exch, 133 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 134 IPC_M_AUDIO_PCM_GET_BUFFER_POS, &value); 135 if (ret == EOK) 136 *pos = value; 137 async_exchange_end(exch); 121 138 return ret; 122 139 } … … 248 265 static void remote_audio_pcm_get_info_str(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 249 266 static void remote_audio_pcm_query_caps(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 267 static void remote_audio_pcm_get_buffer_pos(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 250 268 static void remote_audio_pcm_test_format(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 251 269 static void remote_audio_pcm_get_buffer(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 260 278 [IPC_M_AUDIO_PCM_GET_INFO_STR] = remote_audio_pcm_get_info_str, 261 279 [IPC_M_AUDIO_PCM_QUERY_CAPS] = remote_audio_pcm_query_caps, 280 [IPC_M_AUDIO_PCM_GET_BUFFER_POS] = remote_audio_pcm_get_buffer_pos, 262 281 [IPC_M_AUDIO_PCM_TEST_FORMAT] = remote_audio_pcm_test_format, 263 282 [IPC_M_AUDIO_PCM_GET_BUFFER] = remote_audio_pcm_get_buffer, … … 315 334 async_answer_0(callid, ENOTSUP); 316 335 } 336 } 337 void remote_audio_pcm_get_buffer_pos(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 338 { 339 const audio_pcm_iface_t *pcm_iface = iface; 340 size_t pos = 0; 341 const int ret = pcm_iface->get_buffer_pos ? 342 pcm_iface->get_buffer_pos(fun, &pos) : ENOTSUP; 343 async_answer_1(callid, ret, pos); 317 344 } 318 345 -
uspace/lib/drv/include/audio_pcm_iface.h
rd86c9736 rfa91c0f 71 71 pcm_sample_format_t *); 72 72 int audio_pcm_query_cap(audio_pcm_sess_t *, audio_cap_t, unsigned *); 73 int audio_pcm_get_buffer_pos(audio_pcm_sess_t *, size_t *); 73 74 74 75 int audio_pcm_get_buffer(audio_pcm_sess_t *, void **, size_t *, … … 90 91 pcm_sample_format_t *); 91 92 unsigned (*query_cap)(ddf_fun_t *, audio_cap_t); 93 int (*get_buffer_pos)(ddf_fun_t *, size_t *); 92 94 int (*get_buffer)(ddf_fun_t *, void **, size_t *); 93 95 int (*release_buffer)(ddf_fun_t *);
Note:
See TracChangeset
for help on using the changeset viewer.