media.go 606 B

123456789101112131415161718192021222324252627
  1. // Package media provides media writer and filters
  2. package media
  3. import (
  4. "time"
  5. "github.com/pion/rtp"
  6. )
  7. // A Sample contains encoded media and timing information
  8. type Sample struct {
  9. Data []byte
  10. Timestamp time.Time
  11. Duration time.Duration
  12. PacketTimestamp uint32
  13. PrevDroppedPackets uint16
  14. }
  15. // Writer defines an interface to handle
  16. // the creation of media files
  17. type Writer interface {
  18. // Add the content of an RTP packet to the media
  19. WriteRTP(packet *rtp.Packet) error
  20. // Close the media
  21. // Note: Close implementation must be idempotent
  22. Close() error
  23. }