Class DePacketizer.VP8PayloadDescriptor
- java.lang.Object
-
- org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer.VP8PayloadDescriptor
-
- Enclosing class:
- DePacketizer
public static class DePacketizer.VP8PayloadDescriptor extends Object
A class that represents the VP8 Payload Descriptor structure defined in draft-ietf-payload-vp8-10
-
-
Field Summary
Fields Modifier and Type Field Description static intEXTENDED_PICTURE_ID_MASKThe bitmask for the extended picture id field.static intMAX_LENGTHMaximum length of a VP8 Payload Descriptor.static intTL0PICIDX_MASKThe bitmask for the TL0PICIDX field.
-
Constructor Summary
Constructors Constructor Description VP8PayloadDescriptor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]create(boolean startOfPartition)Returns a simple Payload Descriptor, with PartID = 0, the 'start of partition' bit set according to startOfPartition, and all other bits set to 0.static intgetPartitionId(byte[] input, int offset)Returns the value of the PID (partition ID) field of the VP8 Payload Descriptor at offset offset in input.static intgetPictureId(byte[] input, int offset)Gets the value of the PictureID field of a VP8 Payload Descriptor.static intgetSize(byte[] input, int offset, int length)The size in bytes of the Payload Descriptor at offset offset in input.static intgetSize(org.jitsi.utils.ByteArrayBuffer baf)The size in bytes of the Payload Descriptor at offset offset in input.static intgetTemporalLayerIndex(byte[] buf, int off, int len)Gets the temporal layer index (TID), if that's set.static intgetTL0PICIDX(byte[] buf, int off, int len)Gets the TL0PICIDX from the payload descriptor.static booleanhasExtendedPictureId(byte[] buf, int off, int len)Determines whether the VP8 payload specified in the buffer that is passed as an argument has an extended picture ID or not.static booleanhasPictureId(byte[] buf, int off, int len)Determines whether the VP8 payload specified in the buffer that is passed as an argument has a picture ID or not.static booleanisReference(byte[] buf, int off, int len)Gets a boolean that indicates whether or not the non-reference bit is set.static booleanisStartOfFrame(byte[] input, int offset)Returns true if both the 'start of partition' bit is set and the PID fields has value 0 in the VP8 Payload Descriptor at offset offset in input.static booleanisStartOfPartition(byte[] input, int offset)Checks whether the 'start of partition' bit is set in the VP8 Payload Descriptor at offset offset in input.static booleanisValid(byte[] buf, int off, int len)Checks whether the arguments specify a valid buffer.static booleansetExtendedPictureId(byte[] buf, int off, int len, int val)Sets the extended picture ID for the VP8 payload specified in the buffer that is passed as an argument.static booleansetTL0PICIDX(byte[] buf, int off, int len, int val)Sets the TL0PICIDX field for the VP8 payload specified in the buffer that is passed as an argument.static StringtoString(byte[] buf, int off, int len)Provides a string description of the VP8 descriptor that can be used for debugging purposes.
-
-
-
Field Detail
-
TL0PICIDX_MASK
public static final int TL0PICIDX_MASK
The bitmask for the TL0PICIDX field.- See Also:
- Constant Field Values
-
EXTENDED_PICTURE_ID_MASK
public static final int EXTENDED_PICTURE_ID_MASK
The bitmask for the extended picture id field.- See Also:
- Constant Field Values
-
MAX_LENGTH
public static final int MAX_LENGTH
Maximum length of a VP8 Payload Descriptor.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTemporalLayerIndex
public static int getTemporalLayerIndex(byte[] buf, int off, int len)Gets the temporal layer index (TID), if that's set.- Parameters:
buf- the byte buffer that holds the VP8 packet.off- the offset in the byte buffer where the VP8 packet starts.len- the length of the VP8 packet.- Returns:
- the temporal layer index (TID), if that's set, -1 otherwise.
-
create
public static byte[] create(boolean startOfPartition)
Returns a simple Payload Descriptor, with PartID = 0, the 'start of partition' bit set according to startOfPartition, and all other bits set to 0.- Parameters:
startOfPartition- whether to 'start of partition' bit should be set- Returns:
- a simple Payload Descriptor, with PartID = 0, the 'start of partition' bit set according to startOfPartition, and all other bits set to 0.
-
getSize
public static int getSize(org.jitsi.utils.ByteArrayBuffer baf)
The size in bytes of the Payload Descriptor at offset offset in input. The size is between 1 and 6.- Parameters:
baf- the ByteArrayBuffer that holds the VP8 payload descriptor.- Returns:
- The size in bytes of the Payload Descriptor at offset offset in input, or -1 if the input is not a valid VP8 Payload Descriptor. The size is between 1 and 6.
-
getSize
public static int getSize(byte[] input, int offset, int length)The size in bytes of the Payload Descriptor at offset offset in input. The size is between 1 and 6.- Parameters:
input- inputoffset- offsetlength- length- Returns:
- The size in bytes of the Payload Descriptor at offset offset in input, or -1 if the input is not a valid VP8 Payload Descriptor. The size is between 1 and 6.
-
hasPictureId
public static boolean hasPictureId(byte[] buf, int off, int len)Determines whether the VP8 payload specified in the buffer that is passed as an argument has a picture ID or not.- Parameters:
buf- the byte buffer that contains the VP8 payload.off- the offset in the byte buffer where the VP8 payload starts.len- the length of the VP8 payload in the byte buffer.- Returns:
- true if the VP8 payload contains a picture ID, false otherwise.
-
hasExtendedPictureId
public static boolean hasExtendedPictureId(byte[] buf, int off, int len)Determines whether the VP8 payload specified in the buffer that is passed as an argument has an extended picture ID or not.- Parameters:
buf- the byte buffer that contains the VP8 payload.off- the offset in the byte buffer where the VP8 payload starts.len- the length of the VP8 payload in the byte buffer.- Returns:
- true if the VP8 payload contains an extended picture ID, false otherwise.
-
getPictureId
public static int getPictureId(byte[] input, int offset)Gets the value of the PictureID field of a VP8 Payload Descriptor.- Parameters:
input-offset-- Returns:
- the value of the PictureID field of a VP8 Payload Descriptor, or -1 if the fields is not present.
-
setExtendedPictureId
public static boolean setExtendedPictureId(byte[] buf, int off, int len, int val)Sets the extended picture ID for the VP8 payload specified in the buffer that is passed as an argument.- Parameters:
buf- the byte buffer that contains the VP8 payload.off- the offset in the byte buffer where the VP8 payload starts.len- the length of the VP8 payload in the byte buffer.- Returns:
- true if the operation succeeded, false otherwise.
-
setTL0PICIDX
public static boolean setTL0PICIDX(byte[] buf, int off, int len, int val)Sets the TL0PICIDX field for the VP8 payload specified in the buffer that is passed as an argument.- Parameters:
buf- the byte buffer that contains the VP8 payload.off- the offset in the byte buffer where the VP8 payload starts.len- the length of the VP8 payload in the byte buffer.- Returns:
- true if the operation succeeded, false otherwise.
-
isValid
public static boolean isValid(byte[] buf, int off, int len)Checks whether the arguments specify a valid buffer.- Parameters:
buf-off-len-- Returns:
- true if the arguments specify a valid buffer, false otherwise.
-
isStartOfPartition
public static boolean isStartOfPartition(byte[] input, int offset)Checks whether the 'start of partition' bit is set in the VP8 Payload Descriptor at offset offset in input.- Parameters:
input- inputoffset- offset- Returns:
- true if the 'start of partition' bit is set, false otherwise.
-
isStartOfFrame
public static boolean isStartOfFrame(byte[] input, int offset)Returns true if both the 'start of partition' bit is set and the PID fields has value 0 in the VP8 Payload Descriptor at offset offset in input.- Parameters:
input-offset-- Returns:
- true if both the 'start of partition' bit is set and the PID fields has value 0 in the VP8 Payload Descriptor at offset offset in input.
-
getPartitionId
public static int getPartitionId(byte[] input, int offset)Returns the value of the PID (partition ID) field of the VP8 Payload Descriptor at offset offset in input.- Parameters:
input-offset-- Returns:
- the value of the PID (partition ID) field of the VP8 Payload Descriptor at offset offset in input.
-
isReference
public static boolean isReference(byte[] buf, int off, int len)Gets a boolean that indicates whether or not the non-reference bit is set.- Parameters:
buf- the byte buffer that holds the VP8 payload descriptor.off- the offset in the byte buffer where the payload descriptor starts.len- the length of the payload descriptor in the byte buffer.- Returns:
- true if the non-reference bit is NOT set, false otherwise.
-
getTL0PICIDX
public static int getTL0PICIDX(byte[] buf, int off, int len)Gets the TL0PICIDX from the payload descriptor.- Parameters:
buf- the byte buffer that holds the VP8 payload descriptor.off- the offset in the byte buffer where the payload descriptor starts.len- the length of the payload descriptor in the byte buffer.- Returns:
- the TL0PICIDX from the payload descriptor.
-
toString
public static String toString(byte[] buf, int off, int len)
Provides a string description of the VP8 descriptor that can be used for debugging purposes.- Parameters:
buf-off-len-- Returns:
-
-