Move ParseQuery from rtsp to mp4 module
This commit is contained in:
+1
-10
@@ -165,7 +165,7 @@ func tcpHandler(conn *rtsp.Conn) {
|
||||
|
||||
conn.SessionName = app.UserAgent
|
||||
|
||||
conn.Medias = ParseQuery(conn.URL.Query())
|
||||
conn.Medias = mp4.ParseQuery(conn.URL.Query())
|
||||
|
||||
if err := stream.AddConsumer(conn); err != nil {
|
||||
log.Warn().Err(err).Str("stream", name).Msg("[rtsp]")
|
||||
@@ -229,12 +229,3 @@ func tcpHandler(conn *rtsp.Conn) {
|
||||
|
||||
_ = conn.Close()
|
||||
}
|
||||
|
||||
func ParseQuery(query map[string][]string) []*streamer.Media {
|
||||
if query["mp4"] != nil {
|
||||
cons := mp4.Consumer{}
|
||||
return cons.GetMedias()
|
||||
}
|
||||
|
||||
return streamer.ParseQuery(query)
|
||||
}
|
||||
|
||||
@@ -24,6 +24,16 @@ type Consumer struct {
|
||||
send uint32
|
||||
}
|
||||
|
||||
// ParseQuery - like usual parse, but with mp4 param handler
|
||||
func ParseQuery(query map[string][]string) []*streamer.Media {
|
||||
if query["mp4"] != nil {
|
||||
cons := Consumer{}
|
||||
return cons.GetMedias()
|
||||
}
|
||||
|
||||
return streamer.ParseQuery(query)
|
||||
}
|
||||
|
||||
const (
|
||||
waitNone byte = iota
|
||||
waitKeyframe
|
||||
|
||||
Reference in New Issue
Block a user