Changeset 2e01b3f in mainline for uspace/lib/drv/generic/remote_audio_pcm.c
- Timestamp:
- 2012-07-19T17:43:47Z (11 years ago)
- Branches:
- lfn, master, serial
- Children:
- f0241bda
- Parents:
- c5cbc1b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm.c
rc5cbc1b7 r2e01b3f 45 45 typedef enum { 46 46 IPC_M_AUDIO_PCM_GET_INFO_STR, 47 IPC_M_AUDIO_PCM_QUERY_CAPS, 47 48 IPC_M_AUDIO_PCM_TEST_FORMAT, 48 49 IPC_M_AUDIO_PCM_GET_BUFFER, … … 104 105 } 105 106 async_exchange_end(exch); 107 return ret; 108 } 109 110 int audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, unsigned *val) 111 { 112 if (!val) 113 return EINVAL; 114 async_exch_t *exch = async_exchange_begin(sess); 115 sysarg_t value = *val; 116 const int ret = async_req_2_1(exch, 117 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_QUERY_CAPS, 118 value, &value); 119 if (ret == EOK) 120 *val = value; 106 121 return ret; 107 122 } … … 232 247 */ 233 248 static void remote_audio_pcm_get_info_str(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 249 static void remote_audio_pcm_query_caps(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 234 250 static void remote_audio_pcm_test_format(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 235 251 static void remote_audio_pcm_get_buffer(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 243 259 static remote_iface_func_ptr_t remote_audio_pcm_iface_ops[] = { 244 260 [IPC_M_AUDIO_PCM_GET_INFO_STR] = remote_audio_pcm_get_info_str, 261 [IPC_M_AUDIO_PCM_QUERY_CAPS] = remote_audio_pcm_query_caps, 245 262 [IPC_M_AUDIO_PCM_TEST_FORMAT] = remote_audio_pcm_test_format, 246 263 [IPC_M_AUDIO_PCM_GET_BUFFER] = remote_audio_pcm_get_buffer, … … 288 305 } 289 306 290 static void remote_audio_pcm_test_format(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 307 void remote_audio_pcm_query_caps(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 308 { 309 const audio_pcm_iface_t *pcm_iface = iface; 310 const audio_cap_t cap = DEV_IPC_GET_ARG1(*call); 311 if (pcm_iface->query_cap) { 312 const unsigned value = pcm_iface->query_cap(fun, cap); 313 async_answer_1(callid, EOK, value); 314 } else { 315 async_answer_0(callid, ENOTSUP); 316 } 317 } 318 319 void remote_audio_pcm_test_format(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 291 320 { 292 321 const audio_pcm_iface_t *pcm_iface = iface;
Note: See TracChangeset
for help on using the changeset viewer.