mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fmt edit.
This commit is contained in:
parent
d84297fbec
commit
d37933cc37
@ -140,15 +140,15 @@ func (s *Capture) Set() {
|
|||||||
// default video
|
// default video
|
||||||
if len(s.VideoPipelines) == 0 {
|
if len(s.VideoPipelines) == 0 {
|
||||||
log.Warn().Msgf("no video pipelines specified, using defaults")
|
log.Warn().Msgf("no video pipelines specified, using defaults")
|
||||||
|
|
||||||
s.VideoCodec = codec.VP8()
|
s.VideoCodec = codec.VP8()
|
||||||
s.VideoPipelines = map[string]types.VideoConfig{
|
s.VideoPipelines = map[string]types.VideoConfig{
|
||||||
"main": types.VideoConfig{
|
"main": types.VideoConfig{
|
||||||
GstPipeline: "ximagesrc display-name={display} show-pointer=false use-damage=false "+
|
GstPipeline: "ximagesrc display-name={display} show-pointer=false use-damage=false " +
|
||||||
"! video/x-raw "+
|
"! video/x-raw " +
|
||||||
"! videoconvert "+
|
"! videoconvert " +
|
||||||
"! queue "+
|
"! queue " +
|
||||||
"! vp8enc end-usage=cbr cpu-used=4 threads=4 deadline=1 keyframe-max-dist=25 "+
|
"! vp8enc end-usage=cbr cpu-used=4 threads=4 deadline=1 keyframe-max-dist=25 " +
|
||||||
"! appsink name=appsink",
|
"! appsink name=appsink",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"strings"
|
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/pion/webrtc/v3/pkg/media"
|
|
||||||
"github.com/PaesslerAG/gval"
|
"github.com/PaesslerAG/gval"
|
||||||
|
"github.com/pion/webrtc/v3/pkg/media"
|
||||||
|
|
||||||
"demodesk/neko/internal/types/codec"
|
"demodesk/neko/internal/types/codec"
|
||||||
)
|
)
|
||||||
@ -55,7 +55,7 @@ type VideoConfig struct {
|
|||||||
Height string `mapstructure:"height"` // expression
|
Height string `mapstructure:"height"` // expression
|
||||||
Fps string `mapstructure:"fps"` // expression
|
Fps string `mapstructure:"fps"` // expression
|
||||||
GstPrefix string `mapstructure:"gst_prefix"` // pipeline prefix, starts with !
|
GstPrefix string `mapstructure:"gst_prefix"` // pipeline prefix, starts with !
|
||||||
GstEncoder string `mapstructure:"gst_encoder"`
|
GstEncoder string `mapstructure:"gst_encoder"` // gst encoder name
|
||||||
GstParams map[string]string `mapstructure:"gst_params"` // map of expressions
|
GstParams map[string]string `mapstructure:"gst_params"` // map of expressions
|
||||||
GstSuffix string `mapstructure:"gst_suffix"` // pipeline suffix, starts with !
|
GstSuffix string `mapstructure:"gst_suffix"` // pipeline suffix, starts with !
|
||||||
GstPipeline string `mapstructure:"gst_pipeline"` // whole pipeline as a string
|
GstPipeline string `mapstructure:"gst_pipeline"` // whole pipeline as a string
|
||||||
@ -142,5 +142,5 @@ func (config *VideoConfig) GetPipeline(screen ScreenSize) (string, error) {
|
|||||||
config.GstPrefix,
|
config.GstPrefix,
|
||||||
encPipeline,
|
encPipeline,
|
||||||
config.GstSuffix,
|
config.GstSuffix,
|
||||||
}[:]," "), nil
|
}[:], " "), nil
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ type Session interface {
|
|||||||
// websocket
|
// websocket
|
||||||
SetWebSocketPeer(websocketPeer WebSocketPeer)
|
SetWebSocketPeer(websocketPeer WebSocketPeer)
|
||||||
SetWebSocketConnected(websocketPeer WebSocketPeer, connected bool)
|
SetWebSocketConnected(websocketPeer WebSocketPeer, connected bool)
|
||||||
GetWebSocketPeer() WebSocketPeer
|
GetWebSocketPeer() WebSocketPeer
|
||||||
Send(v interface{}) error
|
Send(v interface{}) error
|
||||||
|
|
||||||
// webrtc
|
// webrtc
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
|
||||||
"demodesk/neko/internal/utils"
|
|
||||||
"demodesk/neko/internal/types"
|
"demodesk/neko/internal/types"
|
||||||
"demodesk/neko/internal/types/event"
|
"demodesk/neko/internal/types/event"
|
||||||
"demodesk/neko/internal/types/message"
|
"demodesk/neko/internal/types/message"
|
||||||
|
"demodesk/neko/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebSocketPeerCtx struct {
|
type WebSocketPeerCtx struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user