pion / example-webrtc-applications

Examples of WebRTC applications that are large, or use 3rd party libraries
https://pion.ly/
MIT License
1.06k stars 248 forks source link

go get failure: too many arguments in call to rtp.NewPacketizer #115

Closed dwebfan closed 2 years ago

dwebfan commented 2 years ago

Your environment.

What did you do?

Try to start one project from scratch, but go get fail

What did you expect?

go get should be success

What happened?

Not only go get fail, seems some example applications fail too under pion/webrtc/examples

$ go get github.com/pion/example-webrtc-applications/play-from-disk-h264
# github.com/pion/webrtc
go/src/github.com/pion/webrtc/track_local_static.go:226:34: too many arguments in call to rtp.NewPacketizer
    have (number, number, number, rtp.Payloader, rtp.Sequencer, uint32)
    want (uint16, uint8, uint32, rtp.Payloader, rtp.Sequencer)
$ go version
go version go1.13.15 linux/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build056897901=/tmp/go-build -gno-record-gcc-switches"
Sean-Der commented 2 years ago

Hi @dwebfan

Can you enable go modules and try again? export GO111MODULE=on

Also this package is at v3. So I believe you will need to do go get github.com/pion/example-webrtc-applications/v3/play-from-disk-h264

thanks

dwebfan commented 2 years ago

It works! Thanks a lot for quick reply.