Changeset d86c9736 in mainline


Ignore:
Timestamp:
2012-08-19T14:35:32Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fa91c0f
Parents:
ad42844
Message:

Rename record → capture.

Location:
uspace
Files:
7 edited

Legend:

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

    rad42844 rd86c9736  
    8989                ipc_callid_t callid = async_get_call(&call);
    9090                switch(IPC_GET_IMETHOD(call)) {
    91                 case PCM_EVENT_FRAMES_RECORDED:
     91                case PCM_EVENT_FRAMES_CAPTURED:
    9292                        printf("%u frames\n", IPC_GET_ARG1(call));
    9393                        async_answer_0(callid, EOK);
    9494                        break;
    95                 case PCM_EVENT_RECORDING_TERMINATED:
     95                case PCM_EVENT_CAPTURE_TERMINATED:
    9696                        printf("Recording terminated\n");
    9797                        return;
     
    124124        const unsigned frames = rec->buffer.size /
    125125            (BUFFER_PARTS * channels * pcm_sample_format_size(format));
    126         int ret = audio_pcm_start_record(rec->device,
     126        int ret = audio_pcm_start_capture(rec->device,
    127127            frames, channels, sampling_rate, format);
    128128        if (ret != EOK) {
     
    133133        getchar();
    134134        printf("\n");
    135         audio_pcm_stop_record(rec->device);
     135        audio_pcm_stop_capture(rec->device);
    136136}
    137137
  • uspace/drv/audio/sb16/dsp.c

    rad42844 rd86c9736  
    215215        }
    216216
    217         if (dsp->status == DSP_RECORDING) {
     217        if (dsp->status == DSP_CAPTURE) {
    218218                sb_dsp_start_active(dsp, SINGLE_DMA_16B_AD);
    219219        }
     
    232232                            PCM_EVENT_FRAMES_PLAYED, dsp->active.frame_count);
    233233                        break;
    234                 case DSP_RECORDING:
     234                case DSP_CAPTURE:
    235235                        async_msg_1(dsp->event_exchange,
    236                             PCM_EVENT_FRAMES_RECORDED, dsp->active.frame_count);
     236                            PCM_EVENT_FRAMES_CAPTURED, dsp->active.frame_count);
    237237                        break;
    238238                default:
     
    251251{
    252252        switch(cap) {
    253         case AUDIO_CAP_RECORD:
     253        case AUDIO_CAP_CAPTURE:
    254254        case AUDIO_CAP_PLAYBACK:
    255255        case AUDIO_CAP_INTERRUPT:
     
    393393}
    394394
    395 int sb_dsp_start_record(sb_dsp_t *dsp, unsigned frames,
     395int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
    396396    unsigned channels, unsigned sampling_rate, pcm_sample_format_t format)
    397397{
     
    401401
    402402        /* Check supported parameters */
    403         ddf_log_debug("Requested record: %u frames, %uHz, %s, %u channel(s).",
     403        ddf_log_debug("Requested capture: %u frames, %uHz, %s, %u channel(s).",
    404404            frames, sampling_rate, pcm_sample_format_str(format), channels);
    405405        if (sb_dsp_test_format(dsp, &channels, &sampling_rate, &format) != EOK)
     
    433433            "(~1/%u sec)", dsp->active.samples,
    434434            sampling_rate / (dsp->active.samples * channels));
    435         dsp->status = DSP_RECORDING;
    436 
    437         return EOK;
    438 }
    439 
    440 int sb_dsp_stop_record(sb_dsp_t *dsp)
     435        dsp->status = DSP_CAPTURE;
     436
     437        return EOK;
     438}
     439
     440int sb_dsp_stop_capture(sb_dsp_t *dsp)
    441441{
    442442        assert(dsp);
    443443        sb_dsp_write(dsp, DMA_16B_EXIT);
    444         ddf_log_debug("Stopped recording");
    445         async_msg_0(dsp->event_exchange, PCM_EVENT_RECORDING_TERMINATED);
     444        ddf_log_debug("Stopped capture");
     445        async_msg_0(dsp->event_exchange, PCM_EVENT_CAPTURE_TERMINATED);
    446446        async_exchange_end(dsp->event_exchange);
    447447        dsp->event_exchange = NULL;
  • uspace/drv/audio/sb16/dsp.h

    rad42844 rd86c9736  
    6363        enum {
    6464                DSP_PLAYBACK,
    65                 DSP_RECORDING,
     65                DSP_CAPTURE,
    6666                DSP_STOPPED,
    6767        } status;
     
    8383    unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
    8484int sb_dsp_stop_playback(sb_dsp_t *dsp);
    85 int sb_dsp_start_record(sb_dsp_t *dsp, unsigned frames,
     85int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
    8686    unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
    87 int sb_dsp_stop_record(sb_dsp_t *dsp);
     87int sb_dsp_stop_capture(sb_dsp_t *dsp);
    8888
    8989#endif
  • uspace/drv/audio/sb16/pcm_iface.c

    rad42844 rd86c9736  
    104104}
    105105
    106 static int sb_start_record(ddf_fun_t *fun, unsigned frames,
     106static int sb_start_capture(ddf_fun_t *fun, unsigned frames,
    107107    unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
    108108{
     
    110110        assert(fun->driver_data);
    111111        sb_dsp_t *dsp = fun->driver_data;
    112         return sb_dsp_start_record(
     112        return sb_dsp_start_capture(
    113113            dsp, frames, channels, sample_rate, format);
    114114}
    115115
    116 static int sb_stop_record(ddf_fun_t *fun)
     116static int sb_stop_capture(ddf_fun_t *fun)
    117117{
    118118        assert(fun);
    119119        assert(fun->driver_data);
    120120        sb_dsp_t *dsp = fun->driver_data;
    121         return sb_dsp_stop_record(dsp);
     121        return sb_dsp_stop_capture(dsp);
    122122}
    123123
     
    134134        .stop_playback = sb_stop_playback,
    135135
    136         .start_record = sb_start_record,
    137         .stop_record = sb_stop_record
     136        .start_capture = sb_start_capture,
     137        .stop_capture = sb_stop_capture,
    138138};
    139139/**
  • uspace/lib/drv/generic/remote_audio_pcm.c

    rad42844 rd86c9736  
    5151        IPC_M_AUDIO_PCM_START_PLAYBACK,
    5252        IPC_M_AUDIO_PCM_STOP_PLAYBACK,
    53         IPC_M_AUDIO_PCM_START_RECORD,
    54         IPC_M_AUDIO_PCM_STOP_RECORD,
     53        IPC_M_AUDIO_PCM_START_CAPTURE,
     54        IPC_M_AUDIO_PCM_STOP_CAPTURE,
    5555} audio_pcm_iface_funcs_t;
    5656
     
    219219}
    220220
    221 int audio_pcm_start_record(audio_pcm_sess_t *sess, unsigned frames,
     221int audio_pcm_start_capture(audio_pcm_sess_t *sess, unsigned frames,
    222222    unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
    223223{
     
    228228        async_exch_t *exch = async_exchange_begin(sess);
    229229        const int ret = async_req_4_0(exch,
    230             DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_START_RECORD,
     230            DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_START_CAPTURE,
    231231            frames, sample_rate, packed);
    232232        async_exchange_end(exch);
     
    234234}
    235235
    236 int audio_pcm_stop_record(audio_pcm_sess_t *sess)
     236int audio_pcm_stop_capture(audio_pcm_sess_t *sess)
    237237{
    238238        async_exch_t *exch = async_exchange_begin(sess);
    239239        const int ret = async_req_1_0(exch,
    240             DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_STOP_RECORD);
     240            DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_STOP_CAPTURE);
    241241        async_exchange_end(exch);
    242242        return ret;
     
    253253static void remote_audio_pcm_start_playback(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    254254static void remote_audio_pcm_stop_playback(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    255 static void remote_audio_pcm_start_record(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    256 static void remote_audio_pcm_stop_record(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     255static void remote_audio_pcm_start_capture(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     256static void remote_audio_pcm_stop_capture(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    257257
    258258/** Remote audio pcm buffer interface operations. */
     
    265265        [IPC_M_AUDIO_PCM_START_PLAYBACK] = remote_audio_pcm_start_playback,
    266266        [IPC_M_AUDIO_PCM_STOP_PLAYBACK] = remote_audio_pcm_stop_playback,
    267         [IPC_M_AUDIO_PCM_START_RECORD] = remote_audio_pcm_start_record,
    268         [IPC_M_AUDIO_PCM_STOP_RECORD] = remote_audio_pcm_stop_record,
     267        [IPC_M_AUDIO_PCM_START_CAPTURE] = remote_audio_pcm_start_capture,
     268        [IPC_M_AUDIO_PCM_STOP_CAPTURE] = remote_audio_pcm_stop_capture,
    269269};
    270270
     
    436436}
    437437
    438 void remote_audio_pcm_start_record(ddf_fun_t *fun, void *iface,
     438void remote_audio_pcm_start_capture(ddf_fun_t *fun, void *iface,
    439439    ipc_callid_t callid, ipc_call_t *call)
    440440{
     
    446446        const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX;
    447447
    448         const int ret = pcm_iface->start_record
    449             ? pcm_iface->start_record(fun, frames, channels, rate, format)
     448        const int ret = pcm_iface->start_capture
     449            ? pcm_iface->start_capture(fun, frames, channels, rate, format)
    450450            : ENOTSUP;
    451451        async_answer_0(callid, ret);
    452452}
    453453
    454 void remote_audio_pcm_stop_record(ddf_fun_t *fun, void *iface,
     454void remote_audio_pcm_stop_capture(ddf_fun_t *fun, void *iface,
    455455    ipc_callid_t callid, ipc_call_t *call)
    456456{
    457457        const audio_pcm_iface_t *pcm_iface = iface;
    458458
    459         const int ret = pcm_iface->stop_record ?
    460             pcm_iface->stop_record(fun) : ENOTSUP;
     459        const int ret = pcm_iface->stop_capture ?
     460            pcm_iface->stop_capture(fun) : ENOTSUP;
    461461        async_answer_0(callid, ret);
    462462}
  • uspace/lib/drv/include/audio_pcm_iface.h

    rad42844 rd86c9736  
    4545
    4646typedef enum {
    47         AUDIO_CAP_RECORD,
     47        AUDIO_CAP_CAPTURE,
    4848        AUDIO_CAP_PLAYBACK,
    4949        AUDIO_CAP_MAX_BUFFER,
     
    5656enum {
    5757        PCM_EVENT_FRAMES_PLAYED = IPC_FIRST_USER_METHOD,
    58         PCM_EVENT_FRAMES_RECORDED,
     58        PCM_EVENT_FRAMES_CAPTURED,
    5959        PCM_EVENT_PLAYBACK_TERMINATED,
    60         PCM_EVENT_RECORDING_TERMINATED
     60        PCM_EVENT_CAPTURE_TERMINATED
    6161};
    6262
     
    8080int audio_pcm_stop_playback(audio_pcm_sess_t *);
    8181
    82 int audio_pcm_start_record(audio_pcm_sess_t *, unsigned,
     82int audio_pcm_start_capture(audio_pcm_sess_t *, unsigned,
    8383    unsigned, unsigned, pcm_sample_format_t);
    84 int audio_pcm_stop_record(audio_pcm_sess_t *);
     84int audio_pcm_stop_capture(audio_pcm_sess_t *);
    8585
    8686/** Audio pcm communication interface. */
     
    9696            unsigned, unsigned, pcm_sample_format_t);
    9797        int (*stop_playback)(ddf_fun_t *);
    98         int (*start_record)(ddf_fun_t *, unsigned,
     98        int (*start_capture)(ddf_fun_t *, unsigned,
    9999            unsigned, unsigned, pcm_sample_format_t);
    100         int (*stop_record)(ddf_fun_t *);
     100        int (*stop_capture)(ddf_fun_t *);
    101101} audio_pcm_iface_t;
    102102
  • uspace/srv/audio/hound/audio_device.c

    rad42844 rd86c9736  
    153153                const unsigned frames = dev->buffer.size /
    154154                    (BUFFER_PARTS * pcm_format_frame_size(&dev->sink.format));
    155                 ret = audio_pcm_start_record(dev->sess, frames,
     155                ret = audio_pcm_start_capture(dev->sess, frames,
    156156                    dev->sink.format.channels, dev->sink.format.sampling_rate,
    157157                    dev->sink.format.sample_format);
     
    163163                }
    164164        } else { /* Disconnected */
    165                 int ret = audio_pcm_stop_record(dev->sess);
     165                int ret = audio_pcm_stop_capture(dev->sess);
    166166                if (ret != EOK) {
    167167                        log_error("Failed to start recording: %s",
     
    208208                        break;
    209209                }
    210                 case PCM_EVENT_PLAYBACK_TERMINATED: {
     210                case PCM_EVENT_PLAYBACK_TERMINATED:
    211211                        log_verbose("Playback terminated!");
    212212                        return;
    213                 }
    214                 case PCM_EVENT_FRAMES_RECORDED: {
     213                case PCM_EVENT_FRAMES_CAPTURED:
    215214                        //TODO implement
    216215                        break;
    217                 }
    218                 case PCM_EVENT_RECORDING_TERMINATED:
     216                case PCM_EVENT_CAPTURE_TERMINATED:
    219217                        log_verbose("Recording terminated!");
    220218                        return;
Note: See TracChangeset for help on using the changeset viewer.