Qt Multimedia Windows에서
이 페이지에서는 Windows에서 Qt Multimedia 사용 시 고려 사항에 대해 설명합니다.
COM에 대한 참고 사항
Qt Multimedia 은 Windows 플랫폼의 COM API를 사용합니다. 따라서 Qt Multimedia API에 액세스하는 스레드에서 COM을 초기화해야 합니다. Qt Multimedia API는 필요에 따라 COM을 자동으로 초기화하지만, 애플리케이션을 시작하는 동안 메인 스레드에서 QGuiApplication 인스턴스를 초기화한 후 Qt Multimedia API를 호출하는 것이 좋습니다. 이렇게 하면 모든 스레드에서 Qt Multimedia API를 호출하기 전에 메인 싱글 스레드 아파트(메인 STA)가 초기화됩니다. 또한 다른 모든 아파트가 종료될 때까지 메인 STA가 초기화되지 않도록 보장합니다.
Qt Multimedia COM이 필요한 API는 CoInitializeEx(nullptr, COINIT_APARTMENT_THREADED)
을 호출하여 스레드를 단일 스레드 아파트로 초기화하며, CoUninitialize
은 스레드가 종료될 때까지 호출되지 않습니다. 이는 정적 변수가 파괴되는 동안 CoUninitialize
이 호출되는 메인 애플리케이션 스레드에도 적용됩니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.