Changeset eb0ef51 in mainline
- Timestamp:
- 2013-04-10T21:41:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 876f5561
- Parents:
- 5b77efc
- Location:
- uspace/lib/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm.c
r5b77efc reb0ef51 36 36 #include <ddf/log.h> 37 37 #include <errno.h> 38 #include <macros.h> 38 39 #include <str.h> 39 40 #include <as.h> … … 58 59 } audio_pcm_iface_funcs_t; 59 60 61 /** 62 * Get human readable capability name. 63 * @param cap audio capability. 64 * @return Valid string 65 */ 60 66 const char *audio_pcm_cap_str(audio_cap_t cap) 61 67 { … … 69 75 [AUDIO_CAP_INTERRUPT_MAX_FRAMES] = "MAXIMUM FRAGMENT SIZE", 70 76 }; 71 if (cap > (sizeof(caps) / sizeof(*caps)))77 if (cap >= ARRAY_SIZE(caps)) 72 78 return "UNKNOWN CAP"; 73 79 return caps[cap]; … … 75 81 } 76 82 83 /** 84 * Get human readable event name. 85 * @param event Audio device event 86 * @return Valid string 87 */ 77 88 const char *audio_pcm_event_str(pcm_event_t event) 78 89 { … … 85 96 [PCM_EVENT_CAPTURE_TERMINATED] = "CAPTURE TERMINATED", 86 97 }; 87 if (event > (sizeof(events) / sizeof(*events)))98 if (event >= ARRAY_SIZE(events)) 88 99 return "UNKNOWN EVENT"; 89 100 return events[event]; … … 123 134 return session; 124 135 } 136 125 137 /** 126 138 * Open audio session with device identified by location service string. -
uspace/lib/drv/include/audio_pcm_iface.h
r5b77efc reb0ef51 45 45 46 46 typedef enum { 47 /** Device is capable of audio capture */ 47 48 AUDIO_CAP_CAPTURE, 49 /** Device is capable of audio playback */ 48 50 AUDIO_CAP_PLAYBACK, 51 /** Maximum size of device buffer */ 49 52 AUDIO_CAP_MAX_BUFFER, 53 /** Device is capable of providing accurate buffer position info */ 50 54 AUDIO_CAP_BUFFER_POS, 55 /** Device is capable of event based playback or capture */ 51 56 AUDIO_CAP_INTERRUPT, 57 /** Minimal size of playback/record fragment */ 52 58 AUDIO_CAP_INTERRUPT_MIN_FRAMES, 59 /** Maximum size of playback/record fragment */ 53 60 AUDIO_CAP_INTERRUPT_MAX_FRAMES, 54 61 } audio_cap_t;
Note:
See TracChangeset
for help on using the changeset viewer.