Skip to content

Commit

Permalink
Update Limelight common
Browse files Browse the repository at this point in the history
  • Loading branch information
irtimmer committed Mar 29, 2015
1 parent 223ba11 commit 8a14cc6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion libs/common
2 changes: 1 addition & 1 deletion src/com/limelight/binding/video/FakeVideoRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void release() {
public void directSubmitDecodeUnit(DecodeUnit decodeUnit) {
if (out!=null) {
try {
for (ByteBufferDescriptor buf:decodeUnit.getBufferList())
for (ByteBufferDescriptor buf = decodeUnit.getBufferHead(); buf != null; buf = buf.nextDescriptor)
out.write(buf.data, buf.offset, buf.length);
} catch (IOException e) {
LimeLog.severe(e.getMessage());
Expand Down
7 changes: 2 additions & 5 deletions src/com/limelight/binding/video/ImxDecoderRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ public void stop() { }

@Override
public void directSubmitDecodeUnit(DecodeUnit decodeUnit) {
List<ByteBufferDescriptor> units = decodeUnit.getBufferList();

boolean ok = true;
for (int i=0;i<units.size();i++) {
ByteBufferDescriptor bbd = units.get(i);
for (ByteBufferDescriptor bbd = decodeUnit.getBufferHead(); bbd != null; bbd = bbd.nextDescriptor) {
if (ok) {
int ret = ImxDecoder.decode(bbd.data, bbd.offset, bbd.length, i == (units.size()-1));
int ret = ImxDecoder.decode(bbd.data, bbd.offset, bbd.length, bbd.nextDescriptor == null);
if (ret != 0) {
LimeLog.severe("Error code during decode: " + ret);
ok = false;
Expand Down
12 changes: 4 additions & 8 deletions src/com/limelight/binding/video/OmxDecoderRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public void release() {

@Override
public void directSubmitDecodeUnit(DecodeUnit decodeUnit) {
List<ByteBufferDescriptor> units = decodeUnit.getBufferList();

ByteBufferDescriptor header = units.get(0);
ByteBufferDescriptor header = decodeUnit.getBufferHead();
if (header.data[header.offset+4] == 0x67) {
ByteBuffer origSpsBuf = ByteBuffer.wrap(header.data);

Expand Down Expand Up @@ -73,13 +71,11 @@ public void directSubmitDecodeUnit(DecodeUnit decodeUnit) {
if (ret != 0) {
LimeLog.severe("Error code during decode: " + ret);
}
}
else {
} else {
boolean ok = true;
for (int i=0;i<units.size();i++) {
ByteBufferDescriptor bbd = units.get(i);
for (ByteBufferDescriptor bbd = header; bbd != null; bbd = bbd.nextDescriptor) {
if (ok) {
int ret = OmxDecoder.decode(bbd.data, bbd.offset, bbd.length, i == (units.size()-1));
int ret = OmxDecoder.decode(bbd.data, bbd.offset, bbd.length, bbd.nextDescriptor == null);
if (ret != 0) {
LimeLog.severe("Error code during decode: " + ret);
ok = false;
Expand Down

0 comments on commit 8a14cc6

Please sign in to comment.