Changeset c799138 in mainline for uspace/srv/audio/hound/audio_data.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/audio_data.h
rf0a647c rc799138 43 43 #include <pcm/format.h> 44 44 45 /** Reference counted audio buffer */ 45 46 typedef struct { 47 /** Audio data */ 46 48 const void *data; 49 /** Size of the buffer pointer to by data */ 47 50 size_t size; 51 /** Format of the audio data */ 48 52 pcm_format_t format; 53 /** Reference counter */ 49 54 atomic_t refcount; 50 55 } audio_data_t; 51 56 57 /** Audio data pipe structure */ 52 58 typedef struct { 59 /** List of audio data buffers */ 53 60 list_t list; 61 /** Total size of all buffers */ 54 62 size_t bytes; 63 /** Total frames stored in all buffers */ 55 64 size_t frames; 65 /** List access synchronization */ 56 66 fibril_mutex_t guard; 57 67 } audio_pipe_t; … … 71 81 const pcm_format_t *f); 72 82 83 /** 84 * Total bytes getter. 85 * @param pipe The audio pipe. 86 * @return Total size of buffer stored in the pipe. 87 */ 73 88 static inline size_t audio_pipe_bytes(audio_pipe_t *pipe) 74 89 { … … 77 92 } 78 93 94 /** 95 * Total bytes getter. 96 * @param pipe The audio pipe. 97 * @return Total number of frames stored in the pipe. 98 */ 79 99 static inline size_t audio_pipe_frames(audio_pipe_t *pipe) 80 100 { … … 83 103 } 84 104 105 /** 106 * Push data form buffer directly to pipe. 107 * @param pipe The target pipe. 108 * @param data audio buffer. 109 * @param size size of the @p data buffer 110 * @param f format of the audio data. 111 * @return Error code. 112 * 113 * Reference counted buffer is created automatically. 114 */ 85 115 static inline int audio_pipe_push_data(audio_pipe_t *pipe, 86 116 const void *data, size_t size, pcm_format_t f)
Note:
See TracChangeset
for help on using the changeset viewer.