Commit ce8b48e8 authored by Martin Storsjö's avatar Martin Storsjö Committed by Rafaël Carré
Browse files

Add a libvlc jni helper method for getting the native audio sampling rate


Signed-off-by: Rafaël Carré's avatarRafaël Carré <funman@videolan.org>
parent 882b3e2b
......@@ -245,3 +245,14 @@ void aout_close(void *opaque)
(*myVm)->DetachCurrentThread (myVm);
free (p_sys);
}
int aout_get_native_sample_rate(void)
{
JNIEnv *p_env;
(*myVm)->AttachCurrentThread (myVm, &p_env, NULL);
jclass cls = (*p_env)->FindClass (p_env, "android/media/AudioTrack");
jmethodID method = (*p_env)->GetStaticMethodID (p_env, cls, "getNativeOutputSampleRate", "(I)I");
int sample_rate = (*p_env)->CallStaticIntMethod (p_env, cls, method, 3); // AudioManager.STREAM_MUSIC
(*myVm)->DetachCurrentThread (myVm);
return sample_rate;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment