Files
gortsplib/pkg/codecs/jpeg/define_restart_interval.go

21 lines
373 B
Go

package jpeg
import (
"fmt"
)
// DefineRestartInterval is a DRI marker.
type DefineRestartInterval struct {
Interval uint16
}
// Unmarshal decodes the marker.
func (m *DefineRestartInterval) Unmarshal(buf []byte) error {
if len(buf) != 2 {
return fmt.Errorf("unsupported DRI size of %d", len(buf))
}
m.Interval = uint16(buf[0])<<8 | uint16(buf[1])
return nil
}