diff --git a/server/dev/runtime/config.yml b/server/dev/runtime/config.yml index 1bf51b03..fe5f0b7a 100644 --- a/server/dev/runtime/config.yml +++ b/server/dev/runtime/config.yml @@ -1,8 +1,27 @@ capture: video: codec: vp8 + # legacy format is not added to the list of ids so that its ignored by bandwidth estimator ids: [ hq, lq ] 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: fps: 25 gst_encoder: vp8enc diff --git a/server/internal/capture/manager.go b/server/internal/capture/manager.go index d7c78db4..511c55c4 100644 --- a/server/internal/capture/manager.go +++ b/server/internal/capture/manager.go @@ -49,8 +49,8 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt } return fmt.Sprintf( - "ximagesrc display-name=%s show-pointer=false use-damage=false "+ - "%s ! appsink name=appsink", config.Display, pipeline, + "ximagesrc display-name=%s show-pointer=%v use-damage=false "+ + "%s ! appsink name=appsink", config.Display, pipelineConf.ShowPointer, pipeline, ), nil } diff --git a/server/internal/config/capture.go b/server/internal/config/capture.go index 591279f3..0153ba37 100644 --- a/server/internal/config/capture.go +++ b/server/internal/config/capture.go @@ -359,9 +359,17 @@ func (s *Capture) Set() { "min-quantizer": "4", "max-quantizer": "20", }, + ShowPointer: viper.GetBool("legacy"), }, } 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 @@ -463,7 +471,13 @@ func (s *Capture) SetV2() { "main": { 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 } } diff --git a/server/internal/http/legacy/wstobackend.go b/server/internal/http/legacy/wstobackend.go index e0d87db3..8147c7c3 100644 --- a/server/internal/http/legacy/wstobackend.go +++ b/server/internal/http/legacy/wstobackend.go @@ -60,6 +60,18 @@ func (s *session) wsToBackend(msg []byte) error { 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{ SDP: request.SDP, }) diff --git a/server/pkg/types/capture.go b/server/pkg/types/capture.go index c2f21070..3390b239 100644 --- a/server/pkg/types/capture.go +++ b/server/pkg/types/capture.go @@ -158,6 +158,7 @@ type VideoConfig struct { GstParams map[string]string `mapstructure:"gst_params"` // map of expressions GstSuffix string `mapstructure:"gst_suffix"` // pipeline suffix, starts with ! 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) {