mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-06 16:06:10 +00:00
Fix cleanup on stream connection failure
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.limelight.nvstream.av.audio;
|
||||
|
||||
public interface AudioRenderer {
|
||||
void setup(int audioConfiguration);
|
||||
int setup(int audioConfiguration);
|
||||
|
||||
void playDecodedAudio(byte[] audioData);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.limelight.nvstream.av.video;
|
||||
|
||||
public abstract class VideoDecoderRenderer {
|
||||
public abstract boolean setup(int format, int width, int height, int redrawRate);
|
||||
public abstract int setup(int format, int width, int height, int redrawRate);
|
||||
|
||||
public abstract int submitDecodeUnit(byte[] frameData);
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.limelight.nvstream.av.audio.AudioRenderer;
|
||||
import com.limelight.nvstream.av.video.VideoDecoderRenderer;
|
||||
|
||||
public class MoonBridge {
|
||||
/* See documentation in Limelight.h for information about these functions and constants */
|
||||
|
||||
public static final int AUDIO_CONFIGURATION_STEREO = 0;
|
||||
public static final int AUDIO_CONFIGURATION_51_SURROUND = 1;
|
||||
|
||||
@@ -31,9 +33,12 @@ public class MoonBridge {
|
||||
return slices << 24;
|
||||
}
|
||||
|
||||
public static void bridgeDrSetup(int videoFormat, int width, int height, int redrawRate) {
|
||||
public static int bridgeDrSetup(int videoFormat, int width, int height, int redrawRate) {
|
||||
if (videoRenderer != null) {
|
||||
videoRenderer.setup(videoFormat, width, height, redrawRate);
|
||||
return videoRenderer.setup(videoFormat, width, height, redrawRate);
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +57,12 @@ public class MoonBridge {
|
||||
}
|
||||
}
|
||||
|
||||
public static void bridgeArInit(int audioConfiguration) {
|
||||
public static int bridgeArInit(int audioConfiguration) {
|
||||
if (audioRenderer != null) {
|
||||
audioRenderer.setup(audioConfiguration);
|
||||
return audioRenderer.setup(audioConfiguration);
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user