mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-09 07:58:04 +00:00
rename rtmputils into rtmp
This commit is contained in:
parent
d850492ca0
commit
897322e3a6
@ -11,7 +11,7 @@ import (
|
||||
"github.com/aler9/rtsp-simple-server/internal/clientrtmp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/clientrtsp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/logger"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmputils"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/serverrtmp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/serverrtsp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/stats"
|
||||
@ -126,11 +126,11 @@ func (cm *ClientManager) run() {
|
||||
return make(chan *gortsplib.ServerConn)
|
||||
}()
|
||||
|
||||
rtmpAccept := func() chan *rtmputils.Conn {
|
||||
rtmpAccept := func() chan *rtmp.Conn {
|
||||
if cm.serverRTMP != nil {
|
||||
return cm.serverRTMP.Accept()
|
||||
}
|
||||
return make(chan *rtmputils.Conn)
|
||||
return make(chan *rtmp.Conn)
|
||||
}()
|
||||
|
||||
outer:
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/aler9/rtsp-simple-server/internal/h264"
|
||||
"github.com/aler9/rtsp-simple-server/internal/logger"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtcpsenderset"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmputils"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/stats"
|
||||
)
|
||||
|
||||
@ -84,7 +84,7 @@ type Client struct {
|
||||
runOnConnectRestart bool
|
||||
stats *stats.Stats
|
||||
wg *sync.WaitGroup
|
||||
conn *rtmputils.Conn
|
||||
conn *rtmp.Conn
|
||||
pathMan PathMan
|
||||
parent Parent
|
||||
|
||||
@ -109,7 +109,7 @@ func New(
|
||||
runOnConnectRestart bool,
|
||||
wg *sync.WaitGroup,
|
||||
stats *stats.Stats,
|
||||
conn *rtmputils.Conn,
|
||||
conn *rtmp.Conn,
|
||||
pathMan PathMan,
|
||||
parent Parent) *Client {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package rtmputils
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"time"
|
@ -1,4 +1,4 @@
|
||||
package rtmputils
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"github.com/notedit/rtmp/format/rtmp"
|
@ -1,4 +1,4 @@
|
||||
package rtmputils
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"net"
|
@ -1,17 +1,17 @@
|
||||
package rtmputils
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/notedit/rtmp/av"
|
||||
rh264 "github.com/notedit/rtmp/codec/h264"
|
||||
nh264 "github.com/notedit/rtmp/codec/h264"
|
||||
|
||||
"github.com/aler9/rtsp-simple-server/internal/h264"
|
||||
)
|
||||
|
||||
// WriteH264Config writes a H264 config.
|
||||
func (c *Conn) WriteH264Config(sps []byte, pps []byte) error {
|
||||
codec := rh264.Codec{
|
||||
codec := nh264.Codec{
|
||||
SPS: map[int][]byte{
|
||||
0: sps,
|
||||
},
|
@ -1,11 +1,11 @@
|
||||
package rtmputils
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/aler9/gortsplib"
|
||||
"github.com/notedit/rtmp/av"
|
||||
rh264 "github.com/notedit/rtmp/codec/h264"
|
||||
nh264 "github.com/notedit/rtmp/codec/h264"
|
||||
"github.com/notedit/rtmp/format/flv/flvio"
|
||||
)
|
||||
|
||||
@ -125,7 +125,7 @@ func (conn *Conn) ReadMetadata() (*gortsplib.Track, *gortsplib.Track, error) {
|
||||
return nil, nil, fmt.Errorf("video track setupped twice")
|
||||
}
|
||||
|
||||
codec, err := rh264.FromDecoderConfig(pkt.Data)
|
||||
codec, err := nh264.FromDecoderConfig(pkt.Data)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
@ -6,10 +6,10 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/notedit/rtmp/format/rtmp"
|
||||
nrtmp "github.com/notedit/rtmp/format/rtmp"
|
||||
|
||||
"github.com/aler9/rtsp-simple-server/internal/logger"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmputils"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmp"
|
||||
)
|
||||
|
||||
// Parent is implemented by program.
|
||||
@ -22,11 +22,11 @@ type Server struct {
|
||||
parent Parent
|
||||
|
||||
l net.Listener
|
||||
srv *rtmp.Server
|
||||
srv *nrtmp.Server
|
||||
closed uint32
|
||||
wg sync.WaitGroup
|
||||
|
||||
accept chan *rtmputils.Conn
|
||||
accept chan *rtmp.Conn
|
||||
}
|
||||
|
||||
// New allocates a Server.
|
||||
@ -44,10 +44,10 @@ func New(
|
||||
s := &Server{
|
||||
parent: parent,
|
||||
l: l,
|
||||
accept: make(chan *rtmputils.Conn),
|
||||
accept: make(chan *rtmp.Conn),
|
||||
}
|
||||
|
||||
s.srv = rtmp.NewServer()
|
||||
s.srv = nrtmp.NewServer()
|
||||
s.srv.HandleConn = s.innerHandleConn
|
||||
|
||||
s.log(logger.Info, "opened on %s", address)
|
||||
@ -96,11 +96,11 @@ func (s *Server) run() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) innerHandleConn(rconn *rtmp.Conn, nconn net.Conn) {
|
||||
s.accept <- rtmputils.NewConn(rconn, nconn)
|
||||
func (s *Server) innerHandleConn(rconn *nrtmp.Conn, nconn net.Conn) {
|
||||
s.accept <- rtmp.NewConn(rconn, nconn)
|
||||
}
|
||||
|
||||
// Accept returns a channel to accept incoming connections.
|
||||
func (s *Server) Accept() chan *rtmputils.Conn {
|
||||
func (s *Server) Accept() chan *rtmp.Conn {
|
||||
return s.accept
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"github.com/aler9/rtsp-simple-server/internal/h264"
|
||||
"github.com/aler9/rtsp-simple-server/internal/logger"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtcpsenderset"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmputils"
|
||||
"github.com/aler9/rtsp-simple-server/internal/rtmp"
|
||||
"github.com/aler9/rtsp-simple-server/internal/source"
|
||||
"github.com/aler9/rtsp-simple-server/internal/stats"
|
||||
)
|
||||
@ -108,12 +108,12 @@ func (s *Source) run() {
|
||||
func (s *Source) runInner() bool {
|
||||
s.log(logger.Info, "connecting")
|
||||
|
||||
var conn *rtmputils.Conn
|
||||
var conn *rtmp.Conn
|
||||
var err error
|
||||
dialDone := make(chan struct{}, 1)
|
||||
go func() {
|
||||
defer close(dialDone)
|
||||
conn, err = rtmputils.Dial(s.ur)
|
||||
conn, err = rtmp.Dial(s.ur)
|
||||
}()
|
||||
|
||||
select {
|
||||
|
Loading…
Reference in New Issue
Block a user