diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-02-15 22:41:10 +0100 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-02-15 22:41:10 +0100 |
commit | 8c245affb1f7dac2baab263ad0c4e19314073d71 (patch) | |
tree | 9dc5d6af65009e6b7cd0012717ab9e7f37d50011 /toxav/msi.h | |
parent | aad857527cd63b5f79786df0c1aab50f4de87774 (diff) |
Started adjusting msi backend to new api
Diffstat (limited to 'toxav/msi.h')
-rw-r--r-- | toxav/msi.h | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/toxav/msi.h b/toxav/msi.h index bdd72e49..c71c69dd 100644 --- a/toxav/msi.h +++ b/toxav/msi.h | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | typedef uint8_t MSICallIDType[12]; | 31 | typedef uint8_t MSICallIDType[12]; |
32 | typedef uint8_t MSIReasonStrType[255]; | 32 | typedef uint8_t MSIReasonStrType[255]; |
33 | typedef void ( *MSICallbackType ) ( void *agent, int32_t call_idx, void *arg ); | 33 | typedef void ( *MSICallbackType ) ( void *agent, int32_t call_idx); |
34 | 34 | ||
35 | /** | 35 | /** |
36 | * Call type identifier. Also used as rtp callback prefix. | 36 | * Call type identifier. Also used as rtp callback prefix. |
@@ -70,6 +70,15 @@ typedef struct { | |||
70 | uint32_t audio_channels; | 70 | uint32_t audio_channels; |
71 | } MSICSettings; | 71 | } MSICSettings; |
72 | 72 | ||
73 | /** | ||
74 | * Active capabilities masks | ||
75 | */ | ||
76 | typedef enum { | ||
77 | msi_SendingAudio = 1, | ||
78 | msi_SendingVideo = 2, | ||
79 | msi_RecvingAudio = 4, | ||
80 | msi_RecvingVideo = 8, | ||
81 | } MSICapMask; | ||
73 | 82 | ||
74 | /** | 83 | /** |
75 | * Callbacks ids that handle the states | 84 | * Callbacks ids that handle the states |
@@ -100,25 +109,13 @@ typedef enum { | |||
100 | /** | 109 | /** |
101 | * The call struct. | 110 | * The call struct. |
102 | */ | 111 | */ |
103 | typedef struct { /* Call info structure */ | 112 | typedef struct { |
104 | struct MSISession_s *session; /* Session pointer */ | 113 | struct MSISession_s *session; /* Session pointer */ |
105 | 114 | ||
106 | MSICallState state; | 115 | MSICallState state; |
107 | 116 | uint8_t caps; /* Active capabilities */ | |
108 | MSICSettings csettings_local; /* Local call settings */ | 117 | |
109 | MSICSettings *csettings_peer; /* Peers call settings */ | 118 | uint32_t friend_id; /* Index of this call in MSISession */ |
110 | |||
111 | MSICallIDType id; /* Random value identifying the call */ | ||
112 | |||
113 | int ringing_tout_ms; /* Ringing timeout in ms */ | ||
114 | |||
115 | int request_timer_id; /* Timer id for outgoing request/action */ | ||
116 | int ringing_timer_id; /* Timer id for ringing timeout */ | ||
117 | |||
118 | uint32_t *peers; | ||
119 | uint16_t peer_count; | ||
120 | |||
121 | int32_t call_idx; /* Index of this call in MSISession */ | ||
122 | } MSICall; | 119 | } MSICall; |
123 | 120 | ||
124 | 121 | ||
@@ -126,21 +123,14 @@ typedef struct { /* Call info structure */ | |||
126 | * Control session struct | 123 | * Control session struct |
127 | */ | 124 | */ |
128 | typedef struct MSISession_s { | 125 | typedef struct MSISession_s { |
129 | |||
130 | /* Call handlers */ | 126 | /* Call handlers */ |
131 | MSICall **calls; | 127 | MSICall **calls; |
132 | int32_t max_calls; | ||
133 | 128 | ||
134 | void *agent_handler; | 129 | void *agent_handler; |
135 | Messenger *messenger_handle; | 130 | Messenger *messenger_handle; |
136 | 131 | ||
137 | uint32_t frequ; | ||
138 | uint32_t call_timeout; /* Time of the timeout for some action to end; 0 if infinite */ | ||
139 | |||
140 | pthread_mutex_t mutex[1]; | 132 | pthread_mutex_t mutex[1]; |
141 | 133 | MSICallbackType callbacks[10]; | |
142 | void *timer_handler; | ||
143 | PAIR(MSICallbackType, void *) callbacks[10]; | ||
144 | } MSISession; | 134 | } MSISession; |
145 | 135 | ||
146 | /** | 136 | /** |
@@ -156,7 +146,7 @@ int msi_kill ( MSISession *session ); | |||
156 | /** | 146 | /** |
157 | * Callback setter. | 147 | * Callback setter. |
158 | */ | 148 | */ |
159 | void msi_register_callback(MSISession *session, MSICallbackType callback, MSICallbackID id, void *userdata); | 149 | void msi_register_callback(MSISession *session, MSICallbackType callback, MSICallbackID id); |
160 | 150 | ||
161 | /** | 151 | /** |
162 | * Send invite request to friend_id. | 152 | * Send invite request to friend_id. |