mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-10-26 05:50:05 +00:00
Move opus decoding code
This commit is contained in:
1 parent
be584fb203
commit
40508c2ac2
8 files changed
+114
-96
No files matched your search
@@ -8,32 +8,32 @@
|
||||
// This function must be called before
|
||||
// any other decoding functions
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_init(JNIEnv *env, jobject this) {
|
||||
Java_com_limelight_binding_audio_OpusDecoder_init(JNIEnv *env, jobject this) {
|
||||
return nv_opus_init();
|
||||
}
|
||||
|
||||
// This function must be called after
|
||||
// decoding is finished
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_destroy(JNIEnv *env, jobject this) {
|
||||
Java_com_limelight_binding_audio_OpusDecoder_destroy(JNIEnv *env, jobject this) {
|
||||
nv_opus_destroy();
|
||||
}
|
||||
|
||||
// The Opus stream is stereo
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_getChannelCount(JNIEnv *env, jobject this) {
|
||||
Java_com_limelight_binding_audio_OpusDecoder_getChannelCount(JNIEnv *env, jobject this) {
|
||||
return nv_opus_get_channel_count();
|
||||
}
|
||||
|
||||
// This number assumes 2 channels at 48 KHz
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_getMaxOutputShorts(JNIEnv *env, jobject this) {
|
||||
Java_com_limelight_binding_audio_OpusDecoder_getMaxOutputShorts(JNIEnv *env, jobject this) {
|
||||
return nv_opus_get_max_out_shorts();
|
||||
}
|
||||
|
||||
// The Opus stream is 48 KHz
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_getSampleRate(JNIEnv *env, jobject this) {
|
||||
Java_com_limelight_binding_audio_OpusDecoder_getSampleRate(JNIEnv *env, jobject this) {
|
||||
return nv_opus_get_sample_rate();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ Java_com_limelight_nvstream_av_audio_OpusDecoder_getSampleRate(JNIEnv *env, jobj
|
||||
// a packet loss must call this function with NULL indata and 0 inlen
|
||||
// returns the number of decoded samples
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_av_audio_OpusDecoder_decode(
|
||||
Java_com_limelight_binding_audio_OpusDecoder_decode(
|
||||
JNIEnv *env, jobject this, // JNI parameters
|
||||
jbyteArray indata, jint inoff, jint inlen, // Input parameters
|
||||
jbyteArray outpcmdata) // Output parameter
|
||||
|
||||
Reference in new issue
Block a user