server: decode and encode RTP/RTCP packets

This commit is contained in:
aler9
2021-12-21 23:26:58 +01:00
committed by Alessandro Ros
parent b7df36d4ad
commit 3a2f9adbd5
12 changed files with 197 additions and 129 deletions

View File

@@ -1608,9 +1608,7 @@ func (c *Client) doPlay(ra *headers.Range, isSwitchingProtocol bool) (*base.Resp
// open the firewall by sending packets to the counterpart.
for _, cct := range c.tracks {
byts, _ := (&rtp.Packet{
Header: rtp.Header{Version: 2},
}).Marshal()
byts, _ := (&rtp.Packet{Header: rtp.Header{Version: 2}}).Marshal()
cct.udpRTPListener.write(byts)
byts, _ = (&rtcp.ReceiverReport{}).Marshal()