Changeset 876f5561 in mainline
- Timestamp:
- 2013-04-10T23:06:52Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f0a647c
- Parents:
- eb0ef51
- Location:
- uspace/lib/hound
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/hound/include/hound/client.h
reb0ef51 r876f5561 54 54 void hound_context_destroy(hound_context_t *hound); 55 55 56 int hound_context_set_main_stream_ format(hound_context_t *hound,57 unsigned channels, unsigned rate, pcm_sample_format_t format);56 int hound_context_set_main_stream_params(hound_context_t *hound, 57 pcm_format_t format, size_t bsize); 58 58 59 59 int hound_context_get_available_targets(hound_context_t *hound, -
uspace/lib/hound/include/hound/protocol.h
reb0ef51 r876f5561 41 41 #include <pcm/format.h> 42 42 43 const char *HOUND_SERVICE;43 extern const char *HOUND_SERVICE; 44 44 45 enum {45 typedef enum { 46 46 HOUND_SINK_APPS = 0x1, 47 47 HOUND_SINK_DEVS = 0x2, … … 53 53 HOUND_STREAM_IGNORE_UNDERFLOW = 0x2, 54 54 HOUND_STREAM_IGNORE_OVERFLOW = 0x4, 55 } ;55 } hound_flags_t; 56 56 57 57 typedef async_sess_t hound_sess_t; 58 58 typedef intptr_t hound_context_id_t; 59 59 60 /** 61 * Check context id for errors. 62 * @param id Context id 63 * @return Error code. 64 */ 60 65 static inline int hound_context_id_err(hound_context_id_t id) 61 66 { … … 72 77 int hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count, 73 78 int flags, const char *connection); 79 80 /** 81 * Wrapper for list queries with no connection parameter. 82 * @param[in] sess hound daemon session. 83 * @param[out] ids list of string identifiers 84 * @param[out] count Number of elements in @p ids 85 * @param[in] flags Flags limiting the query. 86 * @return Error code. 87 */ 74 88 static inline int hound_service_get_list_all(hound_sess_t *sess, 75 89 const char ***ids, size_t *count, int flags) … … 92 106 93 107 /* Server */ 108 109 /** Hound server interace structure */ 94 110 typedef struct hound_server_iface { 111 /** Create new context */ 95 112 int (*add_context)(void *, hound_context_id_t *, const char *, bool); 113 /** Destroy existing context */ 96 114 int (*rem_context)(void *, hound_context_id_t); 115 /** Query context direction */ 97 116 bool (*is_record_context)(void *, hound_context_id_t); 117 /** Get string identifiers of specified objects */ 98 118 int (*get_list)(void *, const char ***, size_t *, const char *, int); 119 /** Create connection between source and sink */ 99 120 int (*connect)(void *, const char *, const char *); 121 /** Destroy connection between source and sink */ 100 122 int (*disconnect)(void *, const char *, const char *); 123 /** Create new stream tied to the context */ 101 124 int (*add_stream)(void *, hound_context_id_t, int, pcm_format_t, size_t, 102 125 void **); 126 /** Destroy existing stream */ 103 127 int (*rem_stream)(void *, void *); 128 /** Block until the stream buffer is empty */ 104 129 int (*drain_stream)(void *); 130 /** Write new data to the stream */ 105 131 int (*stream_data_write)(void *, const void *, size_t); 132 /** Read data from the stream */ 106 133 int (*stream_data_read)(void *, void *, size_t); 107 134 void *server; -
uspace/lib/hound/src/client.c
reb0ef51 r876f5561 45 45 #include "client.h" 46 46 47 /*** 48 * CLIENT SIDE 49 ***/ 50 47 /** Stream structure */ 51 48 typedef struct hound_stream { 49 /** link in context's list */ 52 50 link_t link; 51 /** audio data format fo the stream */ 53 52 pcm_format_t format; 53 /** IPC exchange representing the stream (in STREAM MODE) */ 54 54 async_exch_t *exch; 55 /** parent context */ 55 56 hound_context_t *context; 57 /** Stream flags */ 56 58 int flags; 57 59 } hound_stream_t; 58 60 61 /** 62 * Linked list isntacen helper function. 63 * @param l link 64 * @return hound stream isntance. 65 */ 59 66 static inline hound_stream_t * hound_stream_from_link(link_t *l) 60 67 { … … 62 69 } 63 70 71 /** Hound client context structure */ 64 72 typedef struct hound_context { 73 /** Audio session */ 65 74 hound_sess_t *session; 75 /** context name, reported to the daemon */ 66 76 const char *name; 77 /** True if the instance is record context */ 67 78 bool record; 79 /** List of associated streams */ 68 80 list_t stream_list; 81 /** Main stream helper structure */ 69 82 struct { 70 83 hound_stream_t *stream; … … 72 85 size_t bsize; 73 86 } main; 87 /** Assigned context id */ 74 88 hound_context_id_t id; 75 89 } hound_context_t; 76 90 77 91 /** 92 * Alloc and initialize context structure. 93 * @param name Base for the real context name, will add task id. 94 * @param record True if the new context should capture audio data. 95 * @param format PCM format of the main pipe. 96 * @param bsize Server size buffer size of the main stream. 97 * @return valid pointer to initialized structure on success, NULL on failure 98 */ 78 99 static hound_context_t *hound_context_create(const char *name, bool record, 79 100 pcm_format_t format, size_t bsize) … … 111 132 } 112 133 134 /** 135 * Playback context helper function. 136 * @param name Base for the real context name, will add task id. 137 * @param format PCM format of the main pipe. 138 * @param bsize Server size buffer size of the main stream. 139 * @return valid pointer to initialized structure on success, NULL on failure 140 */ 113 141 hound_context_t * hound_context_create_playback(const char *name, 114 142 pcm_format_t format, size_t bsize) … … 117 145 } 118 146 147 /** 148 * Record context helper function. 149 * @param name Base for the real context name, will add task id. 150 * @param format PCM format of the main pipe. 151 * @param bsize Server size buffer size of the main stream. 152 * @return valid pointer to initialized structure on success, NULL on failure 153 */ 119 154 hound_context_t * hound_context_create_capture(const char *name, 120 155 pcm_format_t format, size_t bsize) … … 123 158 } 124 159 160 /** 161 * Correctly dispose of the hound context structure. 162 * @param hound context to remove. 163 * 164 * The function will destroy all associated streams first. Pointers 165 * to these structures will become invalid and the function will block 166 * if any of these stream needs to be drained first. 167 */ 125 168 void hound_context_destroy(hound_context_t *hound) 126 169 { … … 139 182 } 140 183 184 /** 185 * Get a list of possible connection targets. 186 * @param[in] hound Hound context. 187 * @param[out] names list of target string ids. 188 * @param[out] count Number of elements in @p names list 189 * @return Error code. 190 * 191 * The function will return deice sinks or source based on the context type. 192 */ 141 193 int hound_context_get_available_targets(hound_context_t *hound, 142 194 const char ***names, size_t *count) … … 149 201 } 150 202 203 /** 204 * Get a list of targets connected to the context. 205 * @param[in] hound Hound context. 206 * @param[out] names list of target string ids. 207 * @param[out] count Number of elements in @p names list 208 * @return Error code. 209 */ 151 210 int hound_context_get_connected_targets(hound_context_t *hound, 152 211 const char ***names, size_t *count) … … 160 219 } 161 220 221 /** 222 * Create a new connection to the target. 223 * @param hound Hound context. 224 * @param target String identifier of the desired target. 225 * @return Error code. 226 * 227 * The function recognizes special 'HOUND_DEFAULT_TARGET' and will 228 * connect to the first possible target if it is passed this value. 229 */ 162 230 int hound_context_connect_target(hound_context_t *hound, const char* target) 163 231 { … … 189 257 } 190 258 259 /** 260 * Destroy a connection to the target. 261 * @param hound Hound context. 262 * @param target String identifier of the desired target. 263 * @return Error code. 264 */ 191 265 int hound_context_disconnect_target(hound_context_t *hound, const char* target) 192 266 { … … 203 277 } 204 278 279 /** 280 * Create a new stream associated with the context. 281 * @param hound Hound context. 282 * @param flags new stream flags. 283 * @param format new stream PCM format. 284 * @param bzise new stream server side buffer size (in bytes) 285 * @return Valid pointer to a stream instance, NULL on failure. 286 */ 205 287 hound_stream_t *hound_stream_create(hound_context_t *hound, unsigned flags, 206 288 pcm_format_t format, size_t bsize) … … 229 311 } 230 312 313 /** 314 * Destroy existing stream 315 * @param stream The stream to destroy. 316 * 317 * Function will wait until the server side buffer is empty if the 318 * HOUND_STREAM_DRAIN_ON_EXIT flag was set on creation. 319 */ 231 320 void hound_stream_destroy(hound_stream_t *stream) 232 321 { … … 241 330 } 242 331 332 /** 333 * Send new data to a stream. 334 * @param stream The target stream 335 * @param data data buffer 336 * @param size size of the @p data buffer. 337 * @return error code. 338 */ 243 339 int hound_stream_write(hound_stream_t *stream, const void *data, size_t size) 244 340 { … … 249 345 } 250 346 347 /** 348 * Get data from a stream. 349 * @param stream The target stream. 350 * @param data data buffer. 351 * @param size size of the @p data buffer. 352 * @return error code. 353 */ 251 354 int hound_stream_read(hound_stream_t *stream, void *data, size_t size) 252 355 { … … 257 360 } 258 361 362 /** 363 * Main stream getter function. 364 * @param hound Houndcontext. 365 * @return Valid stream pointer, NULL on failure. 366 * 367 * The function will create new stream, or return a pointer to the exiting one 368 * if it exists. 369 */ 259 370 static hound_stream_t * hound_get_main_stream(hound_context_t *hound) 260 371 { … … 267 378 } 268 379 380 /** 381 * Send new data to the main stream. 382 * @param stream The target stream 383 * @param data data buffer 384 * @param size size of the @p data buffer. 385 * @return error code. 386 */ 269 387 int hound_write_main_stream(hound_context_t *hound, 270 388 const void *data, size_t size) 271 389 { 272 390 assert(hound); 391 if (hound->record) 392 return EINVAL; 393 273 394 hound_stream_t *mstream = hound_get_main_stream(hound); 274 395 if (!mstream) … … 277 398 } 278 399 400 /** 401 * Get data from the main stream. 402 * @param stream The target stream 403 * @param data data buffer 404 * @param size size of the @p data buffer. 405 * @return error code. 406 */ 279 407 int hound_read_main_stream(hound_context_t *hound, void *data, size_t size) 280 408 { 281 409 assert(hound); 410 if (!hound->record) 411 return EINVAL; 282 412 hound_stream_t *mstream = hound_get_main_stream(hound); 283 413 if (!mstream) … … 286 416 } 287 417 418 /** 419 * Destroy the old main stream and replace it with a new one with fresh data. 420 * @param hound Hound context. 421 * @param data data buffer. 422 * @param size size of the @p data buffer. 423 * @return error code. 424 * 425 * NOT IMPLEMENTED 426 */ 288 427 int hound_write_replace_main_stream(hound_context_t *hound, 289 428 const void *data, size_t size) … … 296 435 } 297 436 298 int hound_context_set_main_stream_format(hound_context_t *hound, 299 unsigned channels, unsigned rate, pcm_sample_format_t format) 437 /** 438 * Destroy the old main stream and replace it with a new one using new params. 439 * @param hound Hound context. 440 * @param channels 441 * @return error code. 442 * 443 * NOT IMPLEMENTED 444 */ 445 int hound_context_set_main_stream_params(hound_context_t *hound, 446 pcm_format_t format, size_t bsize) 300 447 { 301 448 assert(hound); … … 304 451 } 305 452 453 /** 454 * Write data immediately to a new stream, and wait for it to drain. 455 * @param hound Hound context. 456 * @param format pcm data format. 457 * @param data data buffer 458 * @param size @p data buffer size 459 * @return Error code. 460 * 461 * This functnion creates a new stream writes the data, ti waits for the stream 462 * to drain and destroys it before returning. 463 */ 306 464 int hound_write_immediate(hound_context_t *hound, pcm_format_t format, 307 465 const void *data, size_t size) 308 466 { 309 467 assert(hound); 468 if (hound->record) 469 return EINVAL; 310 470 hound_stream_t *tmpstream = hound_stream_create(hound, 0, format, size); 311 471 if (!tmpstream) … … 319 479 return ret; 320 480 } 321 322 323 481 /** 324 482 * @} -
uspace/lib/hound/src/protocol.c
reb0ef51 r876f5561 48 48 49 49 enum ipc_methods { 50 /** Create new context representation on the server side */ 50 51 IPC_M_HOUND_CONTEXT_REGISTER = IPC_FIRST_USER_METHOD, 52 /** Release existing context representation on the server side */ 51 53 IPC_M_HOUND_CONTEXT_UNREGISTER, 54 /** Request list of objects */ 52 55 IPC_M_HOUND_GET_LIST, 56 /** Create new connection */ 53 57 IPC_M_HOUND_CONNECT, 58 /** Destroy connection */ 54 59 IPC_M_HOUND_DISCONNECT, 60 /** Switch IPC pipe to stream mode */ 55 61 IPC_M_HOUND_STREAM_ENTER, 62 /** Switch IPC pipe back to general mode */ 56 63 IPC_M_HOUND_STREAM_EXIT, 64 /** Wait until there is no data in the stream */ 57 65 IPC_M_HOUND_STREAM_DRAIN, 58 66 }; 59 67 68 69 /** PCM format conversion helper structure */ 60 70 typedef union { 61 71 struct { … … 72 82 ****/ 73 83 84 /** Well defined service name */ 74 85 const char *HOUND_SERVICE = "audio/hound"; 75 86 87 /** 88 * Start a new audio session. 89 * @param service Named service typically 'HOUND_SERVICE' constant. 90 * @return Valid session on success, NULL on failure. 91 */ 76 92 hound_sess_t *hound_service_connect(const char *service) 77 93 { … … 84 100 } 85 101 102 /** 103 * End an existing audio session. 104 * @param sess The session. 105 */ 86 106 void hound_service_disconnect(hound_sess_t *sess) 87 107 { … … 90 110 } 91 111 112 /** 113 * Register a named application context to the audio server. 114 * @param sess Valid audio session. 115 * @param name Valid string identifier 116 * @param record True if the application context wishes to receive data. 117 * @return Valid ID on success, Error code on failure. 118 */ 92 119 hound_context_id_t hound_service_register_context(hound_sess_t *sess, 93 120 const char *name, bool record) … … 113 140 } 114 141 142 /** 143 * Remove application context from the server's list. 144 * @param sess Valid audio session. 145 * @param id Valid context id. 146 * @return Error code. 147 */ 115 148 int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id) 116 149 { … … 123 156 } 124 157 158 /** 159 * Retrieve a list of server side actors. 160 * @param[in] sess Valid audio session. 161 * @param[out] ids list of string identifiers. 162 * @param[out] count Number of elements int the @p ids list. 163 * @param[in] flags list requirements. 164 * @param[in] connection name of target actor. Used only if the list should 165 * contain connected actors. 166 * @retval Error code. 167 */ 125 168 int hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count, 126 169 int flags, const char *connection) … … 190 233 } 191 234 235 /** 236 * Create a new connection between a source and a sink. 237 * @param sess Valid audio session. 238 * @param source Source name, valid string. 239 * @param sink Sink name, valid string. 240 * @return Error code. 241 */ 192 242 int hound_service_connect_source_sink(hound_sess_t *sess, const char *source, 193 243 const char *sink) … … 212 262 } 213 263 264 /** 265 * Destroy an existing connection between a source and a sink. 266 * @param sess Valid audio session. 267 * @param source Source name, valid string. 268 * @param sink Sink name, valid string. 269 * @return Error code. 270 */ 214 271 int hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source, 215 272 const char *sink) … … 231 288 } 232 289 290 /** 291 * Switch IPC exchange to a STREAM mode. 292 * @param exch IPC exchange. 293 * @param id context id this stream should be associated with 294 * @param flags set stream properties 295 * @param format format of the new stream. 296 * @param bsize size of the server side buffer. 297 * @return Error code. 298 */ 233 299 int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id, 234 300 int flags, pcm_format_t format, size_t bsize) … … 243 309 } 244 310 311 /** 312 * Destroy existing stream and return IPC exchange to general mode. 313 * @param exch IPC exchange. 314 * @return Error code. 315 */ 245 316 int hound_service_stream_exit(async_exch_t *exch) 246 317 { … … 248 319 } 249 320 321 /** 322 * Wait until the server side buffer is empty. 323 * @param exch IPC exchange. 324 * @return Error code. 325 */ 250 326 int hound_service_stream_drain(async_exch_t *exch) 251 327 { … … 253 329 } 254 330 331 /** 332 * Write audio data to a stream. 333 * @param exch IPC exchange in STREAM MODE. 334 * @param data Audio data buffer. 335 * @size size of the buffer 336 * @return Error code. 337 */ 255 338 int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size) 256 339 { … … 258 341 } 259 342 343 /** 344 * Read data from a stream. 345 * @param exch IPC exchange in STREAM MODE. 346 * @param data Audio data buffer. 347 * @size size of the buffer 348 * @return Error code. 349 */ 260 350 int hound_service_stream_read(async_exch_t *exch, void *data, size_t size) 261 351 { … … 271 361 static const hound_server_iface_t *server_iface; 272 362 363 /** 364 * Set hound server interface implementation. 365 * @param iface Initialized Hound server interface. 366 */ 273 367 void hound_service_set_server_iface(const hound_server_iface_t *iface) 274 368 { … … 276 370 } 277 371 372 /** 373 * Server side implementation of the hound protocol. IPC connection handler. 374 * @param iid initial call id 375 * @param icall pointer to initial call structure. 376 * @param arg (unused) 377 */ 278 378 void hound_connection_handler(ipc_callid_t iid, ipc_call_t *icall, void *arg) 279 379 { … … 291 391 switch (IPC_GET_IMETHOD(call)) { 292 392 case IPC_M_HOUND_CONTEXT_REGISTER: { 393 /* check interface functions */ 293 394 if (!server_iface || !server_iface->add_context) { 294 395 async_answer_0(callid, ENOTSUP); … … 297 398 bool record = IPC_GET_ARG1(call); 298 399 void *name; 400 401 /* Get context name */ 299 402 int ret = 300 403 async_data_write_accept(&name, true, 0, 0, 0, 0); … … 306 409 ret = server_iface->add_context(server_iface->server, 307 410 &id, name, record); 411 /** new context should create a copy */ 412 free(name); 308 413 if (ret != EOK) { 309 free(name);310 414 async_answer_0(callid, ret); 311 415 } else { … … 315 419 } 316 420 case IPC_M_HOUND_CONTEXT_UNREGISTER: { 421 /* check interface functions */ 317 422 if (!server_iface || !server_iface->rem_context) { 318 423 async_answer_0(callid, ENOTSUP); 319 424 break; 320 425 } 426 427 /* get id, 1st param */ 321 428 hound_context_id_t id = IPC_GET_ARG1(call); 322 429 const int ret = … … 326 433 } 327 434 case IPC_M_HOUND_GET_LIST: { 435 /* check interface functions */ 328 436 if (!server_iface || !server_iface->get_list) { 329 437 async_answer_0(callid, ENOTSUP); 330 438 break; 331 439 } 440 332 441 const char **list = NULL; 333 442 const int flags = IPC_GET_ARG1(call); … … 336 445 char *conn_name = NULL; 337 446 int ret = EOK; 447 448 /* get connected actor name if provided */ 338 449 if (conn) 339 450 ret = async_data_write_accept( … … 345 456 conn_name, flags); 346 457 free(conn_name); 458 459 /* Alloc string sizes array */ 347 460 size_t *sizes = NULL; 348 461 if (count) … … 383 496 } 384 497 case IPC_M_HOUND_CONNECT: { 498 /* check interface functions */ 385 499 if (!server_iface || !server_iface->connect) { 386 500 async_answer_0(callid, ENOTSUP); 387 501 break; 388 502 } 503 389 504 void *source = NULL; 390 505 void *sink = NULL; 506 507 /* read source name */ 391 508 int ret = 392 509 async_data_write_accept(&source, true, 0, 0, 0, 0); 510 /* read sink name */ 511 if (ret == EOK) 512 ret = async_data_write_accept(&sink, 513 true, 0, 0, 0, 0); 514 515 if (ret == EOK) 516 ret = server_iface->connect( 517 server_iface->server, source, sink); 518 free(source); 519 free(sink); 520 async_answer_0(callid, ret); 521 break; 522 } 523 case IPC_M_HOUND_DISCONNECT: { 524 /* check interface functions */ 525 if (!server_iface || !server_iface->disconnect) { 526 async_answer_0(callid, ENOTSUP); 527 break; 528 } 529 530 void *source = NULL; 531 void *sink = NULL; 532 533 /* read source name */ 534 int ret = 535 async_data_write_accept(&source, true, 0, 0, 0, 0); 536 /*read sink name */ 393 537 if (ret == EOK) 394 538 ret = async_data_write_accept(&sink, … … 402 546 break; 403 547 } 404 case IPC_M_HOUND_DISCONNECT: {405 if (!server_iface || !server_iface->disconnect) {406 async_answer_0(callid, ENOTSUP);407 break;408 }409 void *source = NULL;410 void *sink = NULL;411 int ret =412 async_data_write_accept(&source, true, 0, 0, 0, 0);413 if (ret == EOK)414 ret = async_data_write_accept(&sink,415 true, 0, 0, 0, 0);416 if (ret == EOK)417 ret = server_iface->connect(418 server_iface->server, source, sink);419 free(source);420 free(sink);421 async_answer_0(callid, ret);422 break;423 }424 548 case IPC_M_HOUND_STREAM_ENTER: { 549 /* check interface functions */ 425 550 if (!server_iface || !server_iface->is_record_context 426 551 || !server_iface->add_stream … … 430 555 } 431 556 557 /* get parameters */ 432 558 hound_context_id_t id = IPC_GET_ARG1(call); 433 559 const int flags = IPC_GET_ARG2(call); … … 439 565 }; 440 566 size_t bsize = IPC_GET_ARG4(call); 567 441 568 void *stream; 442 569 int ret = server_iface->add_stream(server_iface->server, … … 451 578 if(server_iface->stream_data_read) { 452 579 async_answer_0(callid, EOK); 580 /* start answering read calls */ 453 581 hound_server_write_data(stream); 454 582 server_iface->rem_stream( … … 460 588 if (server_iface->stream_data_write) { 461 589 async_answer_0(callid, EOK); 590 /* accept write calls */ 462 591 hound_server_read_data(stream); 463 592 server_iface->rem_stream( … … 481 610 } 482 611 612 /** 613 * Read data and push it to the stream. 614 * @param stream target stream, will push data there. 615 */ 483 616 static void hound_server_read_data(void *stream) 484 617 { … … 487 620 size_t size = 0; 488 621 int ret_answer = EOK; 622 /* accept data write or drain */ 489 623 while (async_data_write_receive_call(&callid, &call, &size) 490 624 || (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN)) { 625 /* check drain first */ 491 626 if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) { 492 627 int ret = ENOTSUP; … … 496 631 continue; 497 632 } 633 634 /* there was an error last time */ 498 635 if (ret_answer != EOK) { 499 636 async_answer_0(callid, ret_answer); 500 637 continue; 501 638 } 639 502 640 char *buffer = malloc(size); 503 641 if (!buffer) { … … 507 645 const int ret = async_data_write_finalize(callid, buffer, size); 508 646 if (ret == EOK) { 647 /* push data to stream */ 509 648 ret_answer = server_iface->stream_data_write( 510 649 stream, buffer, size); … … 517 656 } 518 657 658 /** 659 * Accept reads and pull data from the stream. 660 * @param stream target stream, will pull data from there. 661 */ 519 662 static void hound_server_write_data(void *stream) 520 663 { … … 524 667 size_t size = 0; 525 668 int ret_answer = EOK; 669 /* accept data read and drain */ 526 670 while (async_data_read_receive_call(&callid, &call, &size) 527 671 || (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN)) { 672 /* drain does not make much sense but it is allowed */ 528 673 if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) { 529 674 int ret = ENOTSUP; … … 533 678 continue; 534 679 } 680 /* there was an error last time */ 535 681 if (ret_answer != EOK) { 536 682 async_answer_0(callid, ret_answer); … … 559 705 ***/ 560 706 707 /** 708 * Register new hound service to the location service. 709 * @param[in] name server name 710 * @param[out] id assigned service id. 711 * @return Error code. 712 */ 561 713 int hound_server_register(const char *name, service_id_t *id) 562 714 { … … 571 723 } 572 724 725 /** 726 * Unregister server from the location service. 727 * @param id previously assigned service id. 728 */ 573 729 void hound_server_unregister(service_id_t id) 574 730 { … … 576 732 } 577 733 734 /** 735 * Set callback on device category change event. 736 * @param cb Callback function. 737 * @return Error code. 738 */ 578 739 int hound_server_set_device_change_callback(dev_change_callback_t cb) 579 740 { … … 581 742 } 582 743 583 744 /** 745 * Walk through all device in the audio-pcm category. 746 * @param callback Function to call on every device. 747 * @return Error code. 748 */ 584 749 int hound_server_devices_iterate(device_callback_t callback) 585 750 {
Note:
See TracChangeset
for help on using the changeset viewer.