[webkit-changes] [WebKit/WebKit] e1b943: [GStreamer] Plumb audio sink ID support in MediaPl...

Adrian Perez noreply at github.com
Tue Feb 4 06:21:17 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e1b943ce81dccf779ae6fa4c848d9e1d718b2d7c
      https://github.com/WebKit/WebKit/commit/e1b943ce81dccf779ae6fa4c848d9e1d718b2d7c
  Author: Adrian Perez de Castro <aperez at igalia.com>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    M Source/WTF/wtf/glib/GSpanExtras.h
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
    M Source/WebCore/platform/mediastream/CaptureDevice.h
    M Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp
    M Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp
    M Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h

  Log Message:
  -----------
  [GStreamer] Plumb audio sink ID support in MediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=216880

Reviewed by Philippe Normand.

Plumb speaker selection into the GStreamer media playback, both to allow
output/speaker device enumeration, and to choose audio stream destinations
per media element via HTMLMEdiaElement.setSinkId().

Based on a patch initially by Philippe Normand.

* Source/WTF/wtf/glib/GSpanExtras.h:
(WTF::adoptGMallocString): Add helper to adopt heap-allocated C strings
into a GMallocSpan helper.
* Source/WebCore/Modules/mediastream/UserMediaController.cpp:
(WebCore::UserMediaController::voiceActivityDetected): Add missing
ENABLE(MEDIA_SESSION) guard to fix the build when MediaSession is
disabled but MediaStream is enabled.
* Source/WebCore/platform/mediastream/CaptureDevice.h: Make DeviceType a
bit flags enum, to allow usage with OptionSet.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::applyAudioSinkDevice): Added. Helper function to traverse the
audio sink bin recursively to find the actual sinks and change the
device they use as their output.
(WebCore::MediaPlayerPrivateGStreamer::audioOutputDeviceChanged): Added.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSourceFactory::speakerDevices const): Changed
to delegate the responsibility of enumerating speaker devices to
GStreamerCaptureDeviceManager.
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::speakerDevices): Added.
(WebCore::GStreamerCaptureDeviceManager::addDevice): Gather speaker
devices and store them separately, to allow returning them from
the ::speakerDevices() function.
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): Handle
multiple devices types at once, and add a GstDeviceMonitor filter to
obtain audio output devices from the monitor.
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
Make GStreamerCaptureDeviceManager::deviceTypes() return an OptionSet.

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



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


More information about the webkit-changes mailing list