Changeset 90f05b0f in mainline


Ignore:
Timestamp:
2012-07-09T07:46:24Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
68d1313
Parents:
0336354a
Message:

Rename audio pcm interface.

Location:
uspace
Files:
6 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/dplay/dplay.c

    r0336354a r90f05b0f  
    3939#include <str.h>
    4040#include <devman.h>
    41 #include <audio_pcm_buffer_iface.h>
     41#include <audio_pcm_iface.h>
    4242#include <fibril_synch.h>
    4343#include <stdio.h>
     
    126126        printf("Buffer data ready.\n");
    127127        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,
    129129            SUBBUFFERS, sampling_rate, sample_size, channels, sign);
    130130        if (ret != EOK) {
     
    137137            fibril_condvar_wait(&pb->cv, &pb->mutex));
    138138
    139         audio_pcm_buffer_stop_playback(pb->device, pb->buffer.id);
     139        audio_pcm_stop_playback(pb->device, pb->buffer.id);
    140140        fibril_condvar_wait(&pb->cv, &pb->mutex);
    141141        printf("\n");
     
    181181        }
    182182        const char* info = NULL;
    183         ret = audio_pcm_buffer_get_info_str(exch, &info);
     183        ret = audio_pcm_get_info_str(exch, &info);
    184184        if (ret != EOK) {
    185185                printf("Failed to get PCM info.\n");
     
    192192        playback_initialize(&pb, exch);
    193193
    194         ret = audio_pcm_buffer_get_buffer(pb.device, &pb.buffer.base,
     194        ret = audio_pcm_get_buffer(pb.device, &pb.buffer.base,
    195195            &pb.buffer.size, &pb.buffer.id, device_event_callback, &pb);
    196196        if (ret != EOK) {
     
    228228cleanup:
    229229        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);
    231231close_session:
    232232        async_exchange_end(exch);
  • uspace/app/drec/drec.c

    r0336354a r90f05b0f  
    3939#include <str.h>
    4040#include <devman.h>
    41 #include <audio_pcm_buffer_iface.h>
     41#include <audio_pcm_iface.h>
    4242#include <fibril_synch.h>
    4343#include <stdio.h>
     
    112112        printf("Recording: %dHz, %d-bit %ssigned samples, %d channel(s).\n",
    113113            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,
    115115            SUBBUFFERS, sampling_rate, sample_size, channels, sign);
    116116        if (ret != EOK) {
     
    121121        getchar();
    122122        printf("\n");
    123         audio_pcm_buffer_stop_record(rec->device, rec->buffer.id);
     123        audio_pcm_stop_record(rec->device, rec->buffer.id);
    124124}
    125125
     
    163163        }
    164164        const char* info = NULL;
    165         ret = audio_pcm_buffer_get_info_str(exch, &info);
     165        ret = audio_pcm_get_info_str(exch, &info);
    166166        if (ret != EOK) {
    167167                printf("Failed to get PCM info.\n");
     
    174174        record_initialize(&rec, exch);
    175175
    176         ret = audio_pcm_buffer_get_buffer(rec.device, &rec.buffer.base,
     176        ret = audio_pcm_get_buffer(rec.device, &rec.buffer.base,
    177177            &rec.buffer.size, &rec.buffer.id, device_event_callback, &rec);
    178178        if (ret != EOK) {
     
    211211cleanup:
    212212        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);
    214214close_session:
    215215        async_exchange_end(exch);
  • uspace/drv/audio/sb16/pcm_iface.c

    r0336354a r90f05b0f  
    3535#include <async.h>
    3636#include <errno.h>
    37 #include <audio_pcm_buffer_iface.h>
     37#include <audio_pcm_iface.h>
    3838
    3939#include "dsp.h"
     
    106106}
    107107
    108 audio_pcm_buffer_iface_t sb_pcm_iface = {
     108audio_pcm_iface_t sb_pcm_iface = {
    109109        .get_info_str = sb_get_info_str,
    110110
  • uspace/drv/audio/sb16/sb16.c

    r0336354a r90f05b0f  
    3030#include <str_error.h>
    3131#include <audio_mixer_iface.h>
    32 #include <audio_pcm_buffer_iface.h>
     32#include <audio_pcm_iface.h>
    3333
    3434#include "ddf_log.h"
     
    3838
    3939extern audio_mixer_iface_t sb_mixer_iface;
    40 extern audio_pcm_buffer_iface_t sb_pcm_iface;
     40extern audio_pcm_iface_t sb_pcm_iface;
    4141
    4242static ddf_dev_ops_t sb_mixer_ops = {
  • uspace/lib/drv/Makefile

    r0336354a r90f05b0f  
    3939        generic/logbuf.c \
    4040        generic/remote_audio_mixer.c \
    41         generic/remote_audio_pcm_buffer.c \
     41        generic/remote_audio_pcm.c \
    4242        generic/remote_hw_res.c \
    4343        generic/remote_char_dev.c \
  • uspace/lib/drv/generic/dev_iface.c

    r0336354a r90f05b0f  
    4747#include "remote_pci.h"
    4848#include "remote_audio_mixer.h"
    49 #include "remote_audio_pcm_buffer.h"
     49#include "remote_audio_pcm.h"
    5050
    5151static const iface_dipatch_table_t remote_ifaces = {
    5252        .ifaces = {
    5353                [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,
    5555                [HW_RES_DEV_IFACE] = &remote_hw_res_iface,
    5656                [CHAR_DEV_IFACE] = &remote_char_dev_iface,
  • uspace/lib/drv/generic/remote_audio_pcm.c

    r0336354a r90f05b0f  
    11/*
    2  * Copyright (c) 2011 Jan Vesely
     2 * Copyright (c) 2012 Jan Vesely
    33 * All rights reserved.
    44 *
     
    3939#include <sys/mman.h>
    4040
    41 #include "audio_pcm_buffer_iface.h"
     41#include "audio_pcm_iface.h"
    4242#include "ddf/driver.h"
    4343
     
    5555 * CLIENT SIDE
    5656 */
    57 int audio_pcm_buffer_get_info_str(async_exch_t *exch, const char **name)
     57int audio_pcm_get_info_str(async_exch_t *exch, const char **name)
    5858{
    5959        if (!exch)
     
    8282}
    8383
    84 int audio_pcm_buffer_get_buffer(async_exch_t *exch, void **buffer, size_t *size,
     84int audio_pcm_get_buffer(async_exch_t *exch, void **buffer, size_t *size,
    8585    unsigned *id, async_client_conn_t event_rec, void* arg)
    8686{
     
    110110}
    111111
    112 int audio_pcm_buffer_release_buffer(async_exch_t *exch, unsigned id)
     112int audio_pcm_release_buffer(async_exch_t *exch, unsigned id)
    113113{
    114114        if (!exch)
     
    118118}
    119119
    120 int audio_pcm_buffer_start_playback(async_exch_t *exch, unsigned id,
     120int audio_pcm_start_playback(async_exch_t *exch, unsigned id,
    121121    unsigned parts, unsigned sample_rate, uint16_t sample_size,
    122122    uint8_t channels, bool sign)
     
    131131}
    132132
    133 int audio_pcm_buffer_stop_playback(async_exch_t *exch, unsigned id)
     133int audio_pcm_stop_playback(async_exch_t *exch, unsigned id)
    134134{
    135135        if (!exch)
     
    139139}
    140140
    141 int audio_pcm_buffer_start_record(async_exch_t *exch, unsigned id,
     141int audio_pcm_start_record(async_exch_t *exch, unsigned id,
    142142    unsigned parts, unsigned sample_rate, uint16_t sample_size,
    143143    uint8_t channels, bool sign)
     
    152152}
    153153
    154 int audio_pcm_buffer_stop_record(async_exch_t *exch, unsigned id)
     154int audio_pcm_stop_record(async_exch_t *exch, unsigned id)
    155155{
    156156        if (!exch)
     
    183183
    184184/** Remote audio mixer interface structure. */
    185 remote_iface_t remote_audio_pcm_buffer_iface = {
     185remote_iface_t remote_audio_pcm_iface = {
    186186        .method_count = sizeof(remote_audio_pcm_iface_ops) /
    187187            sizeof(remote_audio_pcm_iface_ops[0]),
     
    192192    ipc_callid_t callid, ipc_call_t *call)
    193193{
    194         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     194        const audio_pcm_iface_t *pcm_iface = iface;
    195195
    196196        if (!pcm_iface->get_info_str) {
     
    221221    ipc_callid_t callid, ipc_call_t *call)
    222222{
    223         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     223        const audio_pcm_iface_t *pcm_iface = iface;
    224224
    225225        if (!pcm_iface->get_buffer ||
     
    294294    ipc_callid_t callid, ipc_call_t *call)
    295295{
    296         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     296        const audio_pcm_iface_t *pcm_iface = iface;
    297297
    298298        const unsigned id = DEV_IPC_GET_ARG1(*call);
     
    305305    ipc_callid_t callid, ipc_call_t *call)
    306306{
    307         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     307        const audio_pcm_iface_t *pcm_iface = iface;
    308308
    309309        const unsigned id = DEV_IPC_GET_ARG1(*call);
     
    323323    ipc_callid_t callid, ipc_call_t *call)
    324324{
    325         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     325        const audio_pcm_iface_t *pcm_iface = iface;
    326326
    327327        const unsigned id = DEV_IPC_GET_ARG1(*call);
     
    334334    ipc_callid_t callid, ipc_call_t *call)
    335335{
    336         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     336        const audio_pcm_iface_t *pcm_iface = iface;
    337337
    338338        const unsigned id = DEV_IPC_GET_ARG1(*call);
     
    352352    ipc_callid_t callid, ipc_call_t *call)
    353353{
    354         const audio_pcm_buffer_iface_t *pcm_iface = iface;
     354        const audio_pcm_iface_t *pcm_iface = iface;
    355355
    356356        const unsigned id = DEV_IPC_GET_ARG1(*call);
  • uspace/lib/drv/include/audio_pcm_iface.h

    r0336354a r90f05b0f  
    11/*
    2  * Copyright (c) 2011 Jan Vesely
     2 * Copyright (c) 2012 Jan Vesely
    33 * All rights reserved.
    44 *
     
    3434 */
    3535
    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_
    3838
    3939#include <async.h>
     
    4242#include "ddf/driver.h"
    4343
    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 *,
     44int audio_pcm_get_info_str(async_exch_t *, const char **);
     45int audio_pcm_get_buffer(async_exch_t *, void **, size_t *, unsigned *,
    4646    async_client_conn_t, void *);
    47 int audio_pcm_buffer_release_buffer(async_exch_t *, unsigned);
     47int audio_pcm_release_buffer(async_exch_t *, unsigned);
    4848
    49 int audio_pcm_buffer_start_playback(async_exch_t *, unsigned, unsigned,
     49int audio_pcm_start_playback(async_exch_t *, unsigned, unsigned,
    5050    unsigned, uint16_t, uint8_t, bool);
    51 int audio_pcm_buffer_stop_playback(async_exch_t *, unsigned);
     51int audio_pcm_stop_playback(async_exch_t *, unsigned);
    5252
    53 int audio_pcm_buffer_start_record(async_exch_t *, unsigned, unsigned,
     53int audio_pcm_start_record(async_exch_t *, unsigned, unsigned,
    5454    unsigned, uint16_t, uint8_t, bool);
    55 int audio_pcm_buffer_stop_record(async_exch_t *, unsigned);
     55int audio_pcm_stop_record(async_exch_t *, unsigned);
    5656
    5757/** Audio pcm communication interface. */
     
    6767            unsigned, unsigned, unsigned, bool);
    6868        int (*stop_record)(ddf_fun_t *, unsigned);
    69 } audio_pcm_buffer_iface_t;
     69} audio_pcm_iface_t;
    7070
    7171#endif
  • uspace/lib/drv/include/remote_audio_pcm.h

    r0336354a r90f05b0f  
    3535#define LIBDRV_REMOTE_AUDIO_PCM_H_
    3636
    37 extern remote_iface_t remote_audio_pcm_buffer_iface;
     37extern remote_iface_t remote_audio_pcm_iface;
    3838
    3939#endif
Note: See TracChangeset for help on using the changeset viewer.