Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b1791af759fa494bf45a37a256c562721577207c
      
https://github.com/WebKit/WebKit/commit/b1791af759fa494bf45a37a256c562721577207c
  Author: Xabier Rodriguez-Calvar <[email protected]>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
    M Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.h
    M Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
    M Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
    M Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.h
    M Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp
    M Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.h
    M 
Source/WebCore/platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp
    M 
Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp

  Log Message:
  -----------
  [GStreamer][MediaStream] setSinkId breaks WEBKIT_GST_ENABLE_AUDIO_MIXER=1
https://bugs.webkit.org/show_bug.cgi?id=308311

Reviewed by Philippe Normand.

GStreamerAudioMixer now manages one mixer pipeline per output device
(keyed by device ID) instead of a single shared pipeline. When the last
producer leaves a pipeline, teardown is deferred via a timer (default
60 s, configurable via GSTREAMER_AUDIO_MIXER_TEARDOWN_TIMEOUT) so that
rapid device switches do not destroy and recreate the pipeline
unnecessarily.

WebKitAudioSink stores the target device ID and GstDevice, passes them
to GStreamerAudioMixer::registerProducer(), and supports runtime device
switching through the new webkitAudioSinkSetDevice() helper, which
moves the producer from the old pipeline to the new one and brings the
new pipeline to the current element state.

createPlatformAudioSink() and applyAudioSinkDevice() are extended with
optional deviceId/GstDevice parameters. applyAudioSinkDevice() now
handles WebKitAudioSink directly by delegating to
webkitAudioSinkSetDevice(). A resolveAudioOutputDevice() helper is
extracted from createAudioSink() and audioOutputDeviceChanged() to
deduplicate device-ID resolution logic.

Fly-by fixes:
* Guard against a null roleImpl in the createAutoAudioSink()
GClosure notify callback
* Sanitize slashes in filenames passed to
dumpBinToDotFile() to avoid failures during pipeline dumping.
* Fix pre-existing race condition between GStreamerCapturer::setDevice() and
mock source render threads that surfaced now

* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
(WebCore::GStreamerAudioMixer::GStreamerAudioMixer):
(WebCore::GStreamerAudioMixer::ensureMixerPipeline):
(WebCore::GStreamerAudioMixer::teardownPipeline):
(WebCore::GStreamerAudioMixer::ensureState):
(WebCore::GStreamerAudioMixer::registerProducer):
(WebCore::GStreamerAudioMixer::unregisterProducer):
(WebCore::GStreamerAudioMixer::configureSourcePeriodTime):
* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.h:
(WebCore::GStreamerAudioMixer::ensureState):
(WebCore::GStreamerAudioMixer::registerProducer):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createAutoAudioSink):
(WebCore::createPlatformAudioSink):
(WebCore::dumpBinToDotFile):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::createPlatformAudioSink):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::resolveAudioOutputDevice):
(WebCore::MediaPlayerPrivateGStreamer::applyAudioSinkDevice):
(WebCore::MediaPlayerPrivateGStreamer::audioOutputDeviceChanged):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkChangeState):
(webkitAudioSinkNew):
(webkitAudioSinkSetDevice):
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.h:
(webkitAudioSinkNew):
(webkitAudioSinkSetDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::tearDown):
(WebCore::GStreamerCapturer::createSource): Deleted.
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.h:
(WebCore::GStreamerCapturer::source):
* 
Source/WebCore/platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
(WebCore::MockRealtimeAudioSourceGStreamer::render):
* 
Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
(WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer):

Canonical link: https://commits.webkit.org/308537@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to