diff options
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r-- | toxav/toxav.h | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index ec232ddd..101047ed 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -187,43 +187,41 @@ bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, ui | |||
187 | ******************************************************************************/ | 187 | ******************************************************************************/ |
188 | typedef enum TOXAV_CALL_STATE { | 188 | typedef enum TOXAV_CALL_STATE { |
189 | /** | 189 | /** |
190 | * Not sending anything. Either the friend requested that this client stops | 190 | * Not sending nor receiving anything, meaning, one of the sides requested pause. |
191 | * sending anything, or the client turned off both audio and video by setting | 191 | * The call will be resumed once the side that initiated pause resumes it. |
192 | * the respective bit rates to 0. | ||
193 | * | ||
194 | * If both sides are in this state, the call is effectively on hold, but not | ||
195 | * in the PAUSED state. | ||
196 | */ | 192 | */ |
197 | TOXAV_CALL_STATE_NOT_SENDING, | 193 | TOXAV_CALL_STATE_PAUSED = 0, |
198 | /** | 194 | /** |
199 | * Sending audio only. Either the friend requested that this client stops | 195 | * The flag that marks that friend is sending audio. |
200 | * sending video, or the client turned off video by setting the video bit rate | ||
201 | * to 0. | ||
202 | */ | 196 | */ |
203 | TOXAV_CALL_STATE_SENDING_A, | 197 | TOXAV_CALL_STATE_SENDING_A = 1, |
204 | /** | 198 | /** |
205 | * Sending video only. Either the friend requested that this client stops | 199 | * The flag that marks that friend is sending video. |
206 | * sending audio (muted), or the client turned off audio by setting the audio | ||
207 | * bit rate to 0. | ||
208 | */ | 200 | */ |
209 | TOXAV_CALL_STATE_SENDING_V, | 201 | TOXAV_CALL_STATE_SENDING_V = 2, |
210 | /** | 202 | /** |
211 | * Sending both audio and video. | 203 | * The flag that marks that friend is receiving audio. |
212 | */ | 204 | */ |
213 | TOXAV_CALL_STATE_SENDING_AV, | 205 | TOXAV_CALL_STATE_RECEIVING_A = 4, |
214 | /** | 206 | /** |
215 | * The call is on hold. Both sides stop sending and receiving. | 207 | * The flag that marks that friend is receiving video. |
216 | */ | 208 | */ |
217 | TOXAV_CALL_STATE_PAUSED, | 209 | TOXAV_CALL_STATE_RECEIVING_V = 8, |
210 | |||
211 | /** | ||
212 | * The core will never set TOXAV_CALL_STATE_END or TOXAV_CALL_STATE_ERROR | ||
213 | * together with other states. | ||
214 | */ | ||
215 | |||
218 | /** | 216 | /** |
219 | * The call has finished. This is the final state after which no more state | 217 | * The call has finished. This is the final state after which no more state |
220 | * transitions can occur for the call. | 218 | * transitions can occur for the call. |
221 | */ | 219 | */ |
222 | TOXAV_CALL_STATE_END, | 220 | TOXAV_CALL_STATE_END = 16, |
223 | /** | 221 | /** |
224 | * Sent by the AV core if an error occurred on the remote end. | 222 | * Sent by the AV core if an error occurred on the remote end. |
225 | */ | 223 | */ |
226 | TOXAV_CALL_STATE_ERROR | 224 | TOXAV_CALL_STATE_ERROR = 32 |
227 | } TOXAV_CALL_STATE; | 225 | } TOXAV_CALL_STATE; |
228 | /** | 226 | /** |
229 | * The function type for the `call_state` callback. | 227 | * The function type for the `call_state` callback. |
@@ -231,7 +229,7 @@ typedef enum TOXAV_CALL_STATE { | |||
231 | * @param friend_number The friend number for which the call state changed. | 229 | * @param friend_number The friend number for which the call state changed. |
232 | * @param state The new call state. | 230 | * @param state The new call state. |
233 | */ | 231 | */ |
234 | typedef void toxav_call_state_cb(ToxAV *av, uint32_t friend_number, TOXAV_CALL_STATE state, void *user_data); | 232 | typedef void toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data); |
235 | /** | 233 | /** |
236 | * Set the callback for the `call_state` event. Pass NULL to unset. | 234 | * Set the callback for the `call_state` event. Pass NULL to unset. |
237 | * | 235 | * |
@@ -261,27 +259,19 @@ typedef enum TOXAV_CALL_CONTROL { | |||
261 | /** | 259 | /** |
262 | * Request that the friend stops sending audio. Regardless of the friend's | 260 | * Request that the friend stops sending audio. Regardless of the friend's |
263 | * compliance, this will cause the `receive_audio_frame` event to stop being | 261 | * compliance, this will cause the `receive_audio_frame` event to stop being |
264 | * triggered on receiving an audio frame from the friend. | 262 | * triggered on receiving an audio frame from the friend. If the audio was |
263 | * already muted, calling this control will notify client to start sending | ||
264 | * audio again. | ||
265 | */ | 265 | */ |
266 | TOXAV_CALL_CONTROL_MUTE_AUDIO, | 266 | TOXAV_CALL_CONTROL_TOGGLE_MUTE_AUDIO, |
267 | /** | 267 | /** |
268 | * Request that the friend stops sending video. Regardless of the friend's | 268 | * Request that the friend stops sending video. Regardless of the friend's |
269 | * compliance, this will cause the `receive_video_frame` event to stop being | 269 | * compliance, this will cause the `receive_video_frame` event to stop being |
270 | * triggered on receiving an video frame from the friend. | 270 | * triggered on receiving an video frame from the friend. If the video was |
271 | */ | 271 | * already muted, calling this control will notify client to start sending |
272 | TOXAV_CALL_CONTROL_MUTE_VIDEO, | 272 | * video again. |
273 | /** | ||
274 | * Notify the friend that we are AGAIN ready to handle incoming audio. | ||
275 | * This control will not work if the call is not started with audio | ||
276 | * initiated. | ||
277 | */ | ||
278 | TOXAV_CALL_CONTROL_UNMUTE_AUDIO, | ||
279 | /** | ||
280 | * Notify the friend that we are AGAIN ready to handle incoming video. | ||
281 | * This control will not work if the call is not started with video | ||
282 | * initiated. | ||
283 | */ | 273 | */ |
284 | TOXAV_CALL_CONTROL_UNMUTE_VIDEO | 274 | TOXAV_CALL_CONTROL_TOGGLE_MUTE_VIDEO, |
285 | } TOXAV_CALL_CONTROL; | 275 | } TOXAV_CALL_CONTROL; |
286 | typedef enum TOXAV_ERR_CALL_CONTROL { | 276 | typedef enum TOXAV_ERR_CALL_CONTROL { |
287 | TOXAV_ERR_CALL_CONTROL_OK, | 277 | TOXAV_ERR_CALL_CONTROL_OK, |