Created
September 5, 2014 03:48
-
-
Save olologin/199f31f93360ab6a79bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void avcallback_audio(ToxAv *tox_av, int32_t call_id, int16_t *pcm_data, int pcm_data_length, void *user_data) | |
{ | |
tox_av_jni_globals_t *globals = (tox_av_jni_globals_t *) user_data; | |
JNIEnv *env; | |
jbyteArray output; | |
ATTACH_THREAD(globals, env); | |
//create java byte array from pcm data | |
jbyte _output[pcm_data_length]; | |
output = (*env)->NewByteArray(env, pcm_data_length); | |
(*env)->SetByteArrayRegion(env, output, 0, pcm_data_length, _output); | |
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Where *pcm_data used here? A problem may arise. | |
(*env)->CallVoidMethod(env, globals->handler, globals->cache->onAudioDataMethodId, call_id, output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment