En esta página

Qt Multimedia en Windows

Esta página trata sobre las consideraciones para utilizar Qt Multimedia en Windows.

Notas sobre COM

Qt Multimedia utiliza las API COM de la plataforma Windows. Esto requiere que COM se inicialice en los subprocesos que acceden a las API de Qt Multimedia. Aunque las API de Qt Multimedia inicializarán automáticamente COM según sea necesario, recomendamos inicializar la instancia de QGuiApplication desde el hilo principal durante el inicio de la aplicación antes de realizar cualquier llamada a las API de Qt Multimedia. Esto garantiza que el apartamento principal de un solo hilo (STA principal) se inicialice antes de que las API Qt Multimedia se llamen desde cualquier hilo. Esto también garantiza que el STA principal no se desinicialice hasta que todos los demás departamentos se hayan apagado.

Qt Multimedia Las APIs que requieren COM inicializarán el hilo como un apartamento de un solo hilo llamando a CoInitializeEx(nullptr, COINIT_APARTMENT_THREADED), y CoUninitialize no será llamado hasta que el hilo salga. Esto se aplica también al subproceso principal de la aplicación, donde se llama a CoUninitialize durante la destrucción de variables estáticas.

© 2026 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.