summaryrefslogtreecommitdiff
path: root/toxav/toxav.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r--toxav/toxav.h41
1 files changed, 19 insertions, 22 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h
index a271e1f3..3696f961 100644
--- a/toxav/toxav.h
+++ b/toxav/toxav.h
@@ -81,17 +81,26 @@ typedef enum {
81} ToxAvCallState; 81} ToxAvCallState;
82 82
83/** 83/**
84 * Error indicators. 84 * Error indicators. Values under -20 are reserved for toxcore.
85 */ 85 */
86typedef enum { 86typedef enum {
87 av_ErrorNone = 0, 87 av_ErrorNone = 0,
88 av_ErrorInternal = -1, /* Internal error */ 88 av_ErrorUnknown = -1, /* Unknown error */
89 av_ErrorAlreadyInCall = -2, /* Already has an active call */ 89 av_ErrorNoCall = -20, /* Trying to perform call action while not in a call */
90 av_ErrorNoCall = -3, /* Trying to perform call action while not in a call */ 90 av_ErrorInvalidState = -21, /* Trying to perform call action while in invalid state*/
91 av_ErrorInvalidState = -4, /* Trying to perform call action while in invalid state*/ 91 av_ErrorAlreadyInCallWithPeer = -22, /* Trying to call peer when already in a call with peer */
92 av_ErrorNoRtpSession = -5, /* Trying to perform rtp action on invalid session */ 92 av_ErrorReachedCallLimit = -23, /* Cannot handle more calls */
93 av_ErrorInvalidCodecState = -6, /* Codec state not initialized */ 93 av_ErrorInitializingCodecs = -30, /* Failed creating CSSession */
94 av_ErrorPacketTooLarge = -7, /* Split packet exceeds it's limit */ 94 av_ErrorSettingVideoResolution = -31, /* Error setting resolution */
95 av_ErrorSettingVideoBitrate = -32, /* Error setting bitrate */
96 av_ErrorSplittingVideoPayload = -33, /* Error splitting video payload */
97 av_ErrorEncodingVideo = -34, /* vpx_codec_encode failed */
98 av_ErrorEncodingAudio = -35, /* opus_encode failed */
99 av_ErrorSendingPayload = -40, /* Sending lossy packet failed */
100 av_ErrorCreatingRtpSessions = -41, /* One of the rtp sessions failed to initialize */
101 av_ErrorNoRtpSession = -50, /* Trying to perform rtp action on invalid session */
102 av_ErrorInvalidCodecState = -51, /* Codec state not initialized */
103 av_ErrorPacketTooLarge = -52, /* Split packet exceeds it's limit */
95} ToxAvError; 104} ToxAvError;
96 105
97 106
@@ -153,12 +162,12 @@ void toxav_register_callstate_callback (ToxAv *av, ToxAVCallback cb, ToxAvCallba
153/** 162/**
154 * Register callback for audio data. 163 * Register callback for audio data.
155 */ 164 */
156void toxav_register_audio_callback (ToxAvAudioCallback cb, void *userdata); 165void toxav_register_audio_callback (ToxAv *av, ToxAvAudioCallback cb, void *userdata);
157 166
158/** 167/**
159 * Register callback for video data. 168 * Register callback for video data.
160 */ 169 */
161void toxav_register_video_callback (ToxAvVideoCallback cb, void *userdata); 170void toxav_register_video_callback (ToxAv *av, ToxAvVideoCallback cb, void *userdata);
162 171
163/** 172/**
164 * Call user. Use its friend_id. 173 * Call user. Use its friend_id.
@@ -267,18 +276,6 @@ int toxav_capability_supported ( ToxAv *av, int32_t call_index, ToxAvCapabilitie
267Tox *toxav_get_tox (ToxAv *av); 276Tox *toxav_get_tox (ToxAv *av);
268 277
269/** 278/**
270 * Set VAD activity treshold for calculating VAD. 40 is some middle value for treshold
271 */
272int toxav_set_vad_treshold (ToxAv *av, int32_t call_index, uint32_t treshold);
273
274/**
275 * Check if there is activity in the PCM data.
276 * Activity is present if the calculated PCM energy is > ref_energy.
277 * Returns bool.
278 */
279int toxav_has_activity ( ToxAv *av, int32_t call_index, int16_t *PCM, uint16_t frame_size, float ref);
280
281/**
282 * Returns number of active calls or -1 on error. 279 * Returns number of active calls or -1 on error.
283 */ 280 */
284int toxav_get_active_count (ToxAv *av); 281int toxav_get_active_count (ToxAv *av);