We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's not a problem for now, but I would like to leave a note.
Following test just checks OnEnded callback.
OnEnded
package main import ( "testing" "time" "github.com/pion/mediadevices" _ "github.com/pion/mediadevices/pkg/codec/vpx" "github.com/pion/mediadevices/pkg/frame" "github.com/pion/webrtc/v2" ) func TestMain(t *testing.T) { configs := map[string]webrtc.Configuration{ "WithSTUN": { ICEServers: []webrtc.ICEServer{ {URLs: []string{"stun:stun.l.google.com:19302"}}, }, }, "WithoutSTUN": { ICEServers: []webrtc.ICEServer{}, }, } for name, config := range configs { t.Run(name, func(t *testing.T) { peerConnection, err := webrtc.NewPeerConnection(config) if err != nil { t.Fatal(err) } md := mediadevices.NewMediaDevices(peerConnection) s, err := md.GetUserMedia(mediadevices.MediaStreamConstraints{ Video: func(c *mediadevices.MediaTrackConstraints) { c.CodecName = videoCodecName c.FrameFormat = frame.FormatI420 c.Enabled = true c.Width = 640 c.Height = 480 }, }) if err != nil { t.Fatal(err) } trackers := s.GetTracks() if len(trackers) != 1 { t.Fatal("wrong number of the tracks") } peerConnection.AddTrack(trackers[0].Track()) trackers[0].OnEnded(func(err error) { t.Error(err) }) time.Sleep(10 * time.Second) trackers[0].OnEnded(func(err error) {}) peerConnection.Close() trackers[0].Stop() time.Sleep(time.Second) }) } }
with treating camera read timeout as error:
diff --git a/pkg/driver/camera/camera_linux.go b/pkg/driver/camera/camera_linux.go index cee43b2..f7202f8 100644 --- a/pkg/driver/camera/camera_linux.go +++ b/pkg/driver/camera/camera_linux.go @@ -4,6 +4,7 @@ package camera import "C" import ( + "errors" "image" "io" @@ -97,6 +98,7 @@ func (c *camera) VideoRecord(p prop.Media) (video.Reader, error) { switch err.(type) { case nil: case *webcam.Timeout: + return nil, errors.New("read timeout") continue default: // Camera has been stopped.
It fails with stun server only on go1.14rc1.
$ go1.14rc1 test . -v === RUN TestMain === RUN TestMain/WithSTUN TestMain/WithSTUN: main_test.go:51: read timeout === RUN TestMain/WithoutSTUN --- FAIL: TestMain (32.97s) --- FAIL: TestMain/WithSTUN (21.91s) --- PASS: TestMain/WithoutSTUN (11.06s) FAIL FAIL github.com/pion/mediadevices/examples/simple 32.986s FAIL $ go1.13 test . -v === RUN TestMain === RUN TestMain/WithSTUN === RUN TestMain/WithoutSTUN --- PASS: TestMain (27.74s) --- PASS: TestMain/WithSTUN (16.67s) --- PASS: TestMain/WithoutSTUN (11.07s) PASS ok github.com/pion/mediadevices/examples/simple 27.756s
I will check it again once next RC of Go1.14 gets available.
The text was updated successfully, but these errors were encountered:
After trying a while, I get that the failure also accures without stun server setting, but the frequency is much lower.
Sorry, something went wrong.
Looks being fixed on release Go1.14.
No branches or pull requests
It's not a problem for now, but I would like to leave a note.
Following test just checks
OnEnded
callback.with treating camera read timeout as error:
It fails with stun server only on go1.14rc1.
I will check it again once next RC of Go1.14 gets available.
The text was updated successfully, but these errors were encountered: