Changeset c799138 in mainline for uspace/srv/audio/hound/audio_data.c


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/audio_data.c

    rf0a647c rc799138  
    4040#include "log.h"
    4141
     42/**
     43 * Create reference counted buffer out of ordinary data buffer.
     44 * @param data audio buffer
     45 * @param size Size of the @p data buffer.
     46 * @param fomart audio data format.
     47 * @return pointer to valid audio data structre, NULL on failure.
     48 */
    4249audio_data_t *audio_data_create(const void *data, size_t size,
    4350    pcm_format_t format)
     
    5865}
    5966
     67/**
     68 * Get a new reference to the audio data buffer.
     69 * @param adata The audio data buffer.
     70 */
    6071void audio_data_addref(audio_data_t *adata)
    6172{
     
    6576}
    6677
     78/**
     79 * Release a reference to the audio data buffer.
     80 * @param adata The audio data buffer.
     81 */
    6782void audio_data_unref(audio_data_t *adata)
    6883{
     
    7893/* Data link helpers */
    7994
     95/** Audio data buffer list helper structure. */
    8096typedef struct {
    8197        link_t link;
     
    84100} audio_data_link_t;
    85101
     102/** List instance helper function.
     103 * @param l link
     104 * @return valid pointer to data link structure, NULL on failure.
     105 */
    86106static inline audio_data_link_t * audio_data_link_list_instance(link_t *l)
    87107{
     
    89109}
    90110
     111/**
     112 * Create a new audio data link.
     113 * @param adata Audio data to store.
     114 * @return Valid pointer to a new audio data link structure, NULL on failure.
     115 */
    91116static audio_data_link_t *audio_data_link_create(audio_data_t *adata)
    92117{
     
    101126}
    102127
     128/**
     129 * Destroy audio data link.
     130 * @param link The link to destroy.
     131 *
     132 * Releases data reference.
     133 */
    103134static void audio_data_link_destroy(audio_data_link_t *link)
    104135{
     
    109140}
    110141
     142/**
     143 * Data link buffer start helper function.
     144 * @param alink audio data link
     145 * @return pointer to the beginning of data buffer.
     146 */
    111147static inline const void * audio_data_link_start(audio_data_link_t *alink)
    112148{
     
    116152}
    117153
     154/**
     155 * Data link remaining size getter.
     156 * @param alink audio data link
     157 * @return Remaining size of valid data in the buffer.
     158 */
    118159static inline size_t audio_data_link_remain_size(audio_data_link_t *alink)
    119160{
     
    125166
    126167
     168/**
     169 * Data link remaining frames getter.
     170 * @param alink audio data link
     171 * @return Number of remaining frames in the buffer.
     172 */
    127173static inline size_t audio_data_link_available_frames(audio_data_link_t *alink)
    128174{
     
    135181/* Audio Pipe */
    136182
    137 
     183/**
     184 * Initialize audio pipe structure.
     185 * @param pipe The pipe structure to initialize.
     186 */
    138187void audio_pipe_init(audio_pipe_t *pipe)
    139188{
     
    145194}
    146195
    147 
    148 
     196/**
     197 * Destroy all data in a pipe.
     198 * @param pipe The audio pipe to clean.
     199 */
    149200void audio_pipe_fini(audio_pipe_t *pipe)
    150201{
     
    156207}
    157208
     209/**
     210 * Add new audio data to a pipe.
     211 * @param pipe The target pipe.
     212 * @param data The data.
     213 * @return Error code.
     214 */
    158215int audio_pipe_push(audio_pipe_t *pipe, audio_data_t *data)
    159216{
     
    172229}
    173230
     231/**
     232 * Retrieve data form a audio pipe.
     233 * @param pipe THe target pipe.
     234 * @return Valid pointer to audio data, NULL if the pipe was empty.
     235 */
    174236audio_data_t *audio_pipe_pop(audio_pipe_t *pipe)
    175237{
     
    191253}
    192254
     255
     256/**
     257 * Use data store in a pipe and mix it into the provided buffer.
     258 * @param pipe The piep that should provide data.
     259 * @param data Target buffer.
     260 * @param size Target buffer size.
     261 * @param format Target data format.
     262 * @return Size of the target buffer used, Error code on failure.
     263 */
    193264ssize_t audio_pipe_mix_data(audio_pipe_t *pipe, void *data,
    194265    size_t size, const pcm_format_t *f)
Note: See TracChangeset for help on using the changeset viewer.