mirror of https://bitbucket.org/ausocean/av.git
mts: remove gots packet conversion func, moved to iotsvc for local use
This commit is contained in:
parent
44b693f005
commit
98e925b23b
|
@ -32,7 +32,6 @@ package mts
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/Comcast/gots/packet"
|
||||
gotspsi "github.com/Comcast/gots/psi"
|
||||
|
@ -376,16 +375,6 @@ func asByte(b bool) byte {
|
|||
return 0
|
||||
}
|
||||
|
||||
// GotsPacket takes a byte slice and returns a Packet as defined in github.com/comcast/gots/packet.
|
||||
// TODO: replace this with a type conversion as described here: https://github.com/golang/go/issues/395
|
||||
// when it becomes available in Go 1.17.
|
||||
func GotsPacket(b []byte) *packet.Packet {
|
||||
if len(b) != packet.PacketSize {
|
||||
panic("invalid packet size")
|
||||
}
|
||||
return *(**packet.Packet)(unsafe.Pointer(&b))
|
||||
}
|
||||
|
||||
type Option func(p *packet.Packet)
|
||||
|
||||
// addAdaptationField adds an adaptation field to p, and applys the passed options to this field.
|
||||
|
|
|
@ -769,12 +769,3 @@ func TestFindPSI(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGotsPacket(t *testing.T) {
|
||||
b := make([]byte, 188)
|
||||
p := GotsPacket(b)
|
||||
p.SetPID(PIDAudio)
|
||||
if p.PID() != PIDAudio {
|
||||
t.Error("failed to set PID in gots Packet")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue