stream-server/rtmp/data_loop.go

23 lines
368 B
Go

package rtmp
import (
"fmt"
"stream_server/rtmp/flv"
)
func HandleDataLoop(chnk_wrp_ptr *ChunkWrapper) {
file_writer, err := flv.NewFLVWriter(chnk_wrp_ptr.params.stream_key)
if err != nil {
return
}
for {
p, err := chnk_wrp_ptr.ReadChunk()
if err != nil {
return
}
if p != nil {
fmt.Println(p.msg_type, p.msg_len)
}
}
file_writer.Close()
}