mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 11:03:01 +00:00
Remove some unneccessary checks and repurpose an old method.
This commit is contained in:
parent
20514a7ce8
commit
e507f4abfb
@ -241,29 +241,20 @@ class NAL {
|
||||
// This assumes that the buffer passed in is already a special sequence
|
||||
public static boolean isAvcStartSequence(AvByteBufferDescriptor specialSeq)
|
||||
{
|
||||
if (specialSeq.length != 3 && specialSeq.length != 4)
|
||||
return false;
|
||||
|
||||
// The start sequence is 00 00 01 or 00 00 00 01
|
||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
||||
}
|
||||
|
||||
// This assumes that the buffer passed in is already a special sequence
|
||||
public static boolean isUnknownStartSequence(AvByteBufferDescriptor specialSeq)
|
||||
public static boolean isPadding(AvByteBufferDescriptor specialSeq)
|
||||
{
|
||||
if (specialSeq.length != 3)
|
||||
return false;
|
||||
|
||||
// The start sequence is 00 00 03
|
||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x03);
|
||||
// The padding sequence is 00 00 00
|
||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x00);
|
||||
}
|
||||
|
||||
// This assumes that the buffer passed in is already a special sequence
|
||||
public static boolean isAvcFrameStart(AvByteBufferDescriptor specialSeq)
|
||||
{
|
||||
if (specialSeq.length != 4)
|
||||
return false;
|
||||
|
||||
// The frame start sequence is 00 00 00 01
|
||||
return (specialSeq.data[specialSeq.offset+specialSeq.length-1] == 0x01);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user