Skip to content

Commit

Permalink
RTX attribute constants should be public
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancable authored and cnderrauber committed Feb 5, 2024
1 parent 219c6a3 commit d82b0d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions rtpreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d82b0d0

Please sign in to comment.