Skip to content

Commit

Permalink
Attempt to reconcile modules
Browse files Browse the repository at this point in the history
  • Loading branch information
LimitlessEarth committed Aug 19, 2022
1 parent 975de6e commit 30ceb65
Show file tree
Hide file tree
Showing 33 changed files with 1,124 additions and 330 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x]
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x, 1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/Comcast/gots

go 1.16
go 1.18
2 changes: 1 addition & 1 deletion v2/ebp/cablelabsebp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"encoding/binary"
"time"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// cableLabsEbp is an encoder boundary point
Expand Down
2 changes: 1 addition & 1 deletion v2/ebp/comcastebp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"encoding/binary"
"time"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// cableLabsEbp is an encoder boundary point
Expand Down
2 changes: 1 addition & 1 deletion v2/ebp/ebp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"encoding/binary"
"time"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// EBP tags
Expand Down
2 changes: 1 addition & 1 deletion v2/ebp/ebp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"testing"
"time"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

var CableLabsEBPBytes = []byte{
Expand Down
13 changes: 1 addition & 12 deletions v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
module github.com/Comcast/gots/v2

go 1.16

require (
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/ksubedi/gomove v0.0.0-20200106182546-e1fa47256217 // indirect
github.com/mattn/go-colorable v0.1.10 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/urfave/cli v1.22.5 // indirect
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
golang.org/x/tools v0.1.6 // indirect
)
go 1.18
58 changes: 0 additions & 58 deletions v2/go.sum
Original file line number Diff line number Diff line change
@@ -1,58 +0,0 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/ksubedi/gomove v0.0.0-20200106182546-e1fa47256217 h1:CYk3GRunz2nSWbGNXpDxlr5uU/YTkBf1p9zorauMvvc=
github.com/ksubedi/gomove v0.0.0-20200106182546-e1fa47256217/go.mod h1:yq7Mn2Ip7t9irYr+JskEuBYdF3tKnikTKG49Qn5aDuY=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.10 h1:KWqbp83oZ6YOEgIbNW3BM1Jbe2tz4jgmWA9FOuAF8bw=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191204214957-d79e56da46fe/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.6 h1:SIasE1FVIQOWz2GEAHFOmoW7xchJcqlucjSULTL0Ag4=
golang.org/x/tools v0.1.6/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
23 changes: 16 additions & 7 deletions v2/packet/accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package packet
import (
"bytes"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// Iotas to track the state of the accumulator
Expand Down Expand Up @@ -61,9 +61,10 @@ type accumulator struct {
// the provided function returns done as true.
func NewAccumulator(f func(data []byte) (done bool, err error)) Accumulator {
return &accumulator{
f: f,
buf: &bytes.Buffer{},
state: stateStarting}
f: f,
buf: &bytes.Buffer{},
packets: []*Packet{},
state: stateStarting}
}

// Add a packet to the accumulator. If the added packet completes
Expand All @@ -77,7 +78,8 @@ func (a *accumulator) WritePacket(pkt *Packet) (int, error) {
return PacketSize, gots.ErrNoPayloadUnitStartIndicator
}

a.packets = []*Packet{}
a.buf.Reset()
a.packets = a.packets[:0]
a.state = stateAccumulating

case stateAccumulating:
Expand Down Expand Up @@ -114,17 +116,24 @@ func (a *accumulator) WritePacket(pkt *Packet) (int, error) {

// Bytes returns the payload bytes from the underlying buffer
func (a *accumulator) Bytes() []byte {
return a.buf.Bytes()
b := make([]byte, a.buf.Len())
copy(b, a.buf.Bytes())

return b
}

// Packets returns the packets used to fill the payload buffer
// NOTE: Not thread safe
func (a *accumulator) Packets() []*Packet {
return a.packets
b := make([]*Packet, len(a.packets))
copy(b, a.packets)

return b
}

// Reset resets the accumulator state
func (a *accumulator) Reset() {
a.state = stateStarting
a.buf.Reset()
a.packets = a.packets[:0]
}
2 changes: 1 addition & 1 deletion v2/packet/accumulator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"encoding/hex"
"testing"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// PacketAccumulator is not thread safe
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/adaptationfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package packet

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/adaptationfield/adaptationfield.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package adaptationfield

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
"github.com/Comcast/gots/v2/packet"
)

Expand Down
2 changes: 1 addition & 1 deletion v2/packet/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package packet

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"encoding/binary"
"io"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// Peeker wraps the Peek method.
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package packet

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// flags that are reserved and should not be used.
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package packet

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion v2/packet/packetwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package packet
import (
"io"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// PacketWriter is subject to all rules governing implementations of io.Writer
Expand Down
4 changes: 2 additions & 2 deletions v2/pes/pesheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"errors"
"fmt"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// stream_id possibilities
Expand Down Expand Up @@ -170,7 +170,7 @@ func NewPESHeader(pesBytes []byte) (PESHeader, error) {
pes := new(pESHeader)
var err error

if CheckLength(pesBytes, "PES", 6) {
if CheckLength(pesBytes, "PES", 7) {

pes.packetStartCodePrefix = uint32(pesBytes[0])<<16 | uint32(pesBytes[1])<<8 | uint32(pesBytes[2])

Expand Down
2 changes: 1 addition & 1 deletion v2/psi/pat.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"errors"
"io"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
"github.com/Comcast/gots/v2/packet"
)

Expand Down
2 changes: 1 addition & 1 deletion v2/psi/pmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"fmt"
"io"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
"github.com/Comcast/gots/v2/packet"
)

Expand Down
2 changes: 1 addition & 1 deletion v2/psi/pmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"fmt"
"testing"

"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
"github.com/Comcast/gots/v2/packet"
)

Expand Down
2 changes: 1 addition & 1 deletion v2/psi/psi.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package psi

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// TableHeader struct represents operations available on all PSI
Expand Down
2 changes: 1 addition & 1 deletion v2/scte35/descriptormodify.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
package scte35

import (
"github.com/Comcast/gots/v2/"
"github.com/Comcast/gots/v2"
)

// SetUPIDType will set the type of the UPID
Expand Down

0 comments on commit 30ceb65

Please sign in to comment.