summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/api_av.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-11-03 20:23:48 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-11-03 20:23:48 +0000
commit63945ebb21dee8bd7ebd7c0144fd4fcdf00feff6 (patch)
tree37bd82205fec0af0fae3635313fcf6686435b76e /protocols/Tox/src/api_av.cpp
parentafeb99849818ec79199eb7af39693fc5a522f017 (diff)
Tox: updated tox core
git-svn-id: http://svn.miranda-ng.org/main/trunk@15677 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/api_av.cpp')
-rw-r--r--protocols/Tox/src/api_av.cpp88
1 files changed, 38 insertions, 50 deletions
diff --git a/protocols/Tox/src/api_av.cpp b/protocols/Tox/src/api_av.cpp
index 5e09dc81bd..c46e549a35 100644
--- a/protocols/Tox/src/api_av.cpp
+++ b/protocols/Tox/src/api_av.cpp
@@ -2,109 +2,97 @@
/* COMMON A/V FUNCTIONS */
-ToxAv *toxav_new(Tox *tox, int32_t max_calls)
+ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error)
{
- return CreateFunction<ToxAv*(*)(Tox*, int32_t)>(__FUNCTION__)(tox, max_calls);
+ return CreateFunction<ToxAV*(*)(Tox*, TOXAV_ERR_NEW*)>(__FUNCTION__)(tox, error);
}
-void toxav_kill(ToxAv *av)
+void toxav_kill(ToxAV *toxAV)
{
- CreateFunction<void(*)(ToxAv*)>(__FUNCTION__)(av);
+ CreateFunction<void(*)(ToxAV*)>(__FUNCTION__)(toxAV);
}
-uint32_t toxav_do_interval(ToxAv *av)
+Tox *toxav_get_tox(const ToxAV *toxAV)
{
- return CreateFunction<uint32_t(*)(ToxAv*)>(__FUNCTION__)(av);
+ return CreateFunction<Tox*(*)(const ToxAV*)>(__FUNCTION__)(toxAV);
}
-void toxav_do(ToxAv *av)
+uint32_t toxav_iteration_interval(ToxAV *toxAV)
{
- CreateFunction<void(*)(ToxAv*)>(__FUNCTION__)(av);
+ return CreateFunction<uint32_t(*)(ToxAV*)>(__FUNCTION__)(toxAV);
}
-void toxav_register_callstate_callback(ToxAv *av, ToxAVCallback cb, ToxAvCallbackID id, void *userdata)
+void toxav_iterate(ToxAV *toxAV)
{
- CreateFunction<void(*)(ToxAv*, ToxAVCallback, ToxAvCallbackID, void*)>(__FUNCTION__)(av, cb, id, userdata);
+ CreateFunction<void(*)(ToxAV*)>(__FUNCTION__)(toxAV);
}
-int toxav_call(ToxAv *av, int32_t *call_index, int friend_id, const ToxAvCSettings *csettings, int ringing_seconds)
+bool toxav_call(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate, TOXAV_ERR_CALL *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t*, int, const ToxAvCSettings*, int)>(__FUNCTION__)(av, call_index, friend_id, csettings, ringing_seconds);
+ return CreateFunction<bool(*)(ToxAV*, int32_t, uint32_t, uint32_t, TOXAV_ERR_CALL*)>(__FUNCTION__)(toxAV, friend_number, audio_bit_rate, video_bit_rate, error);
}
-int toxav_hangup(ToxAv *av, int32_t call_index)
+void toxav_callback_call(ToxAV *toxAV, toxav_call_cb *callback, void *user_data)
{
- return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
+ CreateFunction<void(*)(ToxAV*, toxav_call_cb, void*)>(__FUNCTION__)(toxAV, callback, user_data);
}
-int toxav_answer(ToxAv *av, int32_t call_index, const ToxAvCSettings *csettings)
+bool toxav_answer(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate, TOXAV_ERR_ANSWER *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, const ToxAvCSettings*)>(__FUNCTION__)(av, call_index, csettings);
+ return CreateFunction<bool(*)(ToxAV*, int32_t, uint32_t, uint32_t, TOXAV_ERR_ANSWER*)>(__FUNCTION__)(toxAV, friend_number, audio_bit_rate, video_bit_rate, error);
}
-int toxav_reject(ToxAv *av, int32_t call_index, const char *reason)
+void toxav_callback_call_state(ToxAV *toxAV, toxav_call_state_cb *callback, void *user_data)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, const char*)>(__FUNCTION__)(av, call_index, reason);
+ CreateFunction<void(*)(ToxAV*, toxav_call_state_cb, void*)>(__FUNCTION__)(toxAV, callback, user_data);
}
-int toxav_cancel(ToxAv *av, int32_t call_index, int peer_id, const char *reason)
+bool toxav_call_control(ToxAV *toxAV, uint32_t friend_number, TOXAV_CALL_CONTROL control, TOXAV_ERR_CALL_CONTROL *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, int, const char*)>(__FUNCTION__)(av, call_index, peer_id, reason);
+ return CreateFunction<bool(*)(ToxAV*, uint32_t, TOXAV_CALL_CONTROL, TOXAV_ERR_CALL_CONTROL*)>(__FUNCTION__)(toxAV, friend_number, control, error);
}
-int toxav_change_settings(ToxAv *av, int32_t call_index, const ToxAvCSettings *csettings)
+bool toxav_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, int32_t audio_bit_rate, int32_t video_bit_rate, TOXAV_ERR_BIT_RATE_SET *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, const ToxAvCSettings*)>(__FUNCTION__)(av, call_index, csettings);
+ return CreateFunction<bool(*)(ToxAV*, int32_t, uint32_t, uint32_t, TOXAV_ERR_BIT_RATE_SET*)>(__FUNCTION__)(toxAV, friend_number, audio_bit_rate, video_bit_rate, error);
}
-int toxav_stop_call(ToxAv *av, int32_t call_index)
+void toxav_callback_bit_rate_status(ToxAV *toxAV, toxav_bit_rate_status_cb *callback, void *user_data)
{
- return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
+ CreateFunction<void(*)(ToxAV*, toxav_bit_rate_status_cb, void*)>(__FUNCTION__)(toxAV, callback, user_data);
}
-int toxav_prepare_transmission(ToxAv *av, int32_t call_index, int support_video)
+bool toxav_audio_send_frame(ToxAV *toxAV, uint32_t friend_number, const int16_t *pcm, size_t sample_count, uint8_t channels, uint32_t sampling_rate, TOXAV_ERR_SEND_FRAME *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, int)>(__FUNCTION__)(av, call_index, support_video);
+ return CreateFunction<bool(*)(ToxAV*, int32_t, const int16_t*, size_t, uint8_t, uint32_t, TOXAV_ERR_SEND_FRAME*)>(__FUNCTION__)(toxAV, friend_number, pcm, sample_count, channels, sampling_rate, error);
}
-int toxav_kill_transmission(ToxAv *av, int32_t call_index)
+bool toxav_video_send_frame(ToxAV *toxAV, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, TOXAV_ERR_SEND_FRAME *error)
{
- return CreateFunction<int(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
+ return CreateFunction<bool(*)(ToxAV*, int32_t, int16_t, uint16_t, const uint8_t*, const uint8_t*, const uint8_t*, TOXAV_ERR_SEND_FRAME*)>(__FUNCTION__)(toxAV, friend_number, width, height, y, u, v, error);
}
-int toxav_get_peer_csettings(ToxAv *av, int32_t call_index, int peer, ToxAvCSettings *dest)
+void toxav_callback_audio_receive_frame(ToxAV *toxAV, toxav_audio_receive_frame_cb *callback, void *user_data)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, int, ToxAvCSettings*)>(__FUNCTION__)(av, call_index, peer, dest);
+ CreateFunction<void(*)(ToxAV*, toxav_audio_receive_frame_cb, void*)>(__FUNCTION__)(toxAV, callback, user_data);
}
-int toxav_get_peer_id(ToxAv *av, int32_t call_index, int peer)
+void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, int)>(__FUNCTION__)(av, call_index, peer);
+ CreateFunction<void(*)(ToxAV*, toxav_video_receive_frame_cb, void*)>(__FUNCTION__)(toxAV, callback, user_data);
}
-ToxAvCallState toxav_get_call_state(ToxAv *av, int32_t call_index)
+int toxav_add_av_groupchat(Tox *tox, void(*audio_callback)(void *, int, int, const int16_t *, unsigned int, uint8_t, unsigned int, void *), void *userdata)
{
- return CreateFunction<ToxAvCallState(*)(ToxAv*, int32_t)>(__FUNCTION__)(av, call_index);
+ return CreateFunction<int(*)(Tox*, void(*)(void*, int, int, const int16_t*, unsigned int, uint8_t, unsigned int, void*), void*)>(__FUNCTION__)(tox, audio_callback, userdata);
}
-int toxav_capability_supported(ToxAv *av, int32_t call_index, ToxAvCapabilities capability)
+int toxav_join_av_groupchat(Tox *tox, int32_t friendnumber, const uint8_t *data, uint16_t length, void(*audio_callback)(void *, int, int, const int16_t *, unsigned int, uint8_t, unsigned int, void *), void *userdata)
{
- return CreateFunction<int(*)(ToxAv*, int32_t, ToxAvCapabilities)>(__FUNCTION__)(av, call_index, capability);
+ return CreateFunction<int(*)(Tox*, int32_t, const uint8_t*, uint16_t, void(*)(void*, int, int, const int16_t*, unsigned int, uint8_t, unsigned int, void*), void*)>(__FUNCTION__)(tox, friendnumber, data, length, audio_callback, userdata);
}
-Tox *toxav_get_tox(ToxAv *av)
+int toxav_group_send_audio(Tox *tox, int groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate)
{
- 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);
+ return CreateFunction<int(*)(Tox*, int, const int16_t*, unsigned int, uint8_t, unsigned int)>(__FUNCTION__)(tox, groupnumber, pcm, samples, channels, sample_rate);
} \ No newline at end of file