Skip to content

Commit 6de39bf

Browse files
committed
RTX attribute constants should be public
1 parent aa3d286 commit 6de39bf

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

constants.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ const (
3232

3333
sdesRepairRTPStreamIDURI = "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
3434

35-
// Attributes returned when Read() returns an RTX packet from a separate RTX stream (distinct SSRC)
36-
attributeRtxPayloadType = "rtx_payload_type"
37-
attributeRtxSsrc = "rtx_ssrc"
38-
attributeRtxSequenceNumber = "rtx_sequence_number"
35+
// AttributeRtxPayloadType is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream payload type
36+
AttributeRtxPayloadType = "rtx_payload_type"
37+
// AttributeRtxSsrc is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream SSRC
38+
AttributeRtxSsrc = "rtx_ssrc"
39+
// AttributeRtxSequenceNumber is the interceptor attribute added when Read() returns an RTX packet containing the RTX stream sequence number
40+
AttributeRtxSequenceNumber = "rtx_sequence_number"
3941
)
4042

4143
func defaultSrtpProtectionProfiles() []dtls.SRTPProtectionProfile {

rtpreceiver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ func (r *RTPReceiver) receiveForRtx(ssrc SSRC, rsid string, streamInfo *intercep
463463
continue
464464
}
465465

466-
attributes.Set(attributeRtxPayloadType, b[1]&0x7F)
467-
attributes.Set(attributeRtxSequenceNumber, binary.BigEndian.Uint16(b[2:4]))
468-
attributes.Set(attributeRtxSsrc, binary.BigEndian.Uint32(b[8:12]))
466+
attributes.Set(AttributeRtxPayloadType, b[1]&0x7F)
467+
attributes.Set(AttributeRtxSequenceNumber, binary.BigEndian.Uint16(b[2:4]))
468+
attributes.Set(AttributeRtxSsrc, binary.BigEndian.Uint32(b[8:12]))
469469

470470
b[1] = (b[1] & 0x80) | uint8(track.track.PayloadType())
471471
b[2] = b[headerLength]

0 commit comments

Comments
 (0)