[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 | |
---|
| 49 | |
---|
[0] | 50 | struct roar_stream_server { |
---|
| 51 | struct roar_stream _stream; |
---|
| 52 | unsigned int pos_abs; |
---|
| 53 | int client; |
---|
| 54 | struct roar_buffer * buffer; |
---|
| 55 | size_t need_extra; |
---|
| 56 | void * output; |
---|
[16] | 57 | struct roar_mixer_settings mixer; |
---|
[1493] | 58 | #ifdef ROAR_SUPPORT_META |
---|
[87] | 59 | struct roar_meta meta[ROAR_META_MAX_PER_STREAM]; |
---|
[1493] | 60 | #endif |
---|
[125] | 61 | int is_new; |
---|
[241] | 62 | int codecfilter; |
---|
[240] | 63 | int codec_orgi; |
---|
[241] | 64 | CODECFILTER_USERDATA_T codecfilter_inst; |
---|
[377] | 65 | int socktype; |
---|
[494] | 66 | int pre_underruns; |
---|
| 67 | int post_underruns; |
---|
[592] | 68 | struct roar_vio_calls vio; |
---|
[643] | 69 | int primary; |
---|
[930] | 70 | int driver_id; |
---|
[1857] | 71 | // struct roardsp_filterchain fc; |
---|
[1029] | 72 | int flags; |
---|
[1137] | 73 | uint_least32_t delay; |
---|
[1842] | 74 | char * name; |
---|
[0] | 75 | } * g_streams[ROAR_STREAMS_MAX]; |
---|
| 76 | |
---|
| 77 | int streams_init (void); |
---|
| 78 | int streams_free (void); |
---|
| 79 | |
---|
| 80 | int streams_new (void); |
---|
| 81 | int streams_delete (int id); |
---|
| 82 | |
---|
| 83 | int streams_set_client (int id, int client); |
---|
[766] | 84 | int streams_get_client (int id); |
---|
[0] | 85 | |
---|
[1609] | 86 | int streams_set_dir (int id, int dir, int defaults); |
---|
| 87 | |
---|
[0] | 88 | int streams_set_fh (int id, int fh); |
---|
[66] | 89 | int streams_get_fh (int id); |
---|
[0] | 90 | int streams_get (int id, struct roar_stream_server ** stream); |
---|
| 91 | |
---|
[377] | 92 | int streams_set_socktype (int id, int socktype); |
---|
| 93 | int streams_get_socktype (int id); |
---|
| 94 | |
---|
[643] | 95 | int streams_set_primary (int id, int prim); |
---|
| 96 | int streams_mark_primary (int id); |
---|
[1116] | 97 | int streams_set_sync (int id, int sync); |
---|
[1029] | 98 | int streams_set_flag (int id, int flag); |
---|
| 99 | int streams_reset_flag (int id, int flag); |
---|
[1042] | 100 | int streams_get_flag (int id, int flag); |
---|
[643] | 101 | |
---|
[1842] | 102 | int streams_set_name (int id, char * name); |
---|
| 103 | char * streams_get_name (int id); |
---|
| 104 | |
---|
[1223] | 105 | int streams_calc_delay (int id); |
---|
[1590] | 106 | int streams_set_mixer (int id); |
---|
[1223] | 107 | |
---|
[1224] | 108 | int streams_ctl (int id, int_least32_t cmd, void * data); |
---|
[1142] | 109 | |
---|
[0] | 110 | int stream_add_buffer (int id, struct roar_buffer * buf); |
---|
| 111 | //int stream_get_buffer (int id, struct roar_buffer ** buf); |
---|
| 112 | int stream_shift_buffer (int id, struct roar_buffer ** buf); |
---|
| 113 | int stream_unshift_buffer (int id, struct roar_buffer * buf); |
---|
| 114 | |
---|
| 115 | int streams_check (int id); |
---|
| 116 | int streams_send_mon (int id); |
---|
| 117 | int streams_send_filter(int id); |
---|
| 118 | |
---|
| 119 | int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos); |
---|
| 120 | int streams_get_outputbuffer (int id, void ** buffer, size_t size); |
---|
| 121 | int streams_fill_mixbuffer (int id, struct roar_audio_info * info); |
---|
| 122 | |
---|
[596] | 123 | ssize_t stream_vio_read (int stream, void *buf, size_t count); |
---|
| 124 | ssize_t stream_vio_write(int stream, void *buf, size_t count); |
---|
| 125 | ssize_t stream_vio_s_read (struct roar_stream_server * stream, void *buf, size_t count); |
---|
| 126 | ssize_t stream_vio_s_write(struct roar_stream_server * stream, void *buf, size_t count); |
---|
[0] | 127 | |
---|
| 128 | #endif |
---|
| 129 | |
---|
| 130 | //ll |
---|