ServerConn: add trackID to OnSetup

This commit is contained in:
aler9
2021-01-06 19:37:38 +01:00
parent f455a7b6c1
commit 0fa011bf1a
5 changed files with 6 additions and 6 deletions

View File

@@ -74,7 +74,7 @@ func handleConn(conn *gortsplib.ServerConn) {
}
// called after receiving a SETUP request.
onSetup := func(req *base.Request, th *headers.Transport) (*base.Response, error) {
onSetup := func(req *base.Request, th *headers.Transport, trackID int) (*base.Response, error) {
return &base.Response{
StatusCode: base.StatusOK,
Header: base.Header{

View File

@@ -73,7 +73,7 @@ func handleConn(conn *gortsplib.ServerConn) {
}
// called after receiving a SETUP request.
onSetup := func(req *base.Request, th *headers.Transport) (*base.Response, error) {
onSetup := func(req *base.Request, th *headers.Transport, trackID int) (*base.Response, error) {
return &base.Response{
StatusCode: base.StatusOK,
Header: base.Header{

View File

@@ -73,7 +73,7 @@ func handleConn(conn *gortsplib.ServerConn) {
}
// called after receiving a SETUP request.
onSetup := func(req *base.Request, th *headers.Transport) (*base.Response, error) {
onSetup := func(req *base.Request, th *headers.Transport, trackID int) (*base.Response, error) {
return &base.Response{
StatusCode: base.StatusOK,
Header: base.Header{

View File

@@ -142,7 +142,7 @@ func (ts *testServ) handleConn(conn *ServerConn) {
}, nil
}
onSetup := func(req *base.Request, th *headers.Transport) (*base.Response, error) {
onSetup := func(req *base.Request, th *headers.Transport, trackID int) (*base.Response, error) {
return &base.Response{
StatusCode: base.StatusOK,
Header: base.Header{

View File

@@ -99,7 +99,7 @@ type ServerConnReadHandlers struct {
OnAnnounce func(req *base.Request, tracks Tracks) (*base.Response, error)
// called after receiving a SETUP request.
OnSetup func(req *base.Request, th *headers.Transport) (*base.Response, error)
OnSetup func(req *base.Request, th *headers.Transport, trackID int) (*base.Response, error)
// called after receiving a PLAY request.
OnPlay func(req *base.Request) (*base.Response, error)
@@ -444,7 +444,7 @@ func (sc *ServerConn) handleRequest(req *base.Request) (*base.Response, error) {
}
}
res, err := sc.readHandlers.OnSetup(req, th)
res, err := sc.readHandlers.OnSetup(req, th, trackID)
if res.StatusCode == 200 {
sc.tracksProtocol = &th.Protocol