[0] | 1 | //streams.h: |
---|
| 2 | |
---|
[668] | 3 | /* |
---|
| 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008 |
---|
| 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 |
---|
| 21 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 22 | * |
---|
| 23 | */ |
---|
| 24 | |
---|
[0] | 25 | #ifndef _STREAMS_H_ |
---|
| 26 | #define _STREAMS_H_ |
---|
| 27 | |
---|
| 28 | #include <roaraudio.h> |
---|
| 29 | |
---|
| 30 | /* |
---|
| 31 | Defined in <roaraudio/streams.h> |
---|
| 32 | |
---|
| 33 | #define ROAR_STREAMS_MAX 64 |
---|
| 34 | */ |
---|
| 35 | |
---|
[21] | 36 | //#define ROAR_STREAM(x) ((struct roar_stream*)(x)) |
---|
[0] | 37 | #define ROAR_STREAM_SERVER(x) ((struct roar_stream_server*)(x)) |
---|
| 38 | |
---|
[1224] | 39 | // stream ctls...: |
---|
| 40 | |
---|
| 41 | #define ROAR_STREAM_CTL_COMPMASK 0xFF000000 |
---|
| 42 | #define ROAR_STREAM_CTL_TYPEMASK 0x00FF0000 |
---|
| 43 | #define ROAR_STREAM_CTL_CMDMASK 0x0000FFFF |
---|
| 44 | |
---|
| 45 | #define ROAR_STREAM_CTL_COMP_BASE 0x00000000 |
---|
| 46 | #define ROAR_STREAM_CTL_COMP_CF 0x01000000 |
---|
| 47 | #define ROAR_STREAM_CTL_COMP_DRV 0x02000000 |
---|
| 48 | |
---|
[2288] | 49 | #define ROAR_STREAM_CTL_TYPE_VOID 0x00000000 |
---|
[2082] | 50 | #define ROAR_STREAM_CTL_TYPE_INT 0x00010000 |
---|
| 51 | #define ROAR_STREAM_CTL_TYPE_FLOAT 0x00020000 |
---|
| 52 | #define ROAR_STREAM_CTL_TYPE_FPI100 0x00030000 /* fix point integter int/100 */ |
---|
[1224] | 53 | |
---|
[0] | 54 | struct roar_stream_server { |
---|
| 55 | struct roar_stream _stream; |
---|
| 56 | unsigned int pos_abs; |
---|
| 57 | int client; |
---|
| 58 | struct roar_buffer * buffer; |
---|
| 59 | size_t need_extra; |
---|
| 60 | void * output; |
---|
[16] | 61 | struct roar_mixer_settings mixer; |
---|
[1493] | 62 | #ifdef ROAR_SUPPORT_META |
---|
[87] | 63 | struct roar_meta meta[ROAR_META_MAX_PER_STREAM]; |
---|
[1493] | 64 | #endif |
---|
[125] | 65 | int is_new; |
---|
[241] | 66 | int codecfilter; |
---|
[240] | 67 | int codec_orgi; |
---|
[241] | 68 | CODECFILTER_USERDATA_T codecfilter_inst; |
---|
[377] | 69 | int socktype; |
---|
[494] | 70 | int pre_underruns; |
---|
| 71 | int post_underruns; |
---|
[592] | 72 | struct roar_vio_calls vio; |
---|
[643] | 73 | int primary; |
---|
[930] | 74 | int driver_id; |
---|
[1857] | 75 | // struct roardsp_filterchain fc; |
---|
[1029] | 76 | int flags; |
---|
[1137] | 77 | uint_least32_t delay; |
---|
[1842] | 78 | char * name; |
---|
[1913] | 79 | int ready; |
---|
[2151] | 80 | struct roar_buffer * outputbuffer; |
---|
[2611] | 81 | int state; |
---|
[2816] | 82 | struct roar_buffer * prethru; |
---|
[3042] | 83 | struct roar_vio_calls jumbo; |
---|
| 84 | struct roar_vio_calls * viop; |
---|
[0] | 85 | } * g_streams[ROAR_STREAMS_MAX]; |
---|
| 86 | |
---|
[2254] | 87 | int streams_thru_num; |
---|
[2417] | 88 | int streams_recsource_id; |
---|
[2254] | 89 | |
---|
[0] | 90 | int streams_init (void); |
---|
| 91 | int streams_free (void); |
---|
| 92 | |
---|
| 93 | int streams_new (void); |
---|
| 94 | int streams_delete (int id); |
---|
| 95 | |
---|
| 96 | int streams_set_client (int id, int client); |
---|
[766] | 97 | int streams_get_client (int id); |
---|
[0] | 98 | |
---|
[1609] | 99 | int streams_set_dir (int id, int dir, int defaults); |
---|
[2249] | 100 | int streams_get_dir (int id); |
---|
[1609] | 101 | |
---|
[2415] | 102 | int streams_get_subsys (int id); |
---|
| 103 | |
---|
[2594] | 104 | int streams_new_virtual (int parent, struct roar_stream_server ** stream); |
---|
[2593] | 105 | |
---|
[0] | 106 | int streams_set_fh (int id, int fh); |
---|
[66] | 107 | int streams_get_fh (int id); |
---|
[2606] | 108 | int streams_set_null_io(int id); |
---|
[0] | 109 | int streams_get (int id, struct roar_stream_server ** stream); |
---|
| 110 | |
---|
[377] | 111 | int streams_set_socktype (int id, int socktype); |
---|
| 112 | int streams_get_socktype (int id); |
---|
| 113 | |
---|
[643] | 114 | int streams_set_primary (int id, int prim); |
---|
| 115 | int streams_mark_primary (int id); |
---|
[1116] | 116 | int streams_set_sync (int id, int sync); |
---|
[1928] | 117 | int streams_set_mmap (int id, int reset); |
---|
[1029] | 118 | int streams_set_flag (int id, int flag); |
---|
[2625] | 119 | int streams_set_rawflag (int id, int flag); |
---|
[1029] | 120 | int streams_reset_flag (int id, int flag); |
---|
[1042] | 121 | int streams_get_flag (int id, int flag); |
---|
[643] | 122 | |
---|
[1842] | 123 | int streams_set_name (int id, char * name); |
---|
| 124 | char * streams_get_name (int id); |
---|
| 125 | |
---|
[1223] | 126 | int streams_calc_delay (int id); |
---|
[1590] | 127 | int streams_set_mixer (int id); |
---|
[1223] | 128 | |
---|
[1224] | 129 | int streams_ctl (int id, int_least32_t cmd, void * data); |
---|
[1142] | 130 | |
---|
[0] | 131 | int stream_add_buffer (int id, struct roar_buffer * buf); |
---|
| 132 | //int stream_get_buffer (int id, struct roar_buffer ** buf); |
---|
[2061] | 133 | int stream_shift_out_buffer (int id, void * data, size_t * len); |
---|
[0] | 134 | int stream_shift_buffer (int id, struct roar_buffer ** buf); |
---|
| 135 | int stream_unshift_buffer (int id, struct roar_buffer * buf); |
---|
| 136 | |
---|
[2151] | 137 | int stream_outputbuffer_request(int id, struct roar_buffer ** buf, size_t len); |
---|
| 138 | int stream_outputbuffer_destroy(int id); |
---|
| 139 | |
---|
[2816] | 140 | int stream_prethru_add(int id, struct roar_buffer * buf); |
---|
| 141 | int stream_prethru_add_data(int id, void ** buf, size_t len); |
---|
| 142 | int stream_prethru_destroy(int id); |
---|
| 143 | int stream_prethru_send(int dst, int src); |
---|
| 144 | |
---|
[0] | 145 | int streams_check (int id); |
---|
| 146 | int streams_send_mon (int id); |
---|
| 147 | int streams_send_filter(int id); |
---|
| 148 | |
---|
| 149 | int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos); |
---|
| 150 | int streams_get_outputbuffer (int id, void ** buffer, size_t size); |
---|
| 151 | int streams_fill_mixbuffer (int id, struct roar_audio_info * info); |
---|
[2061] | 152 | int streams_fill_mixbuffer2 (int id, struct roar_audio_info * info); |
---|
[0] | 153 | |
---|
[596] | 154 | ssize_t stream_vio_read (int stream, void *buf, size_t count); |
---|
| 155 | ssize_t stream_vio_write(int stream, void *buf, size_t count); |
---|
| 156 | ssize_t stream_vio_s_read (struct roar_stream_server * stream, void *buf, size_t count); |
---|
| 157 | ssize_t stream_vio_s_write(struct roar_stream_server * stream, void *buf, size_t count); |
---|
[0] | 158 | |
---|
| 159 | #endif |
---|
| 160 | |
---|
| 161 | //ll |
---|