Changeset 33b8d024 in mainline for uspace/srv
- Timestamp:
- 2018-01-16T20:38:46Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2467b41
- Parents:
- d39c46e0
- Location:
- uspace/srv
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_data.c
rd39c46e0 r33b8d024 36 36 #include <macros.h> 37 37 #include <stdlib.h> 38 #include <str.h> 38 39 39 40 #include "audio_data.h" … … 50 51 pcm_format_t format) 51 52 { 52 audio_data_t *adata = malloc(sizeof(audio_data_t) );53 audio_data_t *adata = malloc(sizeof(audio_data_t) + size); 53 54 if (adata) { 54 55 unsigned overflow = size % pcm_format_frame_size(&format); … … 56 57 log_warning("Data not a multiple of frame size, " 57 58 "clipping."); 58 59 adata->data = data;59 uint8_t *d = ((uint8_t *)adata) + offsetof(audio_data_t, data); 60 memcpy(d, data, size); 60 61 adata->size = size - overflow; 61 62 adata->format = format; … … 86 87 atomic_count_t refc = atomic_predec(&adata->refcount); 87 88 if (refc == 0) { 88 free(adata->data);89 89 free(adata); 90 90 } -
uspace/srv/audio/hound/audio_data.h
rd39c46e0 r33b8d024 45 45 /** Reference counted audio buffer */ 46 46 typedef struct { 47 /** Audio data */48 const void *data;49 47 /** Size of the buffer pointer to by data */ 50 48 size_t size; … … 53 51 /** Reference counter */ 54 52 atomic_t refcount; 53 /** Audio data */ 54 const uint8_t data[]; 55 55 } audio_data_t; 56 56 -
uspace/srv/audio/hound/audio_sink.h
rd39c46e0 r33b8d024 54 54 list_t connections; 55 55 /** Sink's name */ 56 c onst char *name;56 char *name; 57 57 /** Consumes data in this format */ 58 58 pcm_format_t format; -
uspace/srv/audio/hound/audio_source.c
rd39c46e0 r33b8d024 96 96 * @return Error code. 97 97 */ 98 errno_t audio_source_push_data(audio_source_t *source, constvoid *data,98 errno_t audio_source_push_data(audio_source_t *source, void *data, 99 99 size_t size) 100 100 { -
uspace/srv/audio/hound/audio_source.h
rd39c46e0 r33b8d024 49 49 list_t connections; 50 50 /** String identifier */ 51 c onst char *name;51 char *name; 52 52 /** audio data format */ 53 53 pcm_format_t format; … … 75 75 const pcm_format_t *f); 76 76 void audio_source_fini(audio_source_t *source); 77 errno_t audio_source_push_data(audio_source_t *source, constvoid *data,77 errno_t audio_source_push_data(audio_source_t *source, void *data, 78 78 size_t size); 79 79 static inline const pcm_format_t *audio_source_format(const audio_source_t *s) -
uspace/srv/audio/hound/hound.c
rd39c46e0 r33b8d024 414 414 * @return Error code. 415 415 */ 416 errno_t hound_list_sources(hound_t *hound, c onst char ***list, size_t *size)416 errno_t hound_list_sources(hound_t *hound, char ***list, size_t *size) 417 417 { 418 418 assert(hound); … … 428 428 return EOK; 429 429 } 430 c onst char **names = calloc(count, sizeof(char *));430 char **names = calloc(count, sizeof(char *)); 431 431 errno_t ret = names ? EOK : ENOMEM; 432 432 for (unsigned long i = 0; i < count && ret == EOK; ++i) { … … 456 456 * @return Error code. 457 457 */ 458 errno_t hound_list_sinks(hound_t *hound, c onst char ***list, size_t *size)458 errno_t hound_list_sinks(hound_t *hound, char ***list, size_t *size) 459 459 { 460 460 assert(hound); … … 470 470 return EOK; 471 471 } 472 c onst char **names = calloc(count, sizeof(char *));472 char **names = calloc(count, sizeof(char *)); 473 473 errno_t ret = names ? EOK : ENOMEM; 474 474 for (size_t i = 0; i < count && ret == EOK; ++i) { -
uspace/srv/audio/hound/hound.h
rd39c46e0 r33b8d024 73 73 errno_t hound_add_source(hound_t *hound, audio_source_t *source); 74 74 errno_t hound_add_sink(hound_t *hound, audio_sink_t *sink); 75 errno_t hound_list_sources(hound_t *hound, c onst char ***list, size_t *size);76 errno_t hound_list_sinks(hound_t *hound, c onst char ***list, size_t *size);75 errno_t hound_list_sources(hound_t *hound, char ***list, size_t *size); 76 errno_t hound_list_sinks(hound_t *hound, char ***list, size_t *size); 77 77 errno_t hound_list_connections(hound_t *hound, const char ***sources, 78 78 const char ***sinks, size_t *size); -
uspace/srv/audio/hound/iface.c
rd39c46e0 r33b8d024 86 86 } 87 87 88 static errno_t iface_get_list(void *server, c onst char ***list, size_t *size,88 static errno_t iface_get_list(void *server, char ***list, size_t *size, 89 89 const char *connection, int flags) 90 90 { -
uspace/srv/devman/devman.h
rd39c46e0 r33b8d024 80 80 char *name; 81 81 /** Path to the driver's binary. */ 82 c onst char *binary_path;82 char *binary_path; 83 83 /** List of device ids for device-to-driver matching. */ 84 84 match_id_list_t match_ids;
Note:
See TracChangeset
for help on using the changeset viewer.