[0] | 1 | //streams.h: |
---|
| 2 | |
---|
[668] | 3 | /* |
---|
[3811] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010 |
---|
[668] | 5 | * |
---|
| 6 | * This file is part of roard a part of RoarAudio, |
---|
| 7 | * a cross-platform sound system for both, home and professional use. |
---|
| 8 | * See README for details. |
---|
| 9 | * |
---|
| 10 | * This file is free software; you can redistribute it and/or modify |
---|
| 11 | * it under the terms of the GNU General Public License version 3 |
---|
| 12 | * as published by the Free Software Foundation. |
---|
| 13 | * |
---|
| 14 | * RoarAudio is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this software; see the file COPYING. If not, write to |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[668] | 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
[0] | 26 | #ifndef _STREAMS_H_ |
---|
| 27 | #define _STREAMS_H_ |
---|
| 28 | |
---|
| 29 | #include <roaraudio.h> |
---|
| 30 | |
---|
| 31 | /* |
---|
| 32 | Defined in <roaraudio/streams.h> |
---|
| 33 | |
---|
| 34 | #define ROAR_STREAMS_MAX 64 |
---|
| 35 | */ |
---|
| 36 | |
---|
[21] | 37 | //#define ROAR_STREAM(x) ((struct roar_stream*)(x)) |
---|
[0] | 38 | #define ROAR_STREAM_SERVER(x) ((struct roar_stream_server*)(x)) |
---|
| 39 | |
---|
[1224] | 40 | // stream ctls...: |
---|
| 41 | |
---|
| 42 | #define ROAR_STREAM_CTL_COMPMASK 0xFF000000 |
---|
| 43 | #define ROAR_STREAM_CTL_TYPEMASK 0x00FF0000 |
---|
| 44 | #define ROAR_STREAM_CTL_CMDMASK 0x0000FFFF |
---|
| 45 | |
---|
| 46 | #define ROAR_STREAM_CTL_COMP_BASE 0x00000000 |
---|
| 47 | #define ROAR_STREAM_CTL_COMP_CF 0x01000000 |
---|
| 48 | #define ROAR_STREAM_CTL_COMP_DRV 0x02000000 |
---|
| 49 | |
---|
[2288] | 50 | #define ROAR_STREAM_CTL_TYPE_VOID 0x00000000 |
---|
[2082] | 51 | #define ROAR_STREAM_CTL_TYPE_INT 0x00010000 |
---|
| 52 | #define ROAR_STREAM_CTL_TYPE_FLOAT 0x00020000 |
---|
| 53 | #define ROAR_STREAM_CTL_TYPE_FPI100 0x00030000 /* fix point integter int/100 */ |
---|
[1224] | 54 | |
---|
[3542] | 55 | #define STREAM_DIR_NONE 0x00 |
---|
| 56 | #define STREAM_DIR_IN 0x01 |
---|
| 57 | #define STREAM_DIR_OUT 0x02 |
---|
| 58 | #define STREAM_DIR_BIDIR (STREAM_DIR_IN|STREAM_DIR_OUT) |
---|
| 59 | |
---|
[0] | 60 | struct roar_stream_server { |
---|
| 61 | struct roar_stream _stream; |
---|
| 62 | unsigned int pos_abs; |
---|
| 63 | int client; |
---|
| 64 | struct roar_buffer * buffer; |
---|
| 65 | size_t need_extra; |
---|
| 66 | void * output; |
---|
[16] | 67 | struct roar_mixer_settings mixer; |
---|
[1493] | 68 | #ifdef ROAR_SUPPORT_META |
---|
[87] | 69 | struct roar_meta meta[ROAR_META_MAX_PER_STREAM]; |
---|
[1493] | 70 | #endif |
---|
[125] | 71 | int is_new; |
---|
[241] | 72 | int codecfilter; |
---|
[240] | 73 | int codec_orgi; |
---|
[241] | 74 | CODECFILTER_USERDATA_T codecfilter_inst; |
---|
[377] | 75 | int socktype; |
---|
[494] | 76 | int pre_underruns; |
---|
| 77 | int post_underruns; |
---|
[592] | 78 | struct roar_vio_calls vio; |
---|
[643] | 79 | int primary; |
---|
[930] | 80 | int driver_id; |
---|
[1857] | 81 | // struct roardsp_filterchain fc; |
---|
[1029] | 82 | int flags; |
---|
[1137] | 83 | uint_least32_t delay; |
---|
[1842] | 84 | char * name; |
---|
[1913] | 85 | int ready; |
---|
[2151] | 86 | struct roar_buffer * outputbuffer; |
---|
[2611] | 87 | int state; |
---|
[2816] | 88 | struct roar_buffer * prethru; |
---|
[3042] | 89 | struct roar_vio_calls jumbo; |
---|
| 90 | struct roar_vio_calls * viop; |
---|
[3213] | 91 | int mixer_stream; |
---|
[3334] | 92 | struct roardsp_chanmap chanmap; |
---|
[3630] | 93 | int role; |
---|
[0] | 94 | } * g_streams[ROAR_STREAMS_MAX]; |
---|
| 95 | |
---|
[2254] | 96 | int streams_thru_num; |
---|
[2417] | 97 | int streams_recsource_id; |
---|
[2254] | 98 | |
---|
[0] | 99 | int streams_init (void); |
---|
| 100 | int streams_free (void); |
---|
| 101 | |
---|
| 102 | int streams_new (void); |
---|
| 103 | int streams_delete (int id); |
---|
| 104 | |
---|
| 105 | int streams_set_client (int id, int client); |
---|
[766] | 106 | int streams_get_client (int id); |
---|
[0] | 107 | |
---|
[1609] | 108 | int streams_set_dir (int id, int dir, int defaults); |
---|
[2249] | 109 | int streams_get_dir (int id); |
---|
[1609] | 110 | |
---|
[3213] | 111 | int streams_set_mixer_stream(int id, int mixer); |
---|
| 112 | int streams_get_mixer_stream(int id, int mixer); |
---|
| 113 | |
---|
[3630] | 114 | int streams_set_role (int id, int role); |
---|
| 115 | |
---|
[2415] | 116 | int streams_get_subsys (int id); |
---|
[3542] | 117 | int streams_get_ssdir (int id); |
---|
[2415] | 118 | |
---|
[2594] | 119 | int streams_new_virtual (int parent, struct roar_stream_server ** stream); |
---|
[2593] | 120 | |
---|
[0] | 121 | int streams_set_fh (int id, int fh); |
---|
[66] | 122 | int streams_get_fh (int id); |
---|
[2606] | 123 | int streams_set_null_io(int id); |
---|
[0] | 124 | int streams_get (int id, struct roar_stream_server ** stream); |
---|
| 125 | |
---|
[377] | 126 | int streams_set_socktype (int id, int socktype); |
---|
| 127 | int streams_get_socktype (int id); |
---|
| 128 | |
---|
[643] | 129 | int streams_set_primary (int id, int prim); |
---|
| 130 | int streams_mark_primary (int id); |
---|
[1116] | 131 | int streams_set_sync (int id, int sync); |
---|
[1928] | 132 | int streams_set_mmap (int id, int reset); |
---|
[1029] | 133 | int streams_set_flag (int id, int flag); |
---|
[2625] | 134 | int streams_set_rawflag (int id, int flag); |
---|
[1029] | 135 | int streams_reset_flag (int id, int flag); |
---|
[1042] | 136 | int streams_get_flag (int id, int flag); |
---|
[643] | 137 | |
---|
[1842] | 138 | int streams_set_name (int id, char * name); |
---|
| 139 | char * streams_get_name (int id); |
---|
| 140 | |
---|
[1223] | 141 | int streams_calc_delay (int id); |
---|
[1590] | 142 | int streams_set_mixer (int id); |
---|
[1223] | 143 | |
---|
[3542] | 144 | int streams_set_map (int id, char * map, size_t len); |
---|
| 145 | |
---|
[1224] | 146 | int streams_ctl (int id, int_least32_t cmd, void * data); |
---|
[1142] | 147 | |
---|
[0] | 148 | int stream_add_buffer (int id, struct roar_buffer * buf); |
---|
| 149 | //int stream_get_buffer (int id, struct roar_buffer ** buf); |
---|
[2061] | 150 | int stream_shift_out_buffer (int id, void * data, size_t * len); |
---|
[0] | 151 | int stream_shift_buffer (int id, struct roar_buffer ** buf); |
---|
| 152 | int stream_unshift_buffer (int id, struct roar_buffer * buf); |
---|
| 153 | |
---|
[2151] | 154 | int stream_outputbuffer_request(int id, struct roar_buffer ** buf, size_t len); |
---|
| 155 | int stream_outputbuffer_destroy(int id); |
---|
| 156 | |
---|
[2816] | 157 | int stream_prethru_add(int id, struct roar_buffer * buf); |
---|
| 158 | int stream_prethru_add_data(int id, void ** buf, size_t len); |
---|
| 159 | int stream_prethru_destroy(int id); |
---|
| 160 | int stream_prethru_send(int dst, int src); |
---|
| 161 | |
---|
[0] | 162 | int streams_check (int id); |
---|
| 163 | int streams_send_mon (int id); |
---|
| 164 | int streams_send_filter(int id); |
---|
| 165 | |
---|
| 166 | int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos); |
---|
| 167 | int streams_get_outputbuffer (int id, void ** buffer, size_t size); |
---|
| 168 | int streams_fill_mixbuffer (int id, struct roar_audio_info * info); |
---|
[2061] | 169 | int streams_fill_mixbuffer2 (int id, struct roar_audio_info * info); |
---|
[0] | 170 | |
---|
[596] | 171 | ssize_t stream_vio_read (int stream, void *buf, size_t count); |
---|
| 172 | ssize_t stream_vio_write(int stream, void *buf, size_t count); |
---|
| 173 | ssize_t stream_vio_s_read (struct roar_stream_server * stream, void *buf, size_t count); |
---|
| 174 | ssize_t stream_vio_s_write(struct roar_stream_server * stream, void *buf, size_t count); |
---|
[0] | 175 | |
---|
| 176 | #endif |
---|
| 177 | |
---|
| 178 | //ll |
---|