Changeset c799138 in mainline for uspace/srv/audio/hound/connection.h
- Timestamp:
- 2013-04-11T01:34:41Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 250828a
- Parents:
- f0a647c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/connection.h
rf0a647c rc799138 45 45 #include "audio_sink.h" 46 46 47 /** Source->sink connection structure */ 47 48 typedef struct { 49 /** Source's connections link */ 48 50 link_t source_link; 51 /** Sink's connections link */ 49 52 link_t sink_link; 53 /** Hound's connections link */ 50 54 link_t hound_link; 55 /** audio data pipe */ 51 56 audio_pipe_t fifo; 57 /** Target sink */ 52 58 audio_sink_t *sink; 59 /** Target source */ 53 60 audio_source_t *source; 54 61 } connection_t; 55 62 63 /** 64 * List instance helper. 65 * @param l link 66 * @return pointer to a connection structure, NULL on failure. 67 */ 56 68 static inline connection_t * connection_from_source_list(link_t *l) 57 69 { … … 59 71 } 60 72 73 /** 74 * List instance helper. 75 * @param l link 76 * @return pointer to a connection structure, NULL on failure. 77 */ 61 78 static inline connection_t * connection_from_sink_list(link_t *l) 62 79 { … … 64 81 } 65 82 83 /** 84 * List instance helper. 85 * @param l link 86 * @return pointer to a connection structure, NULL on failure. 87 */ 66 88 static inline connection_t * connection_from_hound_list(link_t *l) 67 89 { … … 75 97 size_t size, pcm_format_t format); 76 98 99 /** 100 * Add new data to the connection buffer. 101 * @param connection Target conneciton. 102 * @aparam adata Reference counted audio data buffer. 103 * @return Error code. 104 */ 77 105 static inline int connection_push_data(connection_t *connection, 78 106 audio_data_t *adata) … … 83 111 } 84 112 113 /** 114 * Source name getter. 115 * @param connection Connection to the source. 116 * @param valid string identifier, "no source" or "unnamed source" on failure. 117 */ 85 118 static inline const char *connection_source_name(connection_t *connection) 86 119 { … … 88 121 if (connection->source && connection->source->name) 89 122 return connection->source->name; 123 // TODO assert? 90 124 return connection->source ? "unnamed source" : "no source"; 91 125 } 92 126 127 /** 128 * Sink name getter. 129 * @param connection Connection to the sink. 130 * @param valid string identifier, "no source" or "unnamed source" on failure. 131 */ 93 132 static inline const char *connection_sink_name(connection_t *connection) 94 133 { … … 96 135 if (connection->sink && connection->sink->name) 97 136 return connection->sink->name; 98 return connection->source ? "unnamed source" : "no source"; 137 // TODO assert? 138 return connection->source ? "unnamed sink" : "no sink"; 99 139 } 100 140
Note:
See TracChangeset
for help on using the changeset viewer.