Changeset 90f05b0f in mainline
- Timestamp:
- 2012-07-09T07:46:24Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68d1313
- Parents:
- 0336354a
- Location:
- uspace
- Files:
-
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dplay/dplay.c
r0336354a r90f05b0f 39 39 #include <str.h> 40 40 #include <devman.h> 41 #include <audio_pcm_ buffer_iface.h>41 #include <audio_pcm_iface.h> 42 42 #include <fibril_synch.h> 43 43 #include <stdio.h> … … 126 126 printf("Buffer data ready.\n"); 127 127 fibril_mutex_lock(&pb->mutex); 128 int ret = audio_pcm_ buffer_start_playback(pb->device, pb->buffer.id,128 int ret = audio_pcm_start_playback(pb->device, pb->buffer.id, 129 129 SUBBUFFERS, sampling_rate, sample_size, channels, sign); 130 130 if (ret != EOK) { … … 137 137 fibril_condvar_wait(&pb->cv, &pb->mutex)); 138 138 139 audio_pcm_ buffer_stop_playback(pb->device, pb->buffer.id);139 audio_pcm_stop_playback(pb->device, pb->buffer.id); 140 140 fibril_condvar_wait(&pb->cv, &pb->mutex); 141 141 printf("\n"); … … 181 181 } 182 182 const char* info = NULL; 183 ret = audio_pcm_ buffer_get_info_str(exch, &info);183 ret = audio_pcm_get_info_str(exch, &info); 184 184 if (ret != EOK) { 185 185 printf("Failed to get PCM info.\n"); … … 192 192 playback_initialize(&pb, exch); 193 193 194 ret = audio_pcm_ buffer_get_buffer(pb.device, &pb.buffer.base,194 ret = audio_pcm_get_buffer(pb.device, &pb.buffer.base, 195 195 &pb.buffer.size, &pb.buffer.id, device_event_callback, &pb); 196 196 if (ret != EOK) { … … 228 228 cleanup: 229 229 munmap(pb.buffer.base, pb.buffer.size); 230 audio_pcm_ buffer_release_buffer(exch, pb.buffer.id);230 audio_pcm_release_buffer(exch, pb.buffer.id); 231 231 close_session: 232 232 async_exchange_end(exch); -
uspace/app/drec/drec.c
r0336354a r90f05b0f 39 39 #include <str.h> 40 40 #include <devman.h> 41 #include <audio_pcm_ buffer_iface.h>41 #include <audio_pcm_iface.h> 42 42 #include <fibril_synch.h> 43 43 #include <stdio.h> … … 112 112 printf("Recording: %dHz, %d-bit %ssigned samples, %d channel(s).\n", 113 113 sampling_rate, sample_size, sign ? "": "un", channels); 114 int ret = audio_pcm_ buffer_start_record(rec->device, rec->buffer.id,114 int ret = audio_pcm_start_record(rec->device, rec->buffer.id, 115 115 SUBBUFFERS, sampling_rate, sample_size, channels, sign); 116 116 if (ret != EOK) { … … 121 121 getchar(); 122 122 printf("\n"); 123 audio_pcm_ buffer_stop_record(rec->device, rec->buffer.id);123 audio_pcm_stop_record(rec->device, rec->buffer.id); 124 124 } 125 125 … … 163 163 } 164 164 const char* info = NULL; 165 ret = audio_pcm_ buffer_get_info_str(exch, &info);165 ret = audio_pcm_get_info_str(exch, &info); 166 166 if (ret != EOK) { 167 167 printf("Failed to get PCM info.\n"); … … 174 174 record_initialize(&rec, exch); 175 175 176 ret = audio_pcm_ buffer_get_buffer(rec.device, &rec.buffer.base,176 ret = audio_pcm_get_buffer(rec.device, &rec.buffer.base, 177 177 &rec.buffer.size, &rec.buffer.id, device_event_callback, &rec); 178 178 if (ret != EOK) { … … 211 211 cleanup: 212 212 munmap(rec.buffer.base, rec.buffer.size); 213 audio_pcm_ buffer_release_buffer(exch, rec.buffer.id);213 audio_pcm_release_buffer(exch, rec.buffer.id); 214 214 close_session: 215 215 async_exchange_end(exch); -
uspace/drv/audio/sb16/pcm_iface.c
r0336354a r90f05b0f 35 35 #include <async.h> 36 36 #include <errno.h> 37 #include <audio_pcm_ buffer_iface.h>37 #include <audio_pcm_iface.h> 38 38 39 39 #include "dsp.h" … … 106 106 } 107 107 108 audio_pcm_ buffer_iface_t sb_pcm_iface = {108 audio_pcm_iface_t sb_pcm_iface = { 109 109 .get_info_str = sb_get_info_str, 110 110 -
uspace/drv/audio/sb16/sb16.c
r0336354a r90f05b0f 30 30 #include <str_error.h> 31 31 #include <audio_mixer_iface.h> 32 #include <audio_pcm_ buffer_iface.h>32 #include <audio_pcm_iface.h> 33 33 34 34 #include "ddf_log.h" … … 38 38 39 39 extern audio_mixer_iface_t sb_mixer_iface; 40 extern audio_pcm_ buffer_iface_t sb_pcm_iface;40 extern audio_pcm_iface_t sb_pcm_iface; 41 41 42 42 static ddf_dev_ops_t sb_mixer_ops = { -
uspace/lib/drv/Makefile
r0336354a r90f05b0f 39 39 generic/logbuf.c \ 40 40 generic/remote_audio_mixer.c \ 41 generic/remote_audio_pcm _buffer.c \41 generic/remote_audio_pcm.c \ 42 42 generic/remote_hw_res.c \ 43 43 generic/remote_char_dev.c \ -
uspace/lib/drv/generic/dev_iface.c
r0336354a r90f05b0f 47 47 #include "remote_pci.h" 48 48 #include "remote_audio_mixer.h" 49 #include "remote_audio_pcm _buffer.h"49 #include "remote_audio_pcm.h" 50 50 51 51 static const iface_dipatch_table_t remote_ifaces = { 52 52 .ifaces = { 53 53 [AUDIO_MIXER_IFACE] = &remote_audio_mixer_iface, 54 [AUDIO_PCM_BUFFER_IFACE] = &remote_audio_pcm_ buffer_iface,54 [AUDIO_PCM_BUFFER_IFACE] = &remote_audio_pcm_iface, 55 55 [HW_RES_DEV_IFACE] = &remote_hw_res_iface, 56 56 [CHAR_DEV_IFACE] = &remote_char_dev_iface, -
uspace/lib/drv/generic/remote_audio_pcm.c
r0336354a r90f05b0f 1 1 /* 2 * Copyright (c) 201 1Jan Vesely2 * Copyright (c) 2012 Jan Vesely 3 3 * All rights reserved. 4 4 * … … 39 39 #include <sys/mman.h> 40 40 41 #include "audio_pcm_ buffer_iface.h"41 #include "audio_pcm_iface.h" 42 42 #include "ddf/driver.h" 43 43 … … 55 55 * CLIENT SIDE 56 56 */ 57 int audio_pcm_ buffer_get_info_str(async_exch_t *exch, const char **name)57 int audio_pcm_get_info_str(async_exch_t *exch, const char **name) 58 58 { 59 59 if (!exch) … … 82 82 } 83 83 84 int audio_pcm_ buffer_get_buffer(async_exch_t *exch, void **buffer, size_t *size,84 int audio_pcm_get_buffer(async_exch_t *exch, void **buffer, size_t *size, 85 85 unsigned *id, async_client_conn_t event_rec, void* arg) 86 86 { … … 110 110 } 111 111 112 int audio_pcm_ buffer_release_buffer(async_exch_t *exch, unsigned id)112 int audio_pcm_release_buffer(async_exch_t *exch, unsigned id) 113 113 { 114 114 if (!exch) … … 118 118 } 119 119 120 int audio_pcm_ buffer_start_playback(async_exch_t *exch, unsigned id,120 int audio_pcm_start_playback(async_exch_t *exch, unsigned id, 121 121 unsigned parts, unsigned sample_rate, uint16_t sample_size, 122 122 uint8_t channels, bool sign) … … 131 131 } 132 132 133 int audio_pcm_ buffer_stop_playback(async_exch_t *exch, unsigned id)133 int audio_pcm_stop_playback(async_exch_t *exch, unsigned id) 134 134 { 135 135 if (!exch) … … 139 139 } 140 140 141 int audio_pcm_ buffer_start_record(async_exch_t *exch, unsigned id,141 int audio_pcm_start_record(async_exch_t *exch, unsigned id, 142 142 unsigned parts, unsigned sample_rate, uint16_t sample_size, 143 143 uint8_t channels, bool sign) … … 152 152 } 153 153 154 int audio_pcm_ buffer_stop_record(async_exch_t *exch, unsigned id)154 int audio_pcm_stop_record(async_exch_t *exch, unsigned id) 155 155 { 156 156 if (!exch) … … 183 183 184 184 /** Remote audio mixer interface structure. */ 185 remote_iface_t remote_audio_pcm_ buffer_iface = {185 remote_iface_t remote_audio_pcm_iface = { 186 186 .method_count = sizeof(remote_audio_pcm_iface_ops) / 187 187 sizeof(remote_audio_pcm_iface_ops[0]), … … 192 192 ipc_callid_t callid, ipc_call_t *call) 193 193 { 194 const audio_pcm_ buffer_iface_t *pcm_iface = iface;194 const audio_pcm_iface_t *pcm_iface = iface; 195 195 196 196 if (!pcm_iface->get_info_str) { … … 221 221 ipc_callid_t callid, ipc_call_t *call) 222 222 { 223 const audio_pcm_ buffer_iface_t *pcm_iface = iface;223 const audio_pcm_iface_t *pcm_iface = iface; 224 224 225 225 if (!pcm_iface->get_buffer || … … 294 294 ipc_callid_t callid, ipc_call_t *call) 295 295 { 296 const audio_pcm_ buffer_iface_t *pcm_iface = iface;296 const audio_pcm_iface_t *pcm_iface = iface; 297 297 298 298 const unsigned id = DEV_IPC_GET_ARG1(*call); … … 305 305 ipc_callid_t callid, ipc_call_t *call) 306 306 { 307 const audio_pcm_ buffer_iface_t *pcm_iface = iface;307 const audio_pcm_iface_t *pcm_iface = iface; 308 308 309 309 const unsigned id = DEV_IPC_GET_ARG1(*call); … … 323 323 ipc_callid_t callid, ipc_call_t *call) 324 324 { 325 const audio_pcm_ buffer_iface_t *pcm_iface = iface;325 const audio_pcm_iface_t *pcm_iface = iface; 326 326 327 327 const unsigned id = DEV_IPC_GET_ARG1(*call); … … 334 334 ipc_callid_t callid, ipc_call_t *call) 335 335 { 336 const audio_pcm_ buffer_iface_t *pcm_iface = iface;336 const audio_pcm_iface_t *pcm_iface = iface; 337 337 338 338 const unsigned id = DEV_IPC_GET_ARG1(*call); … … 352 352 ipc_callid_t callid, ipc_call_t *call) 353 353 { 354 const audio_pcm_ buffer_iface_t *pcm_iface = iface;354 const audio_pcm_iface_t *pcm_iface = iface; 355 355 356 356 const unsigned id = DEV_IPC_GET_ARG1(*call); -
uspace/lib/drv/include/audio_pcm_iface.h
r0336354a r90f05b0f 1 1 /* 2 * Copyright (c) 201 1Jan Vesely2 * Copyright (c) 2012 Jan Vesely 3 3 * All rights reserved. 4 4 * … … 34 34 */ 35 35 36 #ifndef LIBDRV_AUDIO_PCM_ BUFFER_IFACE_H_37 #define LIBDRV_AUDIO_PCM_ BUFFER_IFACE_H_36 #ifndef LIBDRV_AUDIO_PCM_IFACE_H_ 37 #define LIBDRV_AUDIO_PCM_IFACE_H_ 38 38 39 39 #include <async.h> … … 42 42 #include "ddf/driver.h" 43 43 44 int audio_pcm_ buffer_get_info_str(async_exch_t *, const char **);45 int audio_pcm_ buffer_get_buffer(async_exch_t *, void **, size_t *, unsigned *,44 int audio_pcm_get_info_str(async_exch_t *, const char **); 45 int audio_pcm_get_buffer(async_exch_t *, void **, size_t *, unsigned *, 46 46 async_client_conn_t, void *); 47 int audio_pcm_ buffer_release_buffer(async_exch_t *, unsigned);47 int audio_pcm_release_buffer(async_exch_t *, unsigned); 48 48 49 int audio_pcm_ buffer_start_playback(async_exch_t *, unsigned, unsigned,49 int audio_pcm_start_playback(async_exch_t *, unsigned, unsigned, 50 50 unsigned, uint16_t, uint8_t, bool); 51 int audio_pcm_ buffer_stop_playback(async_exch_t *, unsigned);51 int audio_pcm_stop_playback(async_exch_t *, unsigned); 52 52 53 int audio_pcm_ buffer_start_record(async_exch_t *, unsigned, unsigned,53 int audio_pcm_start_record(async_exch_t *, unsigned, unsigned, 54 54 unsigned, uint16_t, uint8_t, bool); 55 int audio_pcm_ buffer_stop_record(async_exch_t *, unsigned);55 int audio_pcm_stop_record(async_exch_t *, unsigned); 56 56 57 57 /** Audio pcm communication interface. */ … … 67 67 unsigned, unsigned, unsigned, bool); 68 68 int (*stop_record)(ddf_fun_t *, unsigned); 69 } audio_pcm_ buffer_iface_t;69 } audio_pcm_iface_t; 70 70 71 71 #endif -
uspace/lib/drv/include/remote_audio_pcm.h
r0336354a r90f05b0f 35 35 #define LIBDRV_REMOTE_AUDIO_PCM_H_ 36 36 37 extern remote_iface_t remote_audio_pcm_ buffer_iface;37 extern remote_iface_t remote_audio_pcm_iface; 38 38 39 39 #endif
Note:
See TracChangeset
for help on using the changeset viewer.