2023-08-17 16:35:06 +05:00
|
|
|
package rtmp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2023-08-18 12:48:05 +05:00
|
|
|
"stream_server/rtmp/flv"
|
2023-08-17 16:35:06 +05:00
|
|
|
)
|
|
|
|
|
|
|
|
func HandleDataLoop(chnk_wrp_ptr *ChunkWrapper) {
|
2023-08-18 12:48:05 +05:00
|
|
|
file_writer, err := flv.NewFLVWriter(chnk_wrp_ptr.params.stream_key)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
2023-08-17 16:35:06 +05:00
|
|
|
for {
|
|
|
|
p, err := chnk_wrp_ptr.ReadChunk()
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if p != nil {
|
|
|
|
fmt.Println(p.msg_type, p.msg_len)
|
|
|
|
}
|
|
|
|
}
|
2023-08-18 12:48:05 +05:00
|
|
|
file_writer.Close()
|
2023-08-17 16:35:06 +05:00
|
|
|
}
|