RTX attribute constants should be public

This commit is contained in:
Adrian Cable
2023-10-07 20:40:13 -07:00
committed by cnderrauber
parent 219c6a35ce
commit d82b0d0a88
2 changed files with 9 additions and 7 deletions

View File

@@ -39,10 +39,12 @@ const (
sdesRepairRTPStreamIDURI = "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
// Attributes returned when Read() returns an RTX packet from a separate RTX stream (distinct SSRC)
attributeRtxPayloadType = "rtx_payload_type"
attributeRtxSsrc = "rtx_ssrc"
attributeRtxSequenceNumber = "rtx_sequence_number"
// AttributeRtxPayloadType is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream payload type
AttributeRtxPayloadType = "rtx_payload_type"
// AttributeRtxSsrc is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream SSRC
AttributeRtxSsrc = "rtx_ssrc"
// AttributeRtxSequenceNumber is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream sequence number
AttributeRtxSequenceNumber = "rtx_sequence_number"
)
func defaultSrtpProtectionProfiles() []dtls.SRTPProtectionProfile {

View File

@@ -454,9 +454,9 @@ func (r *RTPReceiver) receiveForRtx(ssrc SSRC, rsid string, streamInfo *intercep
continue
}
attributes.Set(attributeRtxPayloadType, b[1]&0x7F)
attributes.Set(attributeRtxSequenceNumber, binary.BigEndian.Uint16(b[2:4]))
attributes.Set(attributeRtxSsrc, binary.BigEndian.Uint32(b[8:12]))
attributes.Set(AttributeRtxPayloadType, b[1]&0x7F)
attributes.Set(AttributeRtxSequenceNumber, binary.BigEndian.Uint16(b[2:4]))
attributes.Set(AttributeRtxSsrc, binary.BigEndian.Uint32(b[8:12]))
b[1] = (b[1] & 0x80) | uint8(track.track.PayloadType())
b[2] = b[headerLength]