mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-05 08:16:55 +08:00
Rewrite MP4, HLS, MPEG-TS consumers
This commit is contained in:
@@ -180,8 +180,7 @@ func handlerWS(tr *ws.Transport, _ *ws.Message) error {
|
||||
|
||||
tr.Write(&ws.Message{Type: "mjpeg"})
|
||||
|
||||
wr := &writer2{tr: tr} // TODO: fixme
|
||||
go cons.WriteTo(wr)
|
||||
go cons.WriteTo(tr.Writer())
|
||||
|
||||
tr.OnClose(func() {
|
||||
stream.RemoveConsumer(cons)
|
||||
@@ -189,12 +188,3 @@ func handlerWS(tr *ws.Transport, _ *ws.Message) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type writer2 struct {
|
||||
tr *ws.Transport
|
||||
}
|
||||
|
||||
func (w *writer2) Write(p []byte) (n int, err error) {
|
||||
w.tr.Write(p)
|
||||
return len(p), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user