Changeset aae11d0 in mainline
- Timestamp:
- 2012-08-20T14:25:15Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c04ff9f
- Parents:
- 6f57933
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/pcm_iface.c
r6f57933 raae11d0 40 40 #include "dsp.h" 41 41 42 static inline sb_dsp_t * fun_to_dsp(ddf_fun_t *fun) 43 { 44 assert(fun); 45 assert(fun->driver_data); 46 return fun->driver_data; 47 } 48 42 49 static int sb_get_info_str(ddf_fun_t *fun, const char** name) 43 50 { … … 49 56 static unsigned sb_query_cap(ddf_fun_t *fun, audio_cap_t cap) 50 57 { 51 assert(fun); 52 assert(fun->driver_data); 53 sb_dsp_t *dsp = fun->driver_data; 54 return sb_dsp_query_cap(dsp, cap); 58 return sb_dsp_query_cap(fun_to_dsp(fun), cap); 55 59 } 56 60 … … 58 62 pcm_sample_format_t *format) 59 63 { 60 assert(fun); 61 assert(fun->driver_data); 62 sb_dsp_t *dsp = fun->driver_data; 63 return sb_dsp_test_format(dsp, channels, rate, format); 64 return sb_dsp_test_format(fun_to_dsp(fun), channels, rate, format); 64 65 } 65 66 static int sb_get_buffer(ddf_fun_t *fun, void **buffer, size_t *size) 66 67 { 67 assert(fun); 68 assert(fun->driver_data); 69 sb_dsp_t *dsp = fun->driver_data; 70 return sb_dsp_get_buffer(dsp, buffer, size); 68 return sb_dsp_get_buffer(fun_to_dsp(fun), buffer, size); 71 69 } 72 70 73 71 static int sb_get_buffer_position(ddf_fun_t *fun, size_t *size) 74 72 { 75 assert(fun); 76 assert(fun->driver_data); 77 sb_dsp_t *dsp = fun->driver_data; 78 return sb_dsp_get_buffer_position(dsp, size); 73 return sb_dsp_get_buffer_position(fun_to_dsp(fun), size); 79 74 } 80 75 81 76 static int sb_set_event_session(ddf_fun_t *fun, async_sess_t *sess) 82 77 { 83 assert(fun); 84 assert(fun->driver_data); 85 sb_dsp_t *dsp = fun->driver_data; 86 return sb_dsp_set_event_session(dsp, sess); 78 return sb_dsp_set_event_session(fun_to_dsp(fun), sess); 87 79 } 88 80 89 81 static async_sess_t * sb_get_event_session(ddf_fun_t *fun) 90 82 { 91 assert(fun); 92 assert(fun->driver_data); 93 sb_dsp_t *dsp = fun->driver_data; 94 return sb_dsp_get_event_session(dsp); 83 return sb_dsp_get_event_session(fun_to_dsp(fun)); 95 84 } 96 85 97 86 static int sb_release_buffer(ddf_fun_t *fun) 98 87 { 99 assert(fun); 100 assert(fun->driver_data); 101 sb_dsp_t *dsp = fun->driver_data; 102 return sb_dsp_release_buffer(dsp); 88 return sb_dsp_release_buffer(fun_to_dsp(fun)); 103 89 } 104 90 … … 106 92 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 107 93 { 108 assert(fun);109 assert(fun->driver_data);110 sb_dsp_t *dsp = fun->driver_data;111 94 return sb_dsp_start_playback( 112 dsp, frames, channels, sample_rate, format);95 fun_to_dsp(fun), frames, channels, sample_rate, format); 113 96 } 114 97 115 98 static int sb_stop_playback(ddf_fun_t *fun) 116 99 { 117 assert(fun); 118 assert(fun->driver_data); 119 sb_dsp_t *dsp = fun->driver_data; 120 return sb_dsp_stop_playback(dsp); 100 return sb_dsp_stop_playback(fun_to_dsp(fun)); 121 101 } 122 102 … … 124 104 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 125 105 { 126 assert(fun);127 assert(fun->driver_data);128 sb_dsp_t *dsp = fun->driver_data;129 106 return sb_dsp_start_capture( 130 dsp, frames, channels, sample_rate, format);107 fun_to_dsp(fun), frames, channels, sample_rate, format); 131 108 } 132 109 133 110 static int sb_stop_capture(ddf_fun_t *fun) 134 111 { 135 assert(fun); 136 assert(fun->driver_data); 137 sb_dsp_t *dsp = fun->driver_data; 138 return sb_dsp_stop_capture(dsp); 112 return sb_dsp_stop_capture(fun_to_dsp(fun)); 139 113 } 140 114
Note:
See TracChangeset
for help on using the changeset viewer.