mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Set flags on the decode units that indicate what type of data the frame contains
This commit is contained in:
parent
bc2ca0b386
commit
4fbe93e62d
@ -7,6 +7,9 @@ public class DecodeUnit {
|
||||
public static final int TYPE_H264 = 1;
|
||||
public static final int TYPE_OPUS = 2;
|
||||
|
||||
public static final int DU_FLAG_CODEC_CONFIG = 0x1;
|
||||
public static final int DU_FLAG_SYNC_FRAME = 0x2;
|
||||
|
||||
private int type;
|
||||
private List<ByteBufferDescriptor> bufferList;
|
||||
private int dataLength;
|
||||
|
@ -46,8 +46,25 @@ public class VideoDepacketizer {
|
||||
{
|
||||
// This is the start of a new frame
|
||||
if (avcFrameDataChain != null && avcFrameDataLength != 0) {
|
||||
int flags = 0;
|
||||
|
||||
ByteBufferDescriptor firstBuffer = avcFrameDataChain.getFirst();
|
||||
|
||||
if (NAL.getSpecialSequenceDescriptor(firstBuffer, cachedDesc) && NAL.isAvcFrameStart(cachedDesc)) {
|
||||
switch (cachedDesc.data[cachedDesc.offset+cachedDesc.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
|
||||
DecodeUnit du = new DecodeUnit(DecodeUnit.TYPE_H264, avcFrameDataChain, avcFrameDataLength, 0, frameNumber);
|
||||
DecodeUnit du = new DecodeUnit(DecodeUnit.TYPE_H264, avcFrameDataChain, avcFrameDataLength, flags, frameNumber);
|
||||
if (directSubmitDr != null) {
|
||||
// Submit directly to the decoder
|
||||
directSubmitDr.submitDecodeUnit(du);
|
||||
|
Loading…
x
Reference in New Issue
Block a user