Changeset a3ab774 in mainline for uspace/lib/drv/generic/remote_audio_pcm_buffer.c
- Timestamp:
- 2012-07-07T21:26:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e1b7e36
- Parents:
- ef246b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm_buffer.c
ref246b9 ra3ab774 140 140 141 141 int audio_pcm_buffer_start_record(async_exch_t *exch, unsigned id, 142 unsigned sample_rate, unsigned sample_size, unsigned channels, bool sign) 143 { 144 if (!exch || sample_size > UINT16_MAX || channels > (UINT16_MAX >> 1)) 145 return EINVAL; 146 sysarg_t packed = sample_size << 16 | channels << 1 | sign ? 1 : 0; 142 unsigned parts, unsigned sample_rate, uint16_t sample_size, 143 uint8_t channels, bool sign) 144 { 145 if (!exch) 146 return EINVAL; 147 sysarg_t packed = 148 (sample_size << 16) | (channels << 8) | 149 ((parts & 0x7f) << 1) | (sign ? 1 : 0); 147 150 return async_req_4_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 148 151 IPC_M_AUDIO_PCM_START_RECORD, id, sample_rate, packed); … … 336 339 const unsigned rate = DEV_IPC_GET_ARG2(*call); 337 340 const unsigned size = DEV_IPC_GET_ARG3(*call) >> 16; 338 const unsigned channels = (DEV_IPC_GET_ARG3(*call) & UINT16_MAX) >> 1; 341 const unsigned channels = (DEV_IPC_GET_ARG3(*call) >> 8) & UINT8_MAX; 342 const unsigned parts = (DEV_IPC_GET_ARG3(*call) >> 1) & 0x7f; 339 343 const bool sign = (bool)(DEV_IPC_GET_ARG3(*call) & 1); 340 344 341 345 const int ret = pcm_iface->start_record 342 ? pcm_iface->start_record(fun, id, rate, size, channels, sign)346 ? pcm_iface->start_record(fun, id, parts, rate, size, channels, sign) 343 347 : ENOTSUP; 344 348 async_answer_0(callid, ret);
Note:
See TracChangeset
for help on using the changeset viewer.