- Qt 6.12
- Qt Multimedia
- Qt Multimedia on Windows
- Qt 6.12.0 Reference Documentation

Platform Notes - WebAssembly ◦ Platform Notes - Linux

# Qt Multimedia on Windows

This page discusses considerations for using Qt Multimedia on Windows.

## Notes on COM

Qt Multimedia uses COM APIs from the Windows platform. This requires COM to be initialized on the threads that access Qt Multimedia APIs. Although Qt Multimedia APIs will automatically initialize COM as needed, we recommend initializing the QGuiApplication instance from the main thread during application startup before making any calls to Qt Multimedia APIs. This ensures that the main single threaded apartment (main STA) is initialized before Qt Multimedia APIs are called from any thread. This also guarantees that the main STA is not uninitialized until all other apartments have shut down.

Qt Multimedia APIs that require COM will initialize the thread as a single-threaded apartment by calling `CoInitializeEx(nullptr, COINIT_APARTMENT_THREADED)`, and `CoUninitialize` will not be called until the thread exits. This applies to the main application thread as well, where `CoUninitialize` is called during the destruction of static variables.

Platform Notes - WebAssembly ◦ Platform Notes - Linux