summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/api_av.cpp
blob: 4f517187ac83720106d60fb0ddd62b02c11e3ec8 (plain)
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
99
100
101
102
103
104
105
106
107
108
109
110
#include "common.h"

/* COMMON A/V FUNCTIONS */

ToxAv *toxav_new(Tox *tox, int32_t max_calls)
{
	return CreateFunction<ToxAv*(*)(Tox*, int32_t)>(__FUNCTION__)(tox, max_calls);
}

void toxav_kill(ToxAv *av)
{
	CreateFunction<void(*)(ToxAv*)>(__FUNCTION__)(av);
}

uint32_t toxav_do_interval(ToxAv *av)
{
	return CreateFunction<uint32_t(*)(ToxAv*)>(__FUNCTION__)(av);
}

void toxav_do(ToxAv *av)
{
	CreateFunction<void(*)(ToxAv*)>(__FUNCTION__)(av);
}

void toxav_register_callstate_callback(ToxAv *av, ToxAVCallback cb, ToxAvCallbackID id, void *userdata)
{
	CreateFunction<void(*)(ToxAv*, ToxAVCallback, ToxAvCallbackID, void*)>(__FUNCTION__)(av, cb, id, userdata);
}

int toxav_call(ToxAv *av, int32_t *call_index, int friend_id, const ToxAvCSettings *csettings, 	int ringing_seconds)
{
	return CreateFunction<int(*)(ToxAv*, int32_t*, int, const ToxAvCSettings*, int)>(__FUNCTION__)(av, call_index, friend_id, csettings, ringing_seconds);
}

int toxav_hangup(ToxAv *av, int32_t call_index)
{
	return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
}

int toxav_answer(ToxAv *av, int32_t call_index, const ToxAvCSettings *csettings)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, const ToxAvCSettings*)>(__FUNCTION__)(av, call_index, csettings);
}

int toxav_reject(ToxAv *av, int32_t call_index, const char *reason)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, const char*)>(__FUNCTION__)(av, call_index, reason);
}

int toxav_cancel(ToxAv *av, int32_t call_index, int peer_id, const char *reason)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, int, const char*)>(__FUNCTION__)(av, call_index, peer_id, reason);
}

int toxav_change_settings(ToxAv *av, int32_t call_index, const ToxAvCSettings *csettings)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, const ToxAvCSettings*)>(__FUNCTION__)(av, call_index, csettings);
}

int toxav_stop_call(ToxAv *av, int32_t call_index)
{
	return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
}

int toxav_prepare_transmission(ToxAv *av, int32_t call_index, int support_video)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, int)>(__FUNCTION__)(av, call_index, support_video);
}

int toxav_kill_transmission(ToxAv *av, int32_t call_index)
{
	return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
}

int toxav_get_peer_csettings(ToxAv *av, int32_t call_index, int peer, ToxAvCSettings *dest)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, int, ToxAvCSettings*)>(__FUNCTION__)(av, call_index, peer, dest);
}

int toxav_get_peer_id(ToxAv *av, int32_t call_index, int peer)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, int)>(__FUNCTION__)(av, call_index, peer);
}

ToxAvCallState toxav_get_call_state(ToxAv *av, int32_t call_index)
{
	return CreateFunction<ToxAvCallState(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
}

int toxav_capability_supported(ToxAv *av, int32_t call_index, ToxAvCapabilities capability)
{
	return CreateFunction<int(*)(ToxAv*, int32_t, ToxAvCapabilities)>(__FUNCTION__)(av, call_index, capability);
}

Tox *toxav_get_tox(ToxAv *av)
{
	return CreateFunction<Tox*(*)(ToxAv*)>(__FUNCTION__)(av);
}

int toxav_get_active_count(ToxAv *av)
{
	return CreateFunction<int(*)(ToxAv*)>(__FUNCTION__)(av);
}

/* AUDIO FUNCTIONS */

void toxav_register_audio_callback(ToxAv *av, ToxAvAudioCallback cb, void *userdata)
{
	CreateFunction<void(*)(ToxAv*, ToxAvAudioCallback, void*)>(__FUNCTION__)(av, cb, userdata);
}