Changeset ea6c838 in mainline for uspace/lib/pcm/include/pcm/format.h
- Timestamp:
- 2012-07-17T08:26:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e6bba8f
- Parents:
- 950110ee
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcm/include/pcm/format.h
r950110ee rea6c838 34 34 */ 35 35 36 #ifndef AUDIO_FORMAT_H_37 #define AUDIO_FORMAT_H_36 #ifndef PCM_FORMAT_H_ 37 #define PCM_FORMAT_H_ 38 38 39 39 #include <assert.h> 40 40 #include <bool.h> 41 #include <pcm_sample_format.h> 42 41 #include <pcm/sample_format.h> 43 42 44 43 typedef struct { … … 46 45 unsigned sampling_rate; 47 46 pcm_sample_format_t sample_format; 48 } audio_format_t;47 } pcm_format_t; 49 48 50 static const audio_format_t AUDIO_FORMAT_DEFAULT = {49 static const pcm_format_t AUDIO_FORMAT_DEFAULT = { 51 50 .channels = 2, 52 51 .sampling_rate = 44100, … … 54 53 }; 55 54 56 static const audio_format_t AUDIO_FORMAT_ANY = {55 static const pcm_format_t AUDIO_FORMAT_ANY = { 57 56 .channels = 0, 58 57 .sampling_rate = 0, … … 60 59 }; 61 60 62 63 static inline size_t audio_format_frame_size(const audio_format_t *a) 61 static inline size_t pcm_format_frame_size(const pcm_format_t *a) 64 62 { 65 63 return a->channels * pcm_sample_format_size(a->sample_format); 66 64 } 67 65 68 bool audio_format_same(const audio_format_t *a, const audio_format_t* b);69 static inline bool audio_format_is_any(const audio_format_t *f)66 bool pcm_format_same(const pcm_format_t *a, const pcm_format_t* b); 67 static inline bool pcm_format_is_any(const pcm_format_t *f) 70 68 { 71 return audio_format_same(f, &AUDIO_FORMAT_ANY);69 return pcm_format_same(f, &AUDIO_FORMAT_ANY); 72 70 } 73 int audio_format_convert_and_mix(void *dst, size_t dst_size, const void *src,74 size_t src_size, const audio_format_t *sf, const audio_format_t *df);75 int audio_format_mix(void *dst, const void *src, size_t size, const audio_format_t *f);76 int audio_format_convert(audio_format_t a, void* srca, size_t sizea,77 audio_format_t b, void* srcb, size_t *sizeb);71 int pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src, 72 size_t src_size, const pcm_format_t *sf, const pcm_format_t *df); 73 int pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f); 74 int pcm_format_convert(pcm_format_t a, void* srca, size_t sizea, 75 pcm_format_t b, void* srcb, size_t *sizeb); 78 76 79 77 #endif
Note:
See TracChangeset
for help on using the changeset viewer.