doc.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. Package rtcp implements encoding and decoding of RTCP packets according to RFCs 3550 and 5506.
  3. RTCP is a sister protocol of the Real-time Transport Protocol (RTP). Its basic functionality
  4. and packet structure is defined in RFC 3550. RTCP provides out-of-band statistics and control
  5. information for an RTP session. It partners with RTP in the delivery and packaging of multimedia data,
  6. but does not transport any media data itself.
  7. The primary function of RTCP is to provide feedback on the quality of service (QoS)
  8. in media distribution by periodically sending statistics information such as transmitted octet
  9. and packet counts, packet loss, packet delay variation, and round-trip delay time to participants
  10. in a streaming multimedia session. An application may use this information to control quality of
  11. service parameters, perhaps by limiting flow, or using a different codec.
  12. Decoding RTCP packets:
  13. pkts, err := rtcp.Unmarshal(rtcpData)
  14. // ...
  15. for _, pkt := range pkts {
  16. switch p := pkt.(type) {
  17. case *rtcp.CompoundPacket:
  18. ...
  19. case *rtcp.PictureLossIndication:
  20. ...
  21. default:
  22. ...
  23. }
  24. }
  25. Encoding RTCP packets:
  26. pkt := &rtcp.PictureLossIndication{
  27. SenderSSRC: senderSSRC,
  28. MediaSSRC: mediaSSRC
  29. }
  30. pliData, err := pkt.Marshal()
  31. // ...
  32. */
  33. package rtcp