| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #ifndef _session_h_ |
|---|
| 15 | #define _session_h_ |
|---|
| 16 | |
|---|
| 17 | #include "net_udp.h" |
|---|
| 18 | #include "ts.h" |
|---|
| 19 | #include "audio_types.h" |
|---|
| 20 | #include "converter_types.h" |
|---|
| 21 | #include "repair_types.h" |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | #define MAX_LAYERS 2 |
|---|
| 25 | |
|---|
| 26 | #define MAX_ENCODINGS 7 |
|---|
| 27 | #define MAX_NATIVE 4 |
|---|
| 28 | |
|---|
| 29 | #define MAX_PACKET_SAMPLES 1280 |
|---|
| 30 | #define PACKET_LENGTH MAX_PACKET_SAMPLES + 100 |
|---|
| 31 | |
|---|
| 32 | #define PORT_UNINIT 0 |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | #define AUDIO_TOOL 1 |
|---|
| 36 | #define TRANSCODER 2 |
|---|
| 37 | #define FLAKEAWAY 4 |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | #define GLOBAL_CLOCK_FREQ 96000 |
|---|
| 41 | |
|---|
| 42 | #define PT_VANILLA -1 |
|---|
| 43 | #define PT_INTERLEAVED 108 |
|---|
| 44 | #define PT_REDUNDANCY 121 |
|---|
| 45 | |
|---|
| 46 | #define SESSION_TITLE_LEN 40 |
|---|
| 47 | |
|---|
| 48 | extern int thread_pri; |
|---|
| 49 | |
|---|
| 50 | typedef struct s_session { |
|---|
| 51 | short id; |
|---|
| 52 | int mode; |
|---|
| 53 | char *title; |
|---|
| 54 | char asc_address[MAX_LAYERS][MAXHOSTNAMELEN+1]; |
|---|
| 55 | u_short rx_rtp_port[MAX_LAYERS]; |
|---|
| 56 | u_short tx_rtp_port[MAX_LAYERS]; |
|---|
| 57 | u_short rx_rtcp_port; |
|---|
| 58 | u_short tx_rtcp_port; |
|---|
| 59 | int ttl; |
|---|
| 60 | struct rtp *rtp_session[MAX_LAYERS]; |
|---|
| 61 | int rtp_session_count; |
|---|
| 62 | uint8_t layers; |
|---|
| 63 | int filter_loopback; |
|---|
| 64 | struct s_fast_time *clock; |
|---|
| 65 | struct s_time *device_clock; |
|---|
| 66 | struct s_cushion_struct *cushion; |
|---|
| 67 | struct s_mix_info *ms; |
|---|
| 68 | struct s_audio_config *new_config; |
|---|
| 69 | u_char encodings[MAX_ENCODINGS]; |
|---|
| 70 | int num_encodings; |
|---|
| 71 | struct s_channel_state *channel_coder; |
|---|
| 72 | int playing_audio; |
|---|
| 73 | repair_id_t repair; |
|---|
| 74 | converter_id_t converter; |
|---|
| 75 | int lecture; |
|---|
| 76 | int render_3d; |
|---|
| 77 | int echo_suppress; |
|---|
| 78 | int echo_tx_active; |
|---|
| 79 | int auto_lecture; |
|---|
| 80 | int receive_audit_required; |
|---|
| 81 | int detect_silence; |
|---|
| 82 | int meter; |
|---|
| 83 | uint32_t meter_period; |
|---|
| 84 | int ui_activated; |
|---|
| 85 | int sync_on; |
|---|
| 86 | int agc_on; |
|---|
| 87 | int ui_on; |
|---|
| 88 | char *ui_addr; |
|---|
| 89 | struct s_sndfile *in_file; |
|---|
| 90 | struct s_sndfile *out_file; |
|---|
| 91 | audio_desc_t audio_device; |
|---|
| 92 | struct s_tx_buffer *tb; |
|---|
| 93 | struct s_pdb *pdb; |
|---|
| 94 | |
|---|
| 95 | struct s_source_list *active_sources; |
|---|
| 96 | ts_sequencer decode_sequencer; |
|---|
| 97 | int limit_playout; |
|---|
| 98 | uint32_t min_playout; |
|---|
| 99 | uint32_t max_playout; |
|---|
| 100 | uint32_t last_depart_ts; |
|---|
| 101 | char *mbus_engine_addr; |
|---|
| 102 | struct mbus *mbus_engine; |
|---|
| 103 | char *mbus_ui_addr; |
|---|
| 104 | struct mbus *mbus_ui; |
|---|
| 105 | char *mbus_video_addr; |
|---|
| 106 | ts_t cur_ts; |
|---|
| 107 | int loopback_gain; |
|---|
| 108 | } session_t; |
|---|
| 109 | |
|---|
| 110 | void session_init(session_t *sp); |
|---|
| 111 | void session_exit(session_t *sp); |
|---|
| 112 | |
|---|
| 113 | #endif |
|---|