Changeset 3b6c1d4 in mainline for uspace/srv/audio/hound/iface.c
- Timestamp:
- 2013-04-02T15:13:12Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 62beb4b
- Parents:
- 2d1fdcad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/iface.c
r2d1fdcad r3b6c1d4 38 38 #include <hound/protocol.h> 39 39 #include <malloc.h> 40 41 #include "hound.h" 42 #include "hound_ctx.h" 40 43 #include "log.h" 41 44 … … 43 46 const char *name, bool record) 44 47 { 45 log_info("%s: %p, %s, %s", __FUNCTION__, server, name, record ? "REC" : "PLAY"); 46 *id = 1; 47 return EOK; 48 assert(server); 49 assert(id); 50 assert(name); 51 52 hound_ctx_t *ctx = record ? hound_record_ctx_get(name) : 53 hound_playback_ctx_get(name); 54 if (!ctx) 55 return ENOMEM; 56 57 const int ret = hound_add_ctx(server, ctx); 58 if (ret != EOK) 59 hound_ctx_destroy(ctx); 60 else 61 *id = hound_ctx_get_id(ctx); 62 return ret; 48 63 } 49 64 50 65 static int iface_rem_context(void *server, hound_context_id_t id) 51 66 { 67 assert(server); 68 hound_ctx_t *ctx = hound_get_ctx_by_id(server, id); 69 if (!ctx) 70 return EINVAL; 71 hound_remove_ctx(server, ctx); 72 hound_ctx_destroy(ctx); 52 73 log_info("%s: %p, %d", __FUNCTION__, server, id); 53 return E NOTSUP;74 return EOK; 54 75 } 55 76 56 77 static bool iface_is_record_context(void *server, hound_context_id_t id) 57 78 { 79 assert(server); 80 hound_ctx_t *ctx = hound_get_ctx_by_id(server, id); 81 if (!ctx) 82 return false; 58 83 log_info("%s: %p, %d", __FUNCTION__, server, id); 59 return false;84 return hound_ctx_is_record(ctx); 60 85 } 61 86 … … 73 98 { 74 99 log_info("%s: %p, %s -> %s", __FUNCTION__, server, source, sink); 75 return E OK;100 return ENOTSUP; 76 101 } 77 102 … … 89 114 pcm_sample_format_str(format.sample_format)); 90 115 *data = (void*)"TEST_STREAM"; 91 return E OK;116 return ENOTSUP; 92 117 } 93 118
Note:
See TracChangeset
for help on using the changeset viewer.