DelExtension Removes an RTP Header extension
(id uint8)
| 435 | |
| 436 | // DelExtension Removes an RTP Header extension |
| 437 | func (h *Header) DelExtension(id uint8) error { |
| 438 | if !h.Extension { |
| 439 | return errHeaderExtensionsNotEnabled |
| 440 | } |
| 441 | for i, extension := range h.Extensions { |
| 442 | if extension.id == id { |
| 443 | h.Extensions = append(h.Extensions[:i], h.Extensions[i+1:]...) |
| 444 | return nil |
| 445 | } |
| 446 | } |
| 447 | return errHeaderExtensionNotFound |
| 448 | } |
| 449 | |
| 450 | // Marshal serializes the packet into bytes. |
| 451 | func (p *Packet) Marshal() (buf []byte, err error) { |
no outgoing calls