feat: create capture subscription api to support more transports (#699)

* feat: introduce encoded media subscriptions

* chore: preserve sample field comments

* perf: reduce encoded sample dispatch copies

* docs: define encoded sample buffer ownership

* fix: avoid pipeline recreation errors

Reuse pipelines started by a new subscription during resize.

* fix: synchronize stream bitrate state

Protect bitrate updates, reads, and resets with one mutex.

* simplify

* group stream sink fields

* fix: remove unnecessary blank line in removeSubscription method

* remove defensive check

* remove noop

---------

Co-authored-by: Miroslav Šedivý <sedivy.miro@gmail.com>
This commit is contained in:
a
2026-09-24 03:58:39 -05:00
committed by GitHub
parent 6bc8350213
commit f4d632df2c
10 changed files with 505 additions and 175 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ type CaptureManagerCtx struct {
func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCtx {
logger := log.With().Str("module", "capture").Logger()
videos := map[string]types.StreamSinkManager{}
videos := map[string]*StreamSinkManagerCtx{}
for video_id, cnf := range config.VideoPipelines {
pipelineConf := cnf
@@ -257,11 +257,11 @@ func (manager *CaptureManagerCtx) Screencast() types.ScreencastManager {
return manager.screencast
}
func (manager *CaptureManagerCtx) Audio() types.StreamSinkManager {
func (manager *CaptureManagerCtx) Audio() types.EncodedStream {
return manager.audio
}
func (manager *CaptureManagerCtx) Video() types.StreamSelectorManager {
func (manager *CaptureManagerCtx) Video() types.EncodedStreamSelector {
return manager.video
}