[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 | |
---|
| 39 | struct roar_stream_server { |
---|
| 40 | struct roar_stream _stream; |
---|
| 41 | unsigned int pos_abs; |
---|
| 42 | int client; |
---|
| 43 | struct roar_buffer * buffer; |
---|
| 44 | size_t need_extra; |
---|
| 45 | void * output; |
---|
[16] | 46 | struct roar_mixer_settings mixer; |
---|
[87] | 47 | struct roar_meta meta[ROAR_META_MAX_PER_STREAM]; |
---|
[125] | 48 | int is_new; |
---|
[241] | 49 | int codecfilter; |
---|
[240] | 50 | int codec_orgi; |
---|
[241] | 51 | CODECFILTER_USERDATA_T codecfilter_inst; |
---|
[377] | 52 | int socktype; |
---|
[494] | 53 | int pre_underruns; |
---|
| 54 | int post_underruns; |
---|
[592] | 55 | struct roar_vio_calls vio; |
---|
[643] | 56 | int primary; |
---|
[930] | 57 | int driver_id; |
---|
[980] | 58 | struct roardsp_filterchain fc; |
---|
[1029] | 59 | int flags; |
---|
[0] | 60 | } * g_streams[ROAR_STREAMS_MAX]; |
---|
| 61 | |
---|
| 62 | int streams_init (void); |
---|
| 63 | int streams_free (void); |
---|
| 64 | |
---|
| 65 | int streams_new (void); |
---|
| 66 | int streams_delete (int id); |
---|
| 67 | |
---|
| 68 | int streams_set_client (int id, int client); |
---|
[766] | 69 | int streams_get_client (int id); |
---|
[0] | 70 | |
---|
| 71 | int streams_set_fh (int id, int fh); |
---|
[66] | 72 | int streams_get_fh (int id); |
---|
[0] | 73 | int streams_get (int id, struct roar_stream_server ** stream); |
---|
| 74 | |
---|
[377] | 75 | int streams_set_socktype (int id, int socktype); |
---|
| 76 | int streams_get_socktype (int id); |
---|
| 77 | |
---|
[643] | 78 | int streams_set_primary (int id, int prim); |
---|
| 79 | int streams_mark_primary (int id); |
---|
[1029] | 80 | int streams_set_flag (int id, int flag); |
---|
| 81 | int streams_reset_flag (int id, int flag); |
---|
[1042] | 82 | int streams_get_flag (int id, int flag); |
---|
[643] | 83 | |
---|
[0] | 84 | int stream_add_buffer (int id, struct roar_buffer * buf); |
---|
| 85 | //int stream_get_buffer (int id, struct roar_buffer ** buf); |
---|
| 86 | int stream_shift_buffer (int id, struct roar_buffer ** buf); |
---|
| 87 | int stream_unshift_buffer (int id, struct roar_buffer * buf); |
---|
| 88 | |
---|
| 89 | int streams_check (int id); |
---|
| 90 | int streams_send_mon (int id); |
---|
| 91 | int streams_send_filter(int id); |
---|
| 92 | |
---|
| 93 | int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos); |
---|
| 94 | int streams_get_outputbuffer (int id, void ** buffer, size_t size); |
---|
| 95 | int streams_fill_mixbuffer (int id, struct roar_audio_info * info); |
---|
| 96 | |
---|
[596] | 97 | ssize_t stream_vio_read (int stream, void *buf, size_t count); |
---|
| 98 | ssize_t stream_vio_write(int stream, void *buf, size_t count); |
---|
| 99 | ssize_t stream_vio_s_read (struct roar_stream_server * stream, void *buf, size_t count); |
---|
| 100 | ssize_t stream_vio_s_write(struct roar_stream_server * stream, void *buf, size_t count); |
---|
[0] | 101 | |
---|
| 102 | #endif |
---|
| 103 | |
---|
| 104 | //ll |
---|