Make possible to use own Opus build

This commit is contained in:
Iwan Timmer 2014-10-24 15:37:02 +02:00
parent 1efeb4a8c4
commit e9d89e696a
2 changed files with 25 additions and 0 deletions

View File

@ -78,6 +78,20 @@ implementation.
Use ctrl-c to exit application
##Fixed point Opus on Debian
Debian/Raspbian currently doesn't provide a fixed point Opus build.
This results in very high cpu usage for audio decompression, especially on the Raspberry Pi.
Limelight Embedded can load another Opus build for you from the current working directory.
To compile Opus with fixed point support you have to execute the following commands:
wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar xf opus-1.1.tar.gz
cd opus-1.1
./configure --enable-fixed-point
make
Then copy libopus.so from opus-1.1/libs to the directory from which you start Limelight Embedded.
##Compile
* Install ant (Debian/Raspbian/Fedora/Pidora) or apache-ant (Archlinux)

View File

@ -2,6 +2,8 @@ package com.limelight.binding;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.io.File;
import java.io.IOException;
import com.limelight.binding.audio.AlsaAudioRenderer;
import com.limelight.binding.video.ImxDecoder;
@ -12,6 +14,7 @@ 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;
import com.limelight.LimeLog;
/**
* Used for platform-specific video/audio bindings.
@ -50,6 +53,14 @@ public class PlatformBinding {
* @return an audio decoder and renderer
*/
public static AudioRenderer getAudioRenderer(String device) {
//Try to load local libopus
try {
Runtime.getRuntime().load(new File(".").getCanonicalPath()+File.separator+"libopus.so");
LimeLog.warning("Use local opus library");
} catch(IOException e) {
e.printStackTrace();
}
return new AlsaAudioRenderer(device);
}