mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Add flags back to the decode unit because TI OMAP devices need them
This commit is contained in:
parent
ec303e485f
commit
1c82fdf048
@ -15,14 +15,16 @@ public class DecodeUnit {
|
|||||||
private int dataLength;
|
private int dataLength;
|
||||||
private int frameNumber;
|
private int frameNumber;
|
||||||
private long receiveTimestamp;
|
private long receiveTimestamp;
|
||||||
|
private int flags;
|
||||||
|
|
||||||
public DecodeUnit(int type, List<ByteBufferDescriptor> bufferList, int dataLength, int frameNumber, long receiveTimestamp)
|
public DecodeUnit(int type, List<ByteBufferDescriptor> bufferList, int dataLength, int frameNumber, long receiveTimestamp, int flags)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.bufferList = bufferList;
|
this.bufferList = bufferList;
|
||||||
this.dataLength = dataLength;
|
this.dataLength = dataLength;
|
||||||
this.frameNumber = frameNumber;
|
this.frameNumber = frameNumber;
|
||||||
this.receiveTimestamp = receiveTimestamp;
|
this.receiveTimestamp = receiveTimestamp;
|
||||||
|
this.flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
@ -49,4 +51,9 @@ public class DecodeUnit {
|
|||||||
{
|
{
|
||||||
return frameNumber;
|
return frameNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getFlags()
|
||||||
|
{
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,24 @@ public class VideoDepacketizer {
|
|||||||
{
|
{
|
||||||
// This is the start of a new frame
|
// This is the start of a new frame
|
||||||
if (avcFrameDataChain != null && avcFrameDataLength != 0) {
|
if (avcFrameDataChain != null && avcFrameDataLength != 0) {
|
||||||
|
ByteBufferDescriptor firstBuffer = avcFrameDataChain.getFirst();
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
if (NAL.getSpecialSequenceDescriptor(firstBuffer, cachedSpecialDesc) && NAL.isAvcFrameStart(cachedSpecialDesc)) {
|
||||||
|
switch (cachedSpecialDesc.data[cachedSpecialDesc.offset+cachedSpecialDesc.length]) {
|
||||||
|
case 0x67:
|
||||||
|
case 0x68:
|
||||||
|
flags |= DecodeUnit.DU_FLAG_CODEC_CONFIG;
|
||||||
|
break;
|
||||||
|
case 0x65:
|
||||||
|
flags |= DecodeUnit.DU_FLAG_SYNC_FRAME;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the H264 decode unit
|
// Construct the H264 decode unit
|
||||||
DecodeUnit du = new DecodeUnit(DecodeUnit.TYPE_H264, avcFrameDataChain, avcFrameDataLength, frameNumber, frameStartTime);
|
DecodeUnit du = new DecodeUnit(DecodeUnit.TYPE_H264, avcFrameDataChain,
|
||||||
|
avcFrameDataLength, frameNumber, frameStartTime, flags);
|
||||||
if (!decodedUnits.offer(du)) {
|
if (!decodedUnits.offer(du)) {
|
||||||
LimeLog.warning("Video decoder is too slow! Forced to drop decode units");
|
LimeLog.warning("Video decoder is too slow! Forced to drop decode units");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user