feat: selectable audio source
Add an audio source picker to the GUI so users can capture a specific PipeWire device (sink monitor or microphone) instead of only the system default output. - vendor go2tv.app/screencast and patch the audio stream to accept a target PipeWire node serial (PW_KEY_TARGET_OBJECT); the upstream lib only ever auto-connected to the default - capture: ListAudioSources enumerates PipeWire sinks/sources via pw-dump; OpenPipeWire takes the selected node serial - flinger/config/gui: AudioSource config field, persisted and exposed as an Audio source dropdown (default output + enumerated devices) Also fixes two pre-existing bugs surfaced by stop/start testing: - engine Stop now waits for the video/audio/stats goroutines before destroying the encoder (was a use-after-free SIGSEGV) - Start/Stop now pause/resume the engine instead of tearing down and re-opening the portal session, which the portal cannot reliably do in-process (2nd CreateSession returned Ended/cancelled). Capture session stays open across stop/start.
This commit is contained in:
@@ -22,6 +22,7 @@ type Config struct {
|
||||
FPS int `json:"fps"`
|
||||
Source string `json:"source"`
|
||||
Audio bool `json:"audio"`
|
||||
AudioSource uint64 `json:"audio_source"`
|
||||
StreamIndex int `json:"stream_index"`
|
||||
Scale float64 `json:"scale"`
|
||||
// Announce is a *bool so an absent JSON key (older config files) keeps
|
||||
@@ -40,6 +41,7 @@ func Default() Config {
|
||||
FPS: c.FPS,
|
||||
Source: c.Source,
|
||||
Audio: c.Audio,
|
||||
AudioSource: c.AudioSource,
|
||||
StreamIndex: c.StreamIndex,
|
||||
Scale: c.Scale,
|
||||
Announce: &announce,
|
||||
@@ -59,6 +61,7 @@ func (c Config) ToFlinger() flinger.Config {
|
||||
FPS: c.FPS,
|
||||
Source: c.Source,
|
||||
Audio: c.Audio,
|
||||
AudioSource: c.AudioSource,
|
||||
StreamIndex: c.StreamIndex,
|
||||
Scale: c.Scale,
|
||||
Announce: announce,
|
||||
|
||||
Reference in New Issue
Block a user