完善rtmp拉流

This commit is contained in:
yangjie
2023-11-26 22:06:40 +08:00
parent e84df324bf
commit 8485f6c857
5 changed files with 68 additions and 30 deletions

View File

@@ -1,10 +1,24 @@
package rtmp
import (
"github.com/yangjiechina/avformat/utils"
"github.com/yangjiechina/live-server/stream"
"net"
"testing"
)
func CreateTransStream(protocol stream.Protocol, streams []utils.AVStream) stream.ITransStream {
if stream.ProtocolRtmp == protocol {
return &TransStream{}
}
return nil
}
func init() {
stream.TransStreamFactory = CreateTransStream
}
func TestServer(t *testing.T) {
impl := serverImpl{}
addr := "0.0.0.0:1935"