forked from notsecure/uTox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox_av.h
98 lines (71 loc) · 2.61 KB
/
tox_av.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
static void callback_av_invite(int32_t call_index, void *arg)
{
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_INVITE, fid, call_index, NULL);
debug("A/V Invite (%i)\n", call_index);
}
static void callback_av_start(int32_t call_index, void *arg)
{
toxav_prepare_transmission(arg, call_index, (ToxAvCodecSettings*)&av_DefaultSettings, 0);
call[call_index].active = 1;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_START, fid, call_index, NULL);
debug("A/V Start (%i)\n", call_index);
}
static void callback_av_cancel(int32_t call_index, void *arg)
{
call[call_index].active = 0;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V Cancel (%i)\n", call_index);
}
static void callback_av_reject(int32_t call_index, void *arg)
{
debug("A/V Reject (%i)\n", call_index);
}
static void callback_av_end(int32_t call_index, void *arg)
{
call[call_index].active = 0;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V End (%i)\n", call_index);
}
static void callback_av_ringing(int32_t call_index, void *arg)
{
debug("A/V Ringing (%i)\n", call_index);
}
static void callback_av_starting(int32_t call_index, void *arg)
{
toxav_prepare_transmission(arg, call_index, (ToxAvCodecSettings*)&av_DefaultSettings, 0);
call[call_index].active = 1;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_START, fid, call_index, NULL);
debug("A/V Starting (%i)\n", call_index);
}
static void callback_av_ending(int32_t call_index, void *arg)
{
call[call_index].active = 0;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V Ending (%i)\n", call_index);
}
static void callback_av_error(int32_t call_index, void *arg)
{
call[call_index].active = 0;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V Error (%i)\n", call_index);
}
static void callback_av_requesttimeout(int32_t call_index, void *arg)
{
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V ReqTimeout (%i)\n", call_index);
}
static void callback_av_peertimeout(int32_t call_index, void *arg)
{
call[call_index].active = 0;
int fid = toxav_get_peer_id(arg, call_index, 0);
postmessage(FRIEND_CALL_END, fid, call_index, NULL);
debug("A/V PeerTimeout (%i)\n", call_index);
}