Changeset b266f9e in mainline for uspace/srv/audio/hound/iface.c


Ignore:
Timestamp:
2013-04-04T11:15:41Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf13c9a4
Parents:
6133470
Message:

hound: implement stream creation/destruction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/iface.c

    r6133470 rb266f9e  
    112112    pcm_format_t format, size_t size, void **data)
    113113{
    114         log_info("%s: %p, %d %x ch:%u r:%u f:%s", __FUNCTION__, server, id,
     114        assert(data);
     115        assert(server);
     116
     117        log_verbose("%s: %p, %d %x ch:%u r:%u f:%s", __FUNCTION__, server, id,
    115118            flags, format.channels, format.sampling_rate,
    116119            pcm_sample_format_str(format.sample_format));
    117         *data = (void*)"TEST_STREAM";
    118         return ENOTSUP;
     120        hound_ctx_t *ctx = hound_get_ctx_by_id(server, id);
     121        if (!ctx)
     122                return ENOENT;
     123        hound_ctx_stream_t *stream =
     124            hound_ctx_create_stream(ctx, flags, format, size);
     125        if (!stream)
     126                return ENOMEM;
     127        *data = stream;
     128        return EOK;
    119129}
    120130
    121131static int iface_rem_stream(void *server, void *stream)
    122132{
    123         log_info("%s: %p, %s", __FUNCTION__, server, (char *)stream);
    124         return ENOTSUP;
     133        log_verbose("%s: %p, %s", __FUNCTION__, server, (char *)stream);
     134        hound_ctx_destroy_stream(stream);
     135        return EOK;
    125136}
    126137
    127138static int iface_stream_data_read(void *stream, void *buffer, size_t size)
    128139{
    129         log_info("%s: %s, %zu", __FUNCTION__, (char *)stream, size);
     140        log_verbose("%p:, %zu", stream, size);
    130141        return ENOTSUP;
    131142}
     
    133144static int iface_stream_data_write(void *stream, const void *buffer, size_t size)
    134145{
    135         log_info("%s: %s, %zu", __FUNCTION__, (char *)stream, size);
     146        log_verbose("%p: %zu", stream, size);
    136147        return ENOTSUP;
    137148}
Note: See TracChangeset for help on using the changeset viewer.