Reuse buffers for video and audio renderer callbacks to prevent excessive object allocation during stream

This commit is contained in:
Cameron Gutman
2017-05-18 13:03:36 -07:00
parent 0ce1e1be27
commit b3a1938c1d
3 changed files with 34 additions and 27 deletions

View File

@@ -3,7 +3,7 @@ package com.limelight.nvstream.av.video;
public abstract class VideoDecoderRenderer {
public abstract int setup(int format, int width, int height, int redrawRate);
public abstract int submitDecodeUnit(byte[] frameData);
public abstract int submitDecodeUnit(byte[] frameData, int frameLength);
public abstract void cleanup();

View File

@@ -48,9 +48,9 @@ public class MoonBridge {
}
}
public static int bridgeDrSubmitDecodeUnit(byte[] frameData) {
public static int bridgeDrSubmitDecodeUnit(byte[] frameData, int frameLength) {
if (videoRenderer != null) {
return videoRenderer.submitDecodeUnit(frameData);
return videoRenderer.submitDecodeUnit(frameData, frameLength);
}
else {
return DR_OK;