Changeset c799138 in mainline for uspace/srv/audio/hound/connection.h


Ignore:
Timestamp:
2013-04-11T01:34: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:
250828a
Parents:
f0a647c
Message:

hound: doxygen and cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/connection.h

    rf0a647c rc799138  
    4545#include "audio_sink.h"
    4646
     47/** Source->sink connection structure */
    4748typedef struct {
     49        /** Source's connections link */
    4850        link_t source_link;
     51        /** Sink's connections link */
    4952        link_t sink_link;
     53        /** Hound's connections link */
    5054        link_t hound_link;
     55        /** audio data pipe */
    5156        audio_pipe_t fifo;
     57        /** Target sink */
    5258        audio_sink_t *sink;
     59        /** Target source */
    5360        audio_source_t *source;
    5461} connection_t;
    5562
     63/**
     64 * List instance helper.
     65 * @param l link
     66 * @return pointer to a connection structure, NULL on failure.
     67 */
    5668static inline connection_t * connection_from_source_list(link_t *l)
    5769{
     
    5971}
    6072
     73/**
     74 * List instance helper.
     75 * @param l link
     76 * @return pointer to a connection structure, NULL on failure.
     77 */
    6178static inline connection_t * connection_from_sink_list(link_t *l)
    6279{
     
    6481}
    6582
     83/**
     84 * List instance helper.
     85 * @param l link
     86 * @return pointer to a connection structure, NULL on failure.
     87 */
    6688static inline connection_t * connection_from_hound_list(link_t *l)
    6789{
     
    7597    size_t size, pcm_format_t format);
    7698
     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 */
    77105static inline int connection_push_data(connection_t *connection,
    78106    audio_data_t *adata)
     
    83111}
    84112
     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 */
    85118static inline const char *connection_source_name(connection_t *connection)
    86119{
     
    88121        if (connection->source && connection->source->name)
    89122                return connection->source->name;
     123        // TODO assert?
    90124        return connection->source ? "unnamed source" : "no source";
    91125}
    92126
     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 */
    93132static inline const char *connection_sink_name(connection_t *connection)
    94133{
     
    96135        if (connection->sink && connection->sink->name)
    97136                return connection->sink->name;
    98         return connection->source ? "unnamed source" : "no source";
     137        // TODO assert?
     138        return connection->source ? "unnamed sink" : "no sink";
    99139}
    100140
Note: See TracChangeset for help on using the changeset viewer.