package codecs

Import Path
	github.com/pion/rtp/codecs (on go.dev)

Dependency Relation
	imports 8 packages, and imported by one package


Package-Level Type Names (total 28)
/* sort by: | */
AV1Depacketizer is a AV1 RTP Packet depacketizer. Reads AV1 packets from a RTP stream and outputs AV1 low overhead bitstream. Z, Y, N are flags from the AV1 Aggregation Header. Z, Y, N are flags from the AV1 Aggregation Header. Z, Y, N are flags from the AV1 Aggregation Header. IsPartitionHead returns true if Z in the AV1 Aggregation Header is set to 0. (*AV1Depacketizer) IsPartitionTail(marker bool, _ []byte) bool SetZeroAllocation enables Zero Allocation mode for the depacketizer By default the Depacketizers will allocate as they parse. These allocations are needed for Metadata and other optional values. If you don't need this information enabling SetZeroAllocation gives you higher performance at a reduced feature set. Unmarshal parses an AV1 RTP payload into its constituent OBUs stream with obu_size_field, It assumes that the payload is in order (e.g. the caller is responsible for reordering RTP packets). If the last OBU in the payload is fragmented, it will be stored in the buffer until the it is completed. *AV1Depacketizer : github.com/pion/rtp.Depacketizer *AV1Depacketizer : github.com/pion/rtp.PartitionHeadChecker
AV1Packet represents a depacketized AV1 RTP Packet * 0 1 2 3 4 5 6 7 * +-+-+-+-+-+-+-+-+ * |Z|Y| W |N|-|-|-| * +-+-+-+-+-+-+-+-+ * https://aomediacodec.github.io/av1-rtp-spec/#44-av1-aggregation-header Deprecated: Use AV1Depacketizer instead. N: MUST be set to 1 if the packet is the first packet of a coded video sequence, and MUST be set to 0 otherwise. Each AV1 RTP Packet is a collection of OBU Elements. Each OBU Element may be a full OBU, or just a fragment of one. AV1Frame provides the tools to construct a collection of OBUs from a collection of OBU Elements W: two bit field that describes the number of OBU elements in the packet. This field MUST be set equal to 0 or equal to the number of OBU elements contained in the packet. If set to 0, each OBU element MUST be preceded by a length field. If not set to 0 (i.e., W = 1, 2 or 3) the last OBU element MUST NOT be preceded by a length field. Instead, the length of the last OBU element contained in the packet can be calculated as follows: Length of the last OBU element = length of the RTP payload - length of aggregation header - length of previous OBU elements including length fields Y: MUST be set to 1 if the last OBU element is an OBU fragment that will continue in the next packet, and MUST be set to 0 otherwise. Z: MUST be set to 1 if the first OBU element is an OBU fragment that is a continuation of an OBU fragment from the previous packet, and MUST be set to 0 otherwise. Unmarshal parses the passed byte slice and stores the result in the AV1Packet this method is called upon.
AV1Payloader payloads AV1 packets. Payload implements AV1 RTP payloader. Reads from a open_bitstream_unit (OBU) framing stream as defined in 5.3. https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=39 Returns AV1 RTP packets https://aomediacodec.github.io/av1-rtp-spec/ The payload is fragmented into multiple packets, each packet is a valid AV1 RTP payload. nolint:cyclop *AV1Payloader : github.com/pion/rtp.Payloader
G711Payloader payloads G711 packets. Payload fragments an G711 packet across one or more byte arrays. *G711Payloader : github.com/pion/rtp.Payloader
G722Payloader payloads G722 packets. Payload fragments an G722 packet across one or more byte arrays. *G722Payloader : github.com/pion/rtp.Payloader
H264Packet represents the H264 header that is stored in the payload of an RTP Packet. IsAVC bool IsDetectedFinalPacketInSequence returns true of the packet passed in has the marker bit set indicated the end of a packet sequence. IsPartitionHead checks if this is the head of a packetized nalu stream. (*H264Packet) IsPartitionTail(marker bool, _ []byte) bool SetZeroAllocation enables Zero Allocation mode for the depacketizer By default the Depacketizers will allocate as they parse. These allocations are needed for Metadata and other optional values. If you don't need this information enabling SetZeroAllocation gives you higher performance at a reduced feature set. Unmarshal parses the passed byte slice and stores the result in the H264Packet this method is called upon. *H264Packet : github.com/pion/rtp.Depacketizer *H264Packet : github.com/pion/rtp.PartitionHeadChecker
H264PartitionHeadChecker checks H264 partition head. Deprecated: replaced by H264Packet.IsPartitionHead(). IsPartitionHead checks if this is the head of a packetized nalu stream. Deprecated: replaced by H264Packet.IsPartitionHead(). *H264PartitionHeadChecker : github.com/pion/rtp.PartitionHeadChecker
H264Payloader payloads H264 packets. DisableStapA bool Payload fragments a H264 packet across one or more byte arrays. *H264Payloader : github.com/pion/rtp.Payloader
H265AggregationPacket represents an Aggregation packet. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PayloadHdr (Type=48) | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | * | | * | two or more aggregation units | * | | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | :...OPTIONAL RTP padding | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2 FirstUnit returns the first Aggregated Unit of the packet. OtherUnits returns the all the other Aggregated Unit of the packet (excluding the first one). Unmarshal parses the passed byte slice and stores the result in the H265AggregationPacket this method is called upon. WithDONL can be called to specify whether or not DONL might be parsed. DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
H265AggregationUnit represent the an Aggregation Unit in an AP, which is not the first one. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * : DOND (cond) | NALU size | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | * | NAL unit | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | : * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2 DOND field plus 1 specifies the difference between the decoding order number values of the current aggregated NAL unit and the preceding aggregated NAL unit in the same AP. NALUSize represents the size, in bytes, of the NalUnit. NalUnit payload. func (*H265AggregationPacket).OtherUnits() []H265AggregationUnit
H265AggregationUnitFirst represent the First Aggregation Unit in an AP. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * : DONL (conditional) | NALU size | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | NALU size | | * +-+-+-+-+-+-+-+-+ NAL unit | * | | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | : * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2 DONL field, when present, specifies the value of the 16 least significant bits of the decoding order number of the aggregated NAL unit. NALUSize represents the size, in bytes, of the NalUnit. NalUnit payload. func (*H265AggregationPacket).FirstUnit() *H265AggregationUnitFirst
H265FragmentationUnitHeader is a H265 FU Header. +---------------+ |0|1|2|3|4|5|6|7| +-+-+-+-+-+-+-+-+ |S|E| FuType | +---------------+ . E represents the end of a fragmented NAL unit. FuType MUST be equal to the field Type of the fragmented NAL unit. S represents the start of a fragmented NAL unit. func (*H265FragmentationUnitPacket).FuHeader() H265FragmentationUnitHeader
H265FragmentationUnitPacket represents a single Fragmentation Unit packet. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PayloadHdr (Type=49) | FU header | DONL (cond) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| * | DONL (cond) | | * |-+-+-+-+-+-+-+-+ | * | FU payload | * | | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | :...OPTIONAL RTP padding | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.3 DONL returns the DONL of the packet. FuHeader returns the Fragmentation Unit Header of the packet. Payload returns the Fragmentation Unit packet payload. PayloadHeader returns the NALU header of the packet. Unmarshal parses the passed byte slice and stores the result in the H265FragmentationUnitPacket this method is called upon. WithDONL can be called to specify whether or not DONL might be parsed. DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
H265NALUHeader is a H265 NAL Unit Header. https://datatracker.ietf.org/doc/html/rfc7798#section-1.1.4 * +---------------+---------------+ * |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |F| Type | LayerID | TID | * +-------------+-----------------+ * . F is the forbidden bit, should always be 0. IsAggregationPacket returns whether or not the packet is an Aggregation packet. IsFragmentationUnit returns whether or not the packet is a Fragmentation Unit packet. IsPACIPacket returns whether or not the packet is a PACI packet. IsTypeVCLUnit returns whether or not the NAL Unit type is a VCL NAL unit. LayerID should always be 0 in non-3D HEVC context. TID is the temporal identifier of the NAL unit +1. Type of NAL Unit. func (*H265FragmentationUnitPacket).PayloadHeader() H265NALUHeader func (*H265PACIPacket).PayloadHeader() H265NALUHeader func (*H265SingleNALUnitPacket).PayloadHeader() H265NALUHeader
H265PACIPacket represents a single H265 PACI packet. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PayloadHdr (Type=50) |A| cType | PHSsize |F0..2|Y| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Payload Header Extension Structure (PHES) | * |=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=| * | | * | PACI payload: NAL unit | * | . . . | * | | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | :...OPTIONAL RTP padding | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.4 A copies the F bit of the PACI payload NALU. CType copies the Type field of the PACI payload NALU. F0 indicates the presence of a Temporal Scalability support extension in the PHES. F1 must be zero, reserved for future extensions. F2 must be zero, reserved for future extensions. PHES contains header extensions. Its size is indicated by PHSsize. PHSsize indicates the size of the PHES field. Payload is a single NALU or NALU-like struct, not including the first two octets (header). PayloadHeader returns the NAL Unit Header. TSCI returns the Temporal Scalability Control Information extension, if present. Unmarshal parses the passed byte slice and stores the result in the H265PACIPacket this method is called upon. Y must be zero, reserved for future extensions.
H265Packet represents a H265 packet, stored in the payload of an RTP packet. IsPartitionHead checks if this is the head of a packetized nalu stream. (*H265Packet) IsPartitionTail(marker bool, _ []byte) bool Packet returns the populated packet. Must be casted to one of: - *H265SingleNALUnitPacket - *H265FragmentationUnitPacket - *H265AggregationPacket - *H265PACIPacket nolint:golint SetZeroAllocation enables Zero Allocation mode for the depacketizer By default the Depacketizers will allocate as they parse. These allocations are needed for Metadata and other optional values. If you don't need this information enabling SetZeroAllocation gives you higher performance at a reduced feature set. Unmarshal parses the passed byte slice and stores the result in the H265Packet this method is called upon. WithDONL can be called to specify whether or not DONL might be parsed. DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream. *H265Packet : github.com/pion/rtp.Depacketizer *H265Packet : github.com/pion/rtp.PartitionHeadChecker
H265Payloader payloads H265 packets. AddDONL bool SkipAggregation bool Payload fragments a H265 packet across one or more byte arrays. *H265Payloader : github.com/pion/rtp.Payloader
H265SingleNALUnitPacket represents a NALU packet, containing exactly one NAL unit. * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PayloadHdr | DONL (conditional) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | * | NAL unit payload data | * | | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | :...OPTIONAL RTP padding | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.1 DONL returns the DONL of the packet. Payload returns the Fragmentation Unit packet payload. PayloadHeader returns the NALU header of the packet. Unmarshal parses the passed byte slice and stores the result in the H265SingleNALUnitPacket this method is called upon. WithDONL can be called to specify whether or not DONL might be parsed. DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
H265TSCI is a Temporal Scalability Control Information header extension. Reference: https://datatracker.ietf.org/doc/html/rfc7798#section-4.5 E see RFC7798 for more details. IrapPicID see RFC7798 for more details. RES see RFC7798 for more details. S see RFC7798 for more details. TL0PICIDX see RFC7798 for more details. func (*H265PACIPacket).TSCI() *H265TSCI
OpusPacket represents the Opus header that is stored in the payload of an RTP Packet. Payload []byte (*OpusPacket) IsPartitionHead(_ []byte) bool (*OpusPacket) IsPartitionTail(_ bool, _ []byte) bool Unmarshal parses the passed byte slice and stores the result in the OpusPacket this method is called upon. *OpusPacket : github.com/pion/rtp.Depacketizer *OpusPacket : github.com/pion/rtp.PartitionHeadChecker
OpusPartitionHeadChecker checks Opus partition head. Deprecated: replaced by OpusPacket.IsPartitionHead(). IsPartitionHead checks whether if this is a head of the Opus partition. Deprecated: replaced by OpusPacket.IsPartitionHead(). *OpusPartitionHeadChecker : github.com/pion/rtp.PartitionHeadChecker
OpusPayloader payloads Opus packets. Payload fragments an Opus packet across one or more byte arrays. *OpusPayloader : github.com/pion/rtp.Payloader
VP8Packet represents the VP8 header that is stored in the payload of an RTP Packet. Extended control bits // 1 if PictureID is present // 1 if KEYIDX is present // 5 bits temporal key frame index // 1 if TL0PICIDX is present // when set to 1 this frame can be discarded // partition index Payload []byte Optional extension // 8 or 16 bits, picture ID // start of VP8 partition // 1 if TID is present // 2 bits temporal layer index // 8 bits temporal level zero index Required Header // extended control bits present // 1 bit layer sync bit IsPartitionHead checks whether if this is a head of the VP8 partition. (*VP8Packet) IsPartitionTail(marker bool, _ []byte) bool SetZeroAllocation enables Zero Allocation mode for the depacketizer By default the Depacketizers will allocate as they parse. These allocations are needed for Metadata and other optional values. If you don't need this information enabling SetZeroAllocation gives you higher performance at a reduced feature set. Unmarshal parses the passed byte slice and stores the result in the VP8Packet this method is called upon. *VP8Packet : github.com/pion/rtp.Depacketizer *VP8Packet : github.com/pion/rtp.PartitionHeadChecker
VP8PartitionHeadChecker checks VP8 partition head Deprecated: replaced by VP8Packet.IsPartitionHead(). IsPartitionHead checks whether if this is a head of the VP8 partition. Deprecated: replaced by VP8Packet.IsPartitionHead(). *VP8PartitionHeadChecker : github.com/pion/rtp.PartitionHeadChecker
VP8Payloader payloads VP8 packets. EnablePictureID bool Payload fragments a VP8 packet across one or more byte arrays. *VP8Payloader : github.com/pion/rtp.Payloader
VP9Packet represents the VP9 header that is stored in the payload of an RTP Packet. // Start of a frame // Inter-layer dependency used // End of a frame // Flexible mode // PG description present flag. Height []uint16 Required header // PictureID is present // Layer indices is present // N_G indicates the number of pictures in a Picture Group (PG) Scalability structure headers // N_S + 1 indicates the number of spatial layers present in the VP9 stream // Inter-picture predicted frame Conditionally required headers // Reference index (F=1) // Reference indecies of pictures in a Picture Group // Temporal layer ID of pictures in a Picture Group // Switching up point of pictures in a Picture Group Payload []byte Recommended headers // 7 or 16 bits, picture ID // Spatial layer ID Conditionally recommended headers // Temporal layer ID // Temporal layer zero index (F=0) // Switching up point // Scalability structure (SS) data present Width []uint16 // Each spatial layer's frame resolution present // Not a reference frame for upper spatial layers IsPartitionHead checks whether if this is a head of the VP9 partition. (*VP9Packet) IsPartitionTail(marker bool, _ []byte) bool SetZeroAllocation enables Zero Allocation mode for the depacketizer By default the Depacketizers will allocate as they parse. These allocations are needed for Metadata and other optional values. If you don't need this information enabling SetZeroAllocation gives you higher performance at a reduced feature set. Unmarshal parses the passed byte slice and stores the result in the VP9Packet this method is called upon. *VP9Packet : github.com/pion/rtp.Depacketizer *VP9Packet : github.com/pion/rtp.PartitionHeadChecker
VP9PartitionHeadChecker checks VP9 partition head. Deprecated: replaced by VP9Packet.IsPartitionHead(). IsPartitionHead checks whether if this is a head of the VP9 partition. Deprecated: replaced by VP9Packet.IsPartitionHead(). *VP9PartitionHeadChecker : github.com/pion/rtp.PartitionHeadChecker
VP9Payloader payloads VP9 packets. whether to use flexible mode or non-flexible mode. InitialPictureIDFn is a function that returns random initial picture ID. Payload fragments an VP9 packet across one or more byte arrays. *VP9Payloader : github.com/pion/rtp.Payloader