Changeset ea6c838 in mainline for uspace/lib/pcm/src/format.c
- 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/src/format.c
r950110ee rea6c838 40 40 #include <stdio.h> 41 41 42 #include " audio_format.h"42 #include "format.h" 43 43 44 44 #define uint8_t_le2host(x) (x) … … 76 76 77 77 static float get_normalized_sample(const void *buffer, size_t size, 78 unsigned frame, unsigned channel, const audio_format_t *f);79 80 bool audio_format_same(const audio_format_t *a, const audio_format_t* b)78 unsigned frame, unsigned channel, const pcm_format_t *f); 79 80 bool pcm_format_same(const pcm_format_t *a, const pcm_format_t* b) 81 81 { 82 82 assert(a); … … 88 88 } 89 89 90 int audio_format_mix(void *dst, const void *src, size_t size, const audio_format_t *f)91 { 92 return audio_format_convert_and_mix(dst, size, src, size, f, f);93 } 94 int audio_format_convert_and_mix(void *dst, size_t dst_size, const void *src,95 size_t src_size, const audio_format_t *sf, const audio_format_t *df)90 int pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f) 91 { 92 return pcm_format_convert_and_mix(dst, size, src, size, f, f); 93 } 94 int pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src, 95 size_t src_size, const pcm_format_t *sf, const pcm_format_t *df) 96 96 { 97 97 if (!dst || !src || !sf || !df) 98 98 return EINVAL; 99 const size_t src_frame_size = audio_format_frame_size(sf);99 const size_t src_frame_size = pcm_format_frame_size(sf); 100 100 if ((src_size % src_frame_size) != 0) 101 101 return EINVAL; 102 102 103 const size_t dst_frame_size = audio_format_frame_size(df);103 const size_t dst_frame_size = pcm_format_frame_size(df); 104 104 if ((src_size % dst_frame_size) != 0) 105 105 return EINVAL; … … 170 170 /** Converts all sample formats to float <-1,1> */ 171 171 static float get_normalized_sample(const void *buffer, size_t size, 172 unsigned frame, unsigned channel, const audio_format_t *f)172 unsigned frame, unsigned channel, const pcm_format_t *f) 173 173 { 174 174 assert(f);
Note:
See TracChangeset
for help on using the changeset viewer.