From 0962b1047de78fbd1b9a0e436d1bcb6321941f9c Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 7 Mar 2019 20:14:50 +1030 Subject: [PATCH] revid: removed udp sender and anything pertainent to it --- revid/revid.go | 6 ------ revid/senders.go | 35 ----------------------------------- 2 files changed, 41 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index 2dad123c..33c3d0cc 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -232,12 +232,6 @@ func (r *Revid) reset(config Config) error { default: r.destination = append(r.destination, newHttpSender(r.ns, r.config.Logger.Log)) } - case Udp: - s, err := newUdpSender(r.config.RtpAddress, r.config.Logger.Log) - if err != nil { - return err - } - r.destination = append(r.destination, s) case Rtp: s, err := newRtpSender(r.config.RtpAddress, r.config.Logger.Log, r.config.FrameRate) if err != nil { diff --git a/revid/senders.go b/revid/senders.go index b73de1c1..ac76736e 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -388,41 +388,6 @@ func (s *rtmpSender) close() error { return nil } -// udpSender implements loadSender for a native udp destination. -type udpSender struct { - conn net.Conn - log func(lvl int8, msg string, args ...interface{}) - chunk *ring.Chunk -} - -func newUdpSender(addr string, log func(lvl int8, msg string, args ...interface{})) (*udpSender, error) { - conn, err := net.Dial("udp", addr) - if err != nil { - return nil, err - } - return &udpSender{ - conn: conn, - log: log, - }, nil -} - -func (s *udpSender) load(c *ring.Chunk) error { - s.chunk = c - return nil -} - -func (s *udpSender) send() error { - _, err := s.chunk.WriteTo(s.conn) - return err -} - -func (s *udpSender) release() { - s.chunk.Close() - s.chunk = nil -} - -func (s *udpSender) close() error { return nil } - // TODO: Write restart func for rtpSender // rtpSender implements loadSender for a native udp destination with rtp packetization. type rtpSender struct {