mirror of
https://github.com/aler9/gortsplib
synced 2025-10-15 19:50:45 +08:00
implement publishing (#4)
This commit is contained in:
23
utils.go
23
utils.go
@@ -80,6 +80,29 @@ func (st StreamType) String() string {
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
// SetupMode is a setup mode.
|
||||
type SetupMode int
|
||||
|
||||
const (
|
||||
// SetupModePlay is the "play" setup mode
|
||||
SetupModePlay SetupMode = iota
|
||||
|
||||
// SetupModeRecord is the "record" setup mode
|
||||
SetupModeRecord
|
||||
)
|
||||
|
||||
// String implements fmt.Stringer
|
||||
func (sm SetupMode) String() string {
|
||||
switch sm {
|
||||
case SetupModePlay:
|
||||
return "play"
|
||||
|
||||
case SetupModeRecord:
|
||||
return "record"
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func readBytesLimited(rb *bufio.Reader, delim byte, n int) ([]byte, error) {
|
||||
for i := 1; i <= n; i++ {
|
||||
byts, err := rb.Peek(i)
|
||||
|
Reference in New Issue
Block a user