diff options
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r-- | toxav/toxav.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index 0ded42bd..a10b343f 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -31,7 +31,7 @@ extern "C" { | |||
31 | /* vpx_image_t */ | 31 | /* vpx_image_t */ |
32 | #include <vpx/vpx_image.h> | 32 | #include <vpx/vpx_image.h> |
33 | 33 | ||
34 | typedef void ( *ToxAVCallback ) ( int32_t, void *arg ); | 34 | typedef void ( *ToxAVCallback ) ( void* agent, int32_t call_idx, void *arg ); |
35 | typedef struct _ToxAv ToxAv; | 35 | typedef struct _ToxAv ToxAv; |
36 | 36 | ||
37 | #ifndef __TOX_DEFINED__ | 37 | #ifndef __TOX_DEFINED__ |
@@ -59,9 +59,9 @@ typedef enum { | |||
59 | av_OnEnding, | 59 | av_OnEnding, |
60 | 60 | ||
61 | /* Protocol */ | 61 | /* Protocol */ |
62 | av_OnError, | ||
63 | av_OnRequestTimeout, | 62 | av_OnRequestTimeout, |
64 | av_OnPeerTimeout | 63 | av_OnPeerTimeout, |
64 | av_OnMediaChange | ||
65 | } ToxAvCallbackID; | 65 | } ToxAvCallbackID; |
66 | 66 | ||
67 | 67 | ||
@@ -158,11 +158,30 @@ void toxav_kill(ToxAv *av); | |||
158 | /** | 158 | /** |
159 | * @brief Register callback for call state. | 159 | * @brief Register callback for call state. |
160 | * | 160 | * |
161 | * @param av Handler. | ||
161 | * @param callback The callback | 162 | * @param callback The callback |
162 | * @param id One of the ToxAvCallbackID values | 163 | * @param id One of the ToxAvCallbackID values |
163 | * @return void | 164 | * @return void |
164 | */ | 165 | */ |
165 | void toxav_register_callstate_callback (ToxAVCallback callback, ToxAvCallbackID id, void *userdata); | 166 | void toxav_register_callstate_callback (ToxAv *av, ToxAVCallback callback, ToxAvCallbackID id, void *userdata); |
167 | |||
168 | /** | ||
169 | * @brief Register callback for recieving audio data | ||
170 | * | ||
171 | * @param av Handler. | ||
172 | * @param callback The callback | ||
173 | * @return void | ||
174 | */ | ||
175 | void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int)); | ||
176 | |||
177 | /** | ||
178 | * @brief Register callback for recieving video data | ||
179 | * | ||
180 | * @param av Handler. | ||
181 | * @param callback The callback | ||
182 | * @return void | ||
183 | */ | ||
184 | void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *)); | ||
166 | 185 | ||
167 | /** | 186 | /** |
168 | * @brief Register callback for recieving audio data | 187 | * @brief Register callback for recieving audio data |
@@ -238,6 +257,16 @@ int toxav_reject(ToxAv *av, int32_t call_index, const char *reason); | |||
238 | int toxav_cancel(ToxAv *av, int32_t call_index, int peer_id, const char *reason); | 257 | int toxav_cancel(ToxAv *av, int32_t call_index, int peer_id, const char *reason); |
239 | 258 | ||
240 | /** | 259 | /** |
260 | * @brief Notify peer that we are changing call type | ||
261 | * | ||
262 | * @param av Handler. | ||
263 | * @return int | ||
264 | * @retval 0 Success. | ||
265 | * @retval ToxAvError On error. | ||
266 | */ | ||
267 | int toxav_change_type(ToxAv *av, int32_t call_index, ToxAvCallType call_type); | ||
268 | |||
269 | /** | ||
241 | * @brief Terminate transmission. Note that transmission will be terminated without informing remote peer. | 270 | * @brief Terminate transmission. Note that transmission will be terminated without informing remote peer. |
242 | * | 271 | * |
243 | * @param av Handler. | 272 | * @param av Handler. |
@@ -259,6 +288,7 @@ int toxav_stop_call(ToxAv *av, int32_t call_index); | |||
259 | int toxav_prepare_transmission(ToxAv *av, int32_t call_index, ToxAvCodecSettings *codec_settings, int support_video); | 288 | int toxav_prepare_transmission(ToxAv *av, int32_t call_index, ToxAvCodecSettings *codec_settings, int support_video); |
260 | 289 | ||
261 | /** | 290 | /** |
291 | <<<<<<< HEAD | ||
262 | * @brief Call this at the end of the transmission. | 292 | * @brief Call this at the end of the transmission. |
263 | * | 293 | * |
264 | * @param av Handler. | 294 | * @param av Handler. |
@@ -269,6 +299,8 @@ int toxav_prepare_transmission(ToxAv *av, int32_t call_index, ToxAvCodecSettings | |||
269 | int toxav_kill_transmission(ToxAv *av, int32_t call_index); | 299 | int toxav_kill_transmission(ToxAv *av, int32_t call_index); |
270 | 300 | ||
271 | /** | 301 | /** |
302 | ======= | ||
303 | >>>>>>> upstream/master | ||
272 | * @brief Encode and send video packet. | 304 | * @brief Encode and send video packet. |
273 | * | 305 | * |
274 | * @param av Handler. | 306 | * @param av Handler. |