some fix
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/pion/mediadevices/pkg/codec/opus"
|
||||
"github.com/pion/mediadevices/pkg/codec/x264"
|
||||
"github.com/pion/mediadevices/pkg/driver"
|
||||
"github.com/pion/mediadevices/pkg/prop"
|
||||
"github.com/pion/webrtc/v3"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -24,7 +23,7 @@ func New(o *Options) (*Connection, error) {
|
||||
connection := &Connection{
|
||||
option: o,
|
||||
}
|
||||
codecSelector, err := setupCodec(o.Video.BPS)
|
||||
codecSelector, err := setupCodec(o.VideoBPS)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -45,10 +44,7 @@ func New(o *Options) (*Connection, error) {
|
||||
}
|
||||
|
||||
s, err := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{
|
||||
Video: func(mtc *mediadevices.MediaTrackConstraints) {
|
||||
mtc.Height = prop.Int(o.Video.Height)
|
||||
mtc.Width = prop.Int(o.Video.Width)
|
||||
},
|
||||
Video: func(mtc *mediadevices.MediaTrackConstraints) {},
|
||||
Audio: func(mtc *mediadevices.MediaTrackConstraints) {},
|
||||
Codec: codecSelector,
|
||||
})
|
||||
|
@@ -2,11 +2,7 @@ package webrtcconnection
|
||||
|
||||
type Options struct {
|
||||
STUNServers []string `yaml:"stun_servers"`
|
||||
Video struct {
|
||||
Height int `yaml:"height"`
|
||||
Width int `yaml:"width"`
|
||||
BPS int `yaml:"bps"`
|
||||
} `yaml:"video"`
|
||||
VideoBPS int `yaml:"video_bps"`
|
||||
}
|
||||
|
||||
func ExampleOptions() *Options {
|
||||
@@ -15,9 +11,7 @@ func ExampleOptions() *Options {
|
||||
"stun:stun.l.google.com:19302",
|
||||
"stun:wetofu.me:3478",
|
||||
},
|
||||
VideoBPS: 500_000,
|
||||
}
|
||||
options.Video.BPS = 500_000
|
||||
options.Video.Height = 768
|
||||
options.Video.Width = 1024
|
||||
return options
|
||||
}
|
||||
|
Reference in New Issue
Block a user