diff options
Diffstat (limited to 'toxav/toxav.h')
-rwxr-xr-x | toxav/toxav.h | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index 6dac966b..74f2333b 100755 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -29,7 +29,7 @@ | |||
29 | /* vpx_image_t */ | 29 | /* vpx_image_t */ |
30 | #include <vpx/vpx_image.h> | 30 | #include <vpx/vpx_image.h> |
31 | 31 | ||
32 | typedef void ( *ToxAVCallback ) ( uint32_t, void *arg ); | 32 | typedef void ( *ToxAVCallback ) ( int32_t, void *arg ); |
33 | typedef struct _ToxAv ToxAv; | 33 | typedef struct _ToxAv ToxAv; |
34 | 34 | ||
35 | #ifndef __TOX_DEFINED__ | 35 | #ifndef __TOX_DEFINED__ |
@@ -133,7 +133,7 @@ extern const ToxAvCodecSettings av_DefaultSettings; | |||
133 | * @return ToxAv* | 133 | * @return ToxAv* |
134 | * @retval NULL On error. | 134 | * @retval NULL On error. |
135 | */ | 135 | */ |
136 | ToxAv *toxav_new(Tox *messenger, uint32_t max_calls); | 136 | ToxAv *toxav_new(Tox *messenger, int32_t max_calls); |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * @brief Remove A/V session. | 139 | * @brief Remove A/V session. |
@@ -163,7 +163,7 @@ void toxav_register_callstate_callback (ToxAVCallback callback, ToxAvCallbackID | |||
163 | * @retval 0 Success. | 163 | * @retval 0 Success. |
164 | * @retval ToxAvError On error. | 164 | * @retval ToxAvError On error. |
165 | */ | 165 | */ |
166 | int toxav_call(ToxAv *av, uint32_t* call_index, int user, ToxAvCallType call_type, int ringing_seconds); | 166 | int toxav_call(ToxAv *av, int32_t* call_index, int user, ToxAvCallType call_type, int ringing_seconds); |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * @brief Hangup active call. | 169 | * @brief Hangup active call. |
@@ -173,7 +173,7 @@ int toxav_call(ToxAv *av, uint32_t* call_index, int user, ToxAvCallType call_typ | |||
173 | * @retval 0 Success. | 173 | * @retval 0 Success. |
174 | * @retval ToxAvError On error. | 174 | * @retval ToxAvError On error. |
175 | */ | 175 | */ |
176 | int toxav_hangup(ToxAv *av, uint32_t call_index); | 176 | int toxav_hangup(ToxAv *av, int32_t call_index); |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * @brief Answer incomming call. | 179 | * @brief Answer incomming call. |
@@ -184,7 +184,7 @@ int toxav_hangup(ToxAv *av, uint32_t call_index); | |||
184 | * @retval 0 Success. | 184 | * @retval 0 Success. |
185 | * @retval ToxAvError On error. | 185 | * @retval ToxAvError On error. |
186 | */ | 186 | */ |
187 | int toxav_answer(ToxAv *av, uint32_t call_index, ToxAvCallType call_type ); | 187 | int toxav_answer(ToxAv *av, int32_t call_index, ToxAvCallType call_type ); |
188 | 188 | ||
189 | /** | 189 | /** |
190 | * @brief Reject incomming call. | 190 | * @brief Reject incomming call. |
@@ -195,7 +195,7 @@ int toxav_answer(ToxAv *av, uint32_t call_index, ToxAvCallType call_type ); | |||
195 | * @retval 0 Success. | 195 | * @retval 0 Success. |
196 | * @retval ToxAvError On error. | 196 | * @retval ToxAvError On error. |
197 | */ | 197 | */ |
198 | int toxav_reject(ToxAv *av, uint32_t call_index, const char *reason); | 198 | int toxav_reject(ToxAv *av, int32_t call_index, const char *reason); |
199 | 199 | ||
200 | /** | 200 | /** |
201 | * @brief Cancel outgoing request. | 201 | * @brief Cancel outgoing request. |
@@ -207,7 +207,7 @@ int toxav_reject(ToxAv *av, uint32_t call_index, const char *reason); | |||
207 | * @retval 0 Success. | 207 | * @retval 0 Success. |
208 | * @retval ToxAvError On error. | 208 | * @retval ToxAvError On error. |
209 | */ | 209 | */ |
210 | int toxav_cancel(ToxAv* av, uint32_t call_index, int peer_id, const char* reason); | 210 | int toxav_cancel(ToxAv* av, int32_t call_index, int peer_id, const char* reason); |
211 | 211 | ||
212 | /** | 212 | /** |
213 | * @brief Terminate transmission. Note that transmission will be terminated without informing remote peer. | 213 | * @brief Terminate transmission. Note that transmission will be terminated without informing remote peer. |
@@ -217,7 +217,7 @@ int toxav_cancel(ToxAv* av, uint32_t call_index, int peer_id, const char* reason | |||
217 | * @retval 0 Success. | 217 | * @retval 0 Success. |
218 | * @retval ToxAvError On error. | 218 | * @retval ToxAvError On error. |
219 | */ | 219 | */ |
220 | int toxav_stop_call(ToxAv *av, uint32_t call_index); | 220 | int toxav_stop_call(ToxAv *av, int32_t call_index); |
221 | 221 | ||
222 | /** | 222 | /** |
223 | * @brief Must be call before any RTP transmission occurs. | 223 | * @brief Must be call before any RTP transmission occurs. |
@@ -228,7 +228,7 @@ int toxav_stop_call(ToxAv *av, uint32_t call_index); | |||
228 | * @retval 0 Success. | 228 | * @retval 0 Success. |
229 | * @retval ToxAvError On error. | 229 | * @retval ToxAvError On error. |
230 | */ | 230 | */ |
231 | int toxav_prepare_transmission(ToxAv* av, uint32_t call_index, ToxAvCodecSettings* codec_settings, int support_video); | 231 | int toxav_prepare_transmission(ToxAv* av, int32_t call_index, ToxAvCodecSettings* codec_settings, int support_video); |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * @brief Call this at the end of the transmission. | 234 | * @brief Call this at the end of the transmission. |
@@ -238,7 +238,7 @@ int toxav_prepare_transmission(ToxAv* av, uint32_t call_index, ToxAvCodecSetting | |||
238 | * @retval 0 Success. | 238 | * @retval 0 Success. |
239 | * @retval ToxAvError On error. | 239 | * @retval ToxAvError On error. |
240 | */ | 240 | */ |
241 | int toxav_kill_transmission(ToxAv *av, uint32_t call_index); | 241 | int toxav_kill_transmission(ToxAv* av, int32_t call_index); |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * @brief Receive decoded video packet. | 244 | * @brief Receive decoded video packet. |
@@ -249,7 +249,7 @@ int toxav_kill_transmission(ToxAv *av, uint32_t call_index); | |||
249 | * @retval 0 Success. | 249 | * @retval 0 Success. |
250 | * @retval ToxAvError On Error. | 250 | * @retval ToxAvError On Error. |
251 | */ | 251 | */ |
252 | int toxav_recv_video ( ToxAv* av, uint32_t call_index, vpx_image_t** output); | 252 | int toxav_recv_video ( ToxAv* av, int32_t call_index, vpx_image_t** output); |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * @brief Receive decoded audio frame. | 255 | * @brief Receive decoded audio frame. |
@@ -263,7 +263,7 @@ int toxav_recv_video ( ToxAv* av, uint32_t call_index, vpx_image_t** output); | |||
263 | * @retval >=0 Size of received data in frames/samples. | 263 | * @retval >=0 Size of received data in frames/samples. |
264 | * @retval ToxAvError On error. | 264 | * @retval ToxAvError On error. |
265 | */ | 265 | */ |
266 | int toxav_recv_audio( ToxAv* av, uint32_t call_index, int frame_size, int16_t* dest ); | 266 | int toxav_recv_audio( ToxAv* av, int32_t call_index, int frame_size, int16_t* dest ); |
267 | 267 | ||
268 | /** | 268 | /** |
269 | * @brief Encode and send video packet. | 269 | * @brief Encode and send video packet. |
@@ -275,7 +275,7 @@ int toxav_recv_audio( ToxAv* av, uint32_t call_index, int frame_size, int16_t* d | |||
275 | * @retval 0 Success. | 275 | * @retval 0 Success. |
276 | * @retval ToxAvError On error. | 276 | * @retval ToxAvError On error. |
277 | */ | 277 | */ |
278 | int toxav_send_video ( ToxAv* av, uint32_t call_index, const uint8_t* frame, int frame_size); | 278 | int toxav_send_video ( ToxAv* av, int32_t call_index, const uint8_t* frame, int frame_size); |
279 | 279 | ||
280 | /** | 280 | /** |
281 | * @brief Send audio frame. | 281 | * @brief Send audio frame. |
@@ -288,7 +288,7 @@ int toxav_send_video ( ToxAv* av, uint32_t call_index, const uint8_t* frame, int | |||
288 | * @retval 0 Success. | 288 | * @retval 0 Success. |
289 | * @retval ToxAvError On error. | 289 | * @retval ToxAvError On error. |
290 | */ | 290 | */ |
291 | int toxav_send_audio ( ToxAv* av, uint32_t call_index, const uint8_t* frame, int frame_size); | 291 | int toxav_send_audio ( ToxAv* av, int32_t call_index, const uint8_t* frame, int frame_size); |
292 | 292 | ||
293 | /** | 293 | /** |
294 | * @brief Encode video frame | 294 | * @brief Encode video frame |
@@ -301,7 +301,7 @@ int toxav_send_audio ( ToxAv* av, uint32_t call_index, const uint8_t* frame, int | |||
301 | * @retval ToxAvError On error. | 301 | * @retval ToxAvError On error. |
302 | * @retval >0 On success | 302 | * @retval >0 On success |
303 | */ | 303 | */ |
304 | int toxav_prepare_video_frame ( ToxAv* av, uint32_t call_index, uint8_t* dest, int dest_max, vpx_image_t* input ); | 304 | int toxav_prepare_video_frame ( ToxAv* av, int32_t call_index, uint8_t* dest, int dest_max, vpx_image_t* input ); |
305 | 305 | ||
306 | /** | 306 | /** |
307 | * @brief Encode audio frame | 307 | * @brief Encode audio frame |
@@ -315,7 +315,7 @@ int toxav_prepare_video_frame ( ToxAv* av, uint32_t call_index, uint8_t* dest, i | |||
315 | * @retval ToxAvError On error. | 315 | * @retval ToxAvError On error. |
316 | * @retval >0 On success | 316 | * @retval >0 On success |
317 | */ | 317 | */ |
318 | int toxav_prepare_audio_frame ( ToxAv* av, uint32_t call_index, uint8_t* dest, int dest_max, const int16_t* frame, int frame_size); | 318 | int toxav_prepare_audio_frame ( ToxAv* av, int32_t call_index, uint8_t* dest, int dest_max, const int16_t* frame, int frame_size); |
319 | 319 | ||
320 | /** | 320 | /** |
321 | * @brief Get peer transmission type. It can either be audio or video. | 321 | * @brief Get peer transmission type. It can either be audio or video. |
@@ -326,7 +326,7 @@ int toxav_prepare_audio_frame ( ToxAv* av, uint32_t call_index, uint8_t* dest, i | |||
326 | * @retval ToxAvCallType On success. | 326 | * @retval ToxAvCallType On success. |
327 | * @retval ToxAvError On error. | 327 | * @retval ToxAvError On error. |
328 | */ | 328 | */ |
329 | int toxav_get_peer_transmission_type ( ToxAv *av, uint32_t call_index, int peer ); | 329 | int toxav_get_peer_transmission_type ( ToxAv* av, int32_t call_index, int peer ); |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * @brief Get id of peer participating in conversation | 332 | * @brief Get id of peer participating in conversation |
@@ -336,7 +336,7 @@ int toxav_get_peer_transmission_type ( ToxAv *av, uint32_t call_index, int peer | |||
336 | * @return int | 336 | * @return int |
337 | * @retval ToxAvError No peer id | 337 | * @retval ToxAvError No peer id |
338 | */ | 338 | */ |
339 | int toxav_get_peer_id ( ToxAv* av, uint32_t call_index, int peer ); | 339 | int toxav_get_peer_id ( ToxAv* av, int32_t call_index, int peer ); |
340 | 340 | ||
341 | /** | 341 | /** |
342 | * @brief Is certain capability supported | 342 | * @brief Is certain capability supported |
@@ -346,7 +346,7 @@ int toxav_get_peer_id ( ToxAv* av, uint32_t call_index, int peer ); | |||
346 | * @retval 1 Yes. | 346 | * @retval 1 Yes. |
347 | * @retval 0 No. | 347 | * @retval 0 No. |
348 | */ | 348 | */ |
349 | int toxav_capability_supported ( ToxAv* av, uint32_t call_index, ToxAvCapabilities capability ); | 349 | int toxav_capability_supported ( ToxAv* av, int32_t call_index, ToxAvCapabilities capability ); |
350 | 350 | ||
351 | /** | 351 | /** |
352 | * @brief Set queue limit | 352 | * @brief Set queue limit |
@@ -356,7 +356,7 @@ int toxav_capability_supported ( ToxAv* av, uint32_t call_index, ToxAvCapabiliti | |||
356 | * @param limit the limit | 356 | * @param limit the limit |
357 | * @return void | 357 | * @return void |
358 | */ | 358 | */ |
359 | void toxav_set_audio_queue_limit ( ToxAv* av, uint32_t call_index, uint64_t limit ); | 359 | int toxav_set_audio_queue_limit ( ToxAv* av, int32_t call_index, uint64_t limit ); |
360 | 360 | ||
361 | /** | 361 | /** |
362 | * @brief Set queue limit | 362 | * @brief Set queue limit |
@@ -366,6 +366,8 @@ void toxav_set_audio_queue_limit ( ToxAv* av, uint32_t call_index, uint64_t limi | |||
366 | * @param limit the limit | 366 | * @param limit the limit |
367 | * @return void | 367 | * @return void |
368 | */ | 368 | */ |
369 | void toxav_set_video_queue_limit ( ToxAv* av, uint32_t call_index, uint64_t limit ); | 369 | int toxav_set_video_queue_limit ( ToxAv* av, int32_t call_index, uint64_t limit ); |
370 | 370 | ||
371 | |||
372 | Tox* toxav_get_tox(ToxAv* av); | ||
371 | #endif /* __TOXAV */ \ No newline at end of file | 373 | #endif /* __TOXAV */ \ No newline at end of file |