Changeset 4eff63c in mainline for uspace/srv/audio/hound/audio_source.c
- Timestamp:
- 2013-04-11T21:55:43Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6eeaf1d
- Parents:
- bee5349
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_source.c
rbee5349 r4eff63c 41 41 #include <str_error.h> 42 42 43 #include "audio_data.h" 43 44 #include "audio_source.h" 44 45 #include "audio_sink.h" 46 #include "connection.h" 45 47 #include "log.h" 46 48 … … 87 89 source->name = NULL; 88 90 } 91 /** 92 * Push data to all connections. 93 * @param source The source of the data. 94 * @param dest Destination buffer. 95 * @param size size of the @p dest buffer. 96 * @return Error code. 97 */ 98 int audio_source_push_data(audio_source_t *source, const void *data, 99 size_t size) 100 { 101 assert(source); 102 assert(data); 103 104 audio_data_t *adata = audio_data_create(data, size, source->format); 105 if (!adata) 106 return ENOMEM; 107 108 list_foreach(source->connections, it) { 109 connection_t *conn = connection_from_source_list(it); 110 const int ret = connection_push_data(conn, adata); 111 if (ret != EOK) { 112 log_warning("Failed push data to %s: %s", 113 connection_sink_name(conn), str_error(ret)); 114 } 115 } 116 audio_data_unref(adata); 117 return EOK; 118 } 89 119 90 120 /**
Note:
See TracChangeset
for help on using the changeset viewer.