String helps with debugging by printing packet information in a readable way
()
| 60 | |
| 61 | // String helps with debugging by printing packet information in a readable way |
| 62 | func (p Packet) String() string { |
| 63 | out := "RTP PACKET:\n" |
| 64 | |
| 65 | out += fmt.Sprintf("\tVersion: %v\n", p.Version) |
| 66 | out += fmt.Sprintf("\tMarker: %v\n", p.Marker) |
| 67 | out += fmt.Sprintf("\tPayload Type: %d\n", p.PayloadType) |
| 68 | out += fmt.Sprintf("\tSequence Number: %d\n", p.SequenceNumber) |
| 69 | out += fmt.Sprintf("\tTimestamp: %d\n", p.Timestamp) |
| 70 | out += fmt.Sprintf("\tSSRC: %d (%x)\n", p.SSRC, p.SSRC) |
| 71 | out += fmt.Sprintf("\tPayload Length: %d\n", len(p.Payload)) |
| 72 | |
| 73 | return out |
| 74 | } |
| 75 | |
| 76 | // Unmarshal parses the passed byte slice and stores the result in the Header. |
| 77 | // It returns the number of bytes read n and any error. |
nothing calls this directly
no outgoing calls
no test coverage detected