Skip to content

frontend: Auto-discovery of registered services - #12911

Open
emilsas wants to merge 2 commits into
obsproject:masterfrom
emilsas:feature/service-discovery
Open

frontend: Auto-discovery of registered services#12911
emilsas wants to merge 2 commits into
obsproject:masterfrom
emilsas:feature/service-discovery

Conversation

@emilsas

@emilsas emilsas commented Dec 11, 2025

Copy link
Copy Markdown

Description

This PR refactors LoadServices in OBSBasicSettings_Stream.cpp to dynamically discover and populate the stream services dropdown.

Instead of hardcoding check for specific service types (like the existing WHIP check), the code now:

  1. Iterates through all registered service types using obs_enum_service_types.
  2. Checks if the service type has a corresponding registered output protocol.
  3. Automatically adds valid services to the dropdown.

To support this cleaner logic, a ServiceItemData struct (registered with Q_DECLARE_METATYPE) was introduced to replace the mixed usage of ListOpt enums and strings in the dropdown's QVariant data. This unifies how service metadata (type, ID, display name) is stored and retrieved.

Motivation and Context

Currently, plugins that introduce new service types (e.g., a new streaming protocol) do not automatically appear in the Stream Settings service dropdown. Developers typically have to modify the core OBSBasicSettings_Stream.cpp file to hardcode their service into the list.

This change allows any plugin to register a service and have it automatically discovered and listed in the UI, provided the underlying output protocol is registered. This decouples the frontend UI from specific service implementations and significantly improves extensibility for protocol plugins.

How Has This Been Tested?

Tested on macOS.

  • Verified that standard RTMP services (Twitch, YouTube, etc.) load and work effectively as before.
  • Verified that the "Custom..." option functions correctly.
  • Verified that "Show All" correctly expands the list.
  • Verified that a custom plugin registering a new service type (and protocol) automatically appears in the list without further code changes.
  • Checked that saving and loading settings persists the correct service type.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Tweak (non-breaking change to improve existing functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to documentation pages)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added kind/feature Functionality or other elements that the project doesn't currently have. area/ui-ux Anything to do with changes or additions to UI/UX elements. labels Dec 13, 2025
@ghostnumber7

Copy link
Copy Markdown

I tested on Windows 11 and it's working fine.

image image

Comment thread frontend/settings/OBSBasicSettings.hpp Outdated
Comment thread frontend/settings/OBSBasicSettings_Stream.cpp Outdated
Comment thread frontend/settings/OBSBasicSettings_Stream.cpp Outdated
Comment thread frontend/settings/OBSBasicSettings_Stream.cpp Outdated
@emilsas

emilsas commented Apr 20, 2026

Copy link
Copy Markdown
Author

Hey @derrod @WizardCM !
Do you have any update on this? Some ETA to be merged?

Thanks!

kixelated added a commit to moq-dev/obs that referenced this pull request Jun 18, 2026
* Add Qt dock UI for MoQ streaming

OBS's stable Settings -> Stream UI does not surface third-party services
(pending obsproject/obs-studio#12911), so the registered MoQ service/output
are invisible in the UI. Add a dockable panel that drives the MoQ output
directly instead, working on stable OBS today.

The dock (moq-dock.cpp/h, registered via obs_frontend_add_dock_by_id) lets
the user enter a relay URL and broadcast path and start/stop streaming. It
creates its own service/output and reuses the encoders configured in OBS's
Output settings (both Simple and Advanced modes), so no encoder options are
exposed in the dock. Settings persist via obs_module_config_path, and a live
statistics panel shows status, duration, bitrate, data sent, dropped frames,
and connect time. The bundled libmoq version is shown from MOQ_VERSION.

Enable ENABLE_FRONTEND_API and ENABLE_QT (gated so the dock only builds when
both are on, via MOQ_FRONTEND_ENABLED). Add a build-time workaround for the
AGL framework: recent macOS SDKs ship no linkable AGL binary (it exists only
in the runtime dyld shared cache), but the obs-deps Qt6 build references it
transitively via WrapOpenGL; generate a stub whose install name points at the
real framework so the link succeeds and dyld resolves AGL at load.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Apply clang-format and gersemi formatting

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Fix audio mixer index and preserve stop error message

- Use the configured TrackIndex (1-based) as the libobs audio mixer index
  (0-based) instead of hardcoding mixer 0, so Advanced mode with Track 2+
  publishes the correct audio track.
- Set the stop failure message after StopStream() resets status to Idle, so
  the failure reason is actually shown.

Addresses CodeRabbit review feedback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to Ready For Review in 33.0 Release Tracker Jul 6, 2026
@Warchamp7 Warchamp7 added this to the OBS Studio 33.0 milestone Jul 6, 2026
@emilsas
emilsas force-pushed the feature/service-discovery branch from 70b50de to 331daba Compare July 30, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux Anything to do with changes or additions to UI/UX elements. kind/feature Functionality or other elements that the project doesn't currently have.

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

5 participants