Possible to specify audio device and default to hw:0 to stop using PusleAudio

This commit is contained in:
Iwan Timmer
2014-02-12 17:53:39 +01:00
parent 56eea63aad
commit 54c72cd0f0
7 changed files with 39 additions and 13 deletions
+12 -2
View File
@@ -6,9 +6,19 @@
// This function must be called before
// any other decoding functions
JNIEXPORT jint JNICALL
Java_com_limelight_binding_audio_AlsaAudio_init(JNIEnv *env, jobject this, jint channelCount, jint sampleRate)
Java_com_limelight_binding_audio_AlsaAudio_init(JNIEnv *env, jobject this, jint channelCount, jint sampleRate, jbyteArray device)
{
return nv_alsa_init(channelCount, sampleRate);
jint ret;
jbyte* jni_device;
jni_device = (*env)->GetByteArrayElements(env, device, 0);
ret = nv_alsa_init(channelCount, sampleRate, jni_device);
// The input data isn't changed so it can be safely aborted
(*env)->ReleaseByteArrayElements(env, device, jni_device, JNI_ABORT);
return ret;
}
JNIEXPORT void JNICALL