Drop audio frames if the backlog becomes too large. Trim buffer pools when memory runs low. Optimize AVC decoding a bit more.

This commit is contained in:
Cameron Gutman
2013-11-10 15:25:00 -05:00
parent fc66caf567
commit 524cab4115
8 changed files with 80 additions and 18 deletions
+11
View File
@@ -4,6 +4,7 @@ import com.limelight.nvstream.NvConnection;
import com.limelight.nvstream.input.NvControllerPacket;
import android.app.Activity;
import android.content.ComponentCallbacks2;
import android.os.Bundle;
import android.view.InputDevice;
import android.view.KeyEvent;
@@ -68,11 +69,21 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
super.onPause();
}
@Override
public void onDestroy() {
conn.stop();
super.onDestroy();
}
@Override
public void onTrimMemory(int trimLevel) {
if (trimLevel >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW)
{
System.out.println("Trimming for level: "+trimLevel);
conn.trim();
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {