mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 10:30:47 +00:00
Support iMX6 and Pi with the same binary
This commit is contained in:
@@ -4,8 +4,11 @@ import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import com.limelight.binding.audio.AlsaAudioRenderer;
|
||||
import com.limelight.binding.video.ImxDecoder;
|
||||
import com.limelight.binding.video.ImxDecoderRenderer;
|
||||
import com.limelight.binding.crypto.PcCryptoProvider;
|
||||
import com.limelight.binding.video.OmxDecoder;
|
||||
import com.limelight.binding.video.OmxDecoderRenderer;
|
||||
import com.limelight.nvstream.av.audio.AudioRenderer;
|
||||
import com.limelight.nvstream.av.video.VideoDecoderRenderer;
|
||||
import com.limelight.nvstream.http.LimelightCryptoProvider;
|
||||
@@ -21,7 +24,12 @@ public class PlatformBinding {
|
||||
* @return a video decoder and renderer
|
||||
*/
|
||||
public static VideoDecoderRenderer getVideoDecoderRenderer() {
|
||||
return new ImxDecoderRenderer();
|
||||
if (OmxDecoder.load())
|
||||
return new OmxDecoderRenderer();
|
||||
else if (ImxDecoder.load())
|
||||
return new ImxDecoderRenderer();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,14 @@ package com.limelight.binding.video;
|
||||
* @author Iwan Timmer
|
||||
*/
|
||||
public class ImxDecoder {
|
||||
static {
|
||||
System.loadLibrary("nv_imx_dec");
|
||||
|
||||
public static boolean load() {
|
||||
try {
|
||||
System.loadLibrary("nv_imx_dec");
|
||||
} catch (Throwable e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static native int init();
|
||||
|
||||
@@ -5,8 +5,14 @@ package com.limelight.binding.video;
|
||||
* @author Iwan Timmer
|
||||
*/
|
||||
public class OmxDecoder {
|
||||
static {
|
||||
System.loadLibrary("nv_omx_dec");
|
||||
|
||||
public static boolean load() {
|
||||
try {
|
||||
System.loadLibrary("nv_omx_dec");
|
||||
} catch (Throwable e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static native int init();
|
||||
|
||||
Reference in New Issue
Block a user