docs/doc/reference/com/google/android/exoplayer2/source/rtsp/RtpPacket.html
Package com.google.android.exoplayer2.source.rtsp
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classRtpPacketextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Represents the header and the payload of an RTP packet.
Not supported parsing at the moment: header extension and CSRC.
Structure of an RTP header (RFC3550, Section 5.1).
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| contributing source (CSRC) identifiers |
| .... |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| Profile-specific extension ID | Extension header length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extension header |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3 2 1
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | RtpPacket.Builder |
Deprecated.
Builder class for an RtpPacket
|
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| byte[] | csrc |
Deprecated.
The RTP CSRC fields (Optional, up to 15 items).
|
| static int | CSRC_SIZE |
Deprecated.
|
| byte | csrcCount |
Deprecated.
The RTP CSRC count field (Word 0, bits 4-7).
|
| boolean | extension |
Deprecated.
The RTP extension bit (Word 0, bit 3).
|
| boolean | marker |
Deprecated.
The RTP marker bit (Word 0, bit 8).
|
| static int | MAX_SEQUENCE_NUMBER |
Deprecated.
|
| static int | MAX_SIZE |
Deprecated.
|
| static int | MIN_HEADER_SIZE |
Deprecated.
|
| static int | MIN_SEQUENCE_NUMBER |
Deprecated.
|
| boolean | padding |
Deprecated.
The RTP padding bit (Word 0, bit 2).
|
| byte[] | payloadData |
Deprecated.
|
| byte | payloadType |
Deprecated.
The RTP CSRC count field (Word 0, bits 9-15).
|
| static int | RTP_VERSION |
Deprecated.
|
| int | sequenceNumber |
Deprecated.
The RTP sequence number field (Word 0, bits 16-31).
|
| int | ssrc |
Deprecated.
The RTP SSRC field (Word 2).
|
| long | timestamp |
Deprecated.
The RTP timestamp field (Word 1).
|
| byte | version |
Deprecated.
The RTP version field (Word 0, bits 0-1), should always be 2. |
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| boolean | equals(Object o) |
Deprecated.
|
| static int | getNextSequenceNumber(int sequenceNumber) |
Deprecated.
Returns the next sequence number of the sequenceNumber.
|
| static int | getPreviousSequenceNumber(int sequenceNumber) |
Deprecated.
Returns the previous sequence number from the sequenceNumber.
|
| int | hashCode() |
Deprecated.
|
| static RtpPacket | parse(byte[] buffer, int length) |
Deprecated.
Creates an RtpPacket from a byte array.
|
| static RtpPacket | parse(ParsableByteArray packetBuffer) |
Deprecated.
Creates an RtpPacket from a ParsableByteArray.
|
| String | toString() |
Deprecated.
|
| int | writeToBuffer(byte[] target, int offset, int length) |
Deprecated.
Writes the data in an RTP packet to a target buffer. |
-
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
public static final int RTP_VERSION
Deprecated. See Also:Constant Field Values
-
public static final int MAX_SIZE
Deprecated. See Also:Constant Field Values
-
public static final int MIN_HEADER_SIZE
Deprecated. See Also:Constant Field Values
-
public static final int MIN_SEQUENCE_NUMBER
Deprecated. See Also:Constant Field Values
-
public static final int MAX_SEQUENCE_NUMBER
Deprecated. See Also:Constant Field Values
-
public static final int CSRC_SIZE
Deprecated. See Also:Constant Field Values
-
public final byte version
Deprecated.
The RTP version field (Word 0, bits 0-1), should always be 2. See Also:Constant Field Values
-
public final boolean padding
Deprecated.
The RTP padding bit (Word 0, bit 2).
-
public final boolean extension
Deprecated.
The RTP extension bit (Word 0, bit 3).
-
public final byte csrcCount
Deprecated.
The RTP CSRC count field (Word 0, bits 4-7).
-
public final boolean marker
Deprecated.
The RTP marker bit (Word 0, bit 8).
-
public final byte payloadType
Deprecated.
The RTP CSRC count field (Word 0, bits 9-15).
-
public final int sequenceNumber
Deprecated.
The RTP sequence number field (Word 0, bits 16-31).
-
public final long timestamp
Deprecated.
The RTP timestamp field (Word 1).
-
public final int ssrc
Deprecated.
The RTP SSRC field (Word 2).
-
public final byte[] csrc
Deprecated.
The RTP CSRC fields (Optional, up to 15 items).
-
public final byte[] payloadData
Deprecated.
-
public static int getNextSequenceNumber(int sequenceNumber)
Deprecated.
Returns the next sequence number of the sequenceNumber.
-
public static int getPreviousSequenceNumber(int sequenceNumber)
Deprecated.
Returns the previous sequence number from the sequenceNumber.
-
@Nullable
public static[RtpPacket](RtpPacket.html "class in com.google.android.exoplayer2.source.rtsp")parse([ParsableByteArray](../../util/ParsableByteArray.html "class in com.google.android.exoplayer2.util")packetBuffer)
Deprecated.
Creates an RtpPacket from a ParsableByteArray.
Parameters:packetBuffer - The buffer that contains the RTP packet data.Returns:The built RtpPacket.
-
@Nullable
public static[RtpPacket](RtpPacket.html "class in com.google.android.exoplayer2.source.rtsp")parse(byte[] buffer,
int length)
Deprecated.
Creates an RtpPacket from a byte array.
Parameters:buffer - The buffer that contains the RTP packet data.length - The length of the RTP packet.Returns:The built RtpPacket.
-
public int writeToBuffer(byte[] target,
int offset,
int length)
Deprecated.
Writes the data in an RTP packet to a target buffer.
The size of the target buffer and the length argument should be big enough so that the entire RTP packet could fit. That is, if there is not enough space to store the entire RTP packet, no bytes will be written. The maximum size of an RTP packet is defined as MAX_SIZE.
Parameters:target - A target byte buffer to which the packet data is copied.offset - The offset into the target array at which to write.length - The maximum number of bytes that can be written.Returns:The number of bytes written, or C.LENGTH_UNSET if there is not enough space to write the packet.
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")o)
Deprecated.
Overrides:equals in class Object
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object
-
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()
Deprecated.
Overrides:toString in class Object