mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-03 03:12:41 +02:00
add legacy simulcast stream that shows pointer.
This commit is contained in:
parent
b3b31fba1f
commit
373e9970f9
5 changed files with 48 additions and 2 deletions
|
@ -1,8 +1,27 @@
|
||||||
capture:
|
capture:
|
||||||
video:
|
video:
|
||||||
codec: vp8
|
codec: vp8
|
||||||
|
# legacy format is not added to the list of ids so that its ignored by bandwidth estimator
|
||||||
ids: [ hq, lq ]
|
ids: [ hq, lq ]
|
||||||
pipelines:
|
pipelines:
|
||||||
|
# legacy format is the same as hq, but with show_pointer enabled
|
||||||
|
legacy:
|
||||||
|
fps: 25
|
||||||
|
gst_encoder: vp8enc
|
||||||
|
gst_params:
|
||||||
|
target-bitrate: round(3072 * 650)
|
||||||
|
cpu-used: 4
|
||||||
|
end-usage: cbr
|
||||||
|
threads: 4
|
||||||
|
deadline: 1
|
||||||
|
undershoot: 95
|
||||||
|
buffer-size: (3072 * 4)
|
||||||
|
buffer-initial-size: (3072 * 2)
|
||||||
|
buffer-optimal-size: (3072 * 3)
|
||||||
|
keyframe-max-dist: 25
|
||||||
|
min-quantizer: 4
|
||||||
|
max-quantizer: 20
|
||||||
|
show_pointer: true
|
||||||
hq:
|
hq:
|
||||||
fps: 25
|
fps: 25
|
||||||
gst_encoder: vp8enc
|
gst_encoder: vp8enc
|
||||||
|
|
|
@ -49,8 +49,8 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf(
|
return fmt.Sprintf(
|
||||||
"ximagesrc display-name=%s show-pointer=false use-damage=false "+
|
"ximagesrc display-name=%s show-pointer=%v use-damage=false "+
|
||||||
"%s ! appsink name=appsink", config.Display, pipeline,
|
"%s ! appsink name=appsink", config.Display, pipelineConf.ShowPointer, pipeline,
|
||||||
), nil
|
), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,9 +359,17 @@ func (s *Capture) Set() {
|
||||||
"min-quantizer": "4",
|
"min-quantizer": "4",
|
||||||
"max-quantizer": "20",
|
"max-quantizer": "20",
|
||||||
},
|
},
|
||||||
|
ShowPointer: viper.GetBool("legacy"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
s.VideoIDs = []string{"main"}
|
s.VideoIDs = []string{"main"}
|
||||||
|
|
||||||
|
if viper.GetBool("legacy") {
|
||||||
|
legacyPipeline := s.VideoPipelines["main"]
|
||||||
|
legacyPipeline.ShowPointer = true
|
||||||
|
s.VideoPipelines["legacy"] = legacyPipeline
|
||||||
|
// we do not add legacy to VideoIDs so that its ignored by bandwidth estimator
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// audio
|
// audio
|
||||||
|
@ -463,7 +471,13 @@ func (s *Capture) SetV2() {
|
||||||
"main": {
|
"main": {
|
||||||
GstPipeline: pipeline,
|
GstPipeline: pipeline,
|
||||||
},
|
},
|
||||||
|
"legacy": {
|
||||||
|
GstPipeline: pipeline,
|
||||||
|
ShowPointer: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
// we do not add legacy to VideoIDs so that its ignored by bandwidth estimator
|
||||||
|
s.VideoIDs = []string{"main"}
|
||||||
// TODO: add deprecated warning and proper alternative
|
// TODO: add deprecated warning and proper alternative
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,18 @@ func (s *session) wsToBackend(msg []byte) error {
|
||||||
s.name = request.DisplayName
|
s.name = request.DisplayName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try to set legacy video stream, if it fails, it will be ignored
|
||||||
|
if err := s.toBackend(event.SIGNAL_VIDEO, &message.SignalVideo{
|
||||||
|
PeerVideoRequest: types.PeerVideoRequest{
|
||||||
|
Selector: &types.StreamSelector{
|
||||||
|
Type: types.StreamSelectorTypeExact,
|
||||||
|
ID: "legacy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return s.toBackend(event.SIGNAL_ANSWER, &message.SignalDescription{
|
return s.toBackend(event.SIGNAL_ANSWER, &message.SignalDescription{
|
||||||
SDP: request.SDP,
|
SDP: request.SDP,
|
||||||
})
|
})
|
||||||
|
|
|
@ -158,6 +158,7 @@ type VideoConfig struct {
|
||||||
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
|
||||||
|
ShowPointer bool `mapstructure:"show_pointer"` // show pointer in the video
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config *VideoConfig) GetPipeline(screen ScreenSize) (string, error) {
|
func (config *VideoConfig) GetPipeline(screen ScreenSize) (string, error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue