Skip to content

Add Qt6 multimedia backend plugin (Qt 6.4+)#7

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/support-qt6-multimedia-framework
Draft

Add Qt6 multimedia backend plugin (Qt 6.4+)#7
Copilot wants to merge 3 commits into
masterfrom
copilot/support-qt6-multimedia-framework

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 28, 2026

Qt 6.4 introduced a new QPlatformMediaPlugin / QPlatformMediaIntegration API for custom multimedia backends, replacing the Qt5 QMediaServiceProviderPlugin model. This PR wires MDK into that new framework while keeping the Qt5 path intact.

New Qt6 plugin layer (qt6/)

  • mdkplatformmediapluginQPlatformMediaPlugin entry point; responds to key "mdk" via Q_PLUGIN_METADATA(IID QPlatformMediaPlugin_iid)
  • mdkmediaintegrationQPlatformMediaIntegration factory; creates the player and a default QPlatformVideoSink
  • mdkplayercontrolQPlatformMediaPlayer implementation wrapping MDK's Player; all MDK callbacks dispatch to the main thread via QMetaObject::invokeMethod

Video output

Two paths, tried in order:

  1. Host-copy (MDK_ABI): player_.renderVideo()getVideoFrame() → plane-by-plane memcpy into a QVideoFrameQVideoSink::setVideoFrame(). Zero GL overhead for software-decoded content.
  2. FBO readback (hardware / non-MDK_ABI): render into a dedicated QOffscreenSurface + QOpenGLContext, read back via QOpenGLFramebufferObject::toImage(), push as QVideoFrameFormat::Format_RGBA8888.

Build system

  • .qmake.conf and mdkmediaservice.pro conditionally select PLUGIN_TYPE=multimedia / sources for Qt6, mediaservice / original sources for Qt5.
  • Qt6 plugin installs to <Qt>/plugins/multimedia/; Qt5 unchanged at <Qt>/plugins/mediaservice/.
  • QT += multimedia-private opengl added for Qt6 builds.

Plugin metadata

mdkmediaservice.json key renamed "mdkservice""mdk" (required for Qt6 discovery; Qt5 uses the "Services" field and is unaffected by the key name). Existing users relying on QT_MULTIMEDIA_PREFERRED_PLUGINS=mdkservice will need to update to mdk.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Support Qt6 multimedia framework and custom plugins Add Qt6 multimedia backend plugin (Qt 6.4+) Mar 28, 2026
Copilot AI requested a review from wang-bin March 28, 2026 05:51
Copy link
Copy Markdown
Owner

@wang-bin wang-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • before qt6.10, QPlatformMediaIntegration::createSome() returns QMaybe<QPlatformSome*>, since qt6.10 returns q23::expected<QPlatformSome*,QString/*error*/>

Copy link
Copy Markdown
Owner

@wang-bin wang-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before qt6.10, QPlatformMediaIntegration::createSome() returns QMaybe<QPlatformSome*>, since qt6.10 returns q23::expected<QPlatformSome*,QString/error/>

Copy link
Copy Markdown
Author

Copilot AI commented May 19, 2026

before qt6.10, QPlatformMediaIntegration::createSome() returns QMaybe<QPlatformSome*>, since qt6.10 returns q23::expected<QPlatformSome*,QString/error/>

Updated MDKMediaIntegration to use QMaybe on Qt 6.4–6.9 and q23::expected on Qt 6.10+, committed in 7db0a1d.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • duckduckgo.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from wang-bin May 19, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants