improve coverage (#168)

This commit is contained in:
Alessandro Ros
2023-01-06 23:34:10 +01:00
committed by GitHub
parent a759ba9d01
commit 2e88705875
195 changed files with 535 additions and 63 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"fmt"
"log"
"sync"
@@ -86,6 +87,19 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
sh.publisher.Close()
}
var forma *format.H265
medi := ctx.Medias.FindFormat(&forma)
if medi == nil {
return &base.Response{
StatusCode: base.StatusBadRequest,
}, fmt.Errorf("H264 media not found")
}
for _, x := range forma.PPS {
fmt.Printf("0x%.2x, ", x)
}
fmt.Println("")
// create the stream and save the publisher
sh.stream = gortsplib.NewServerStream(ctx.Medias)
sh.publisher = ctx.Session