表现
送入 yuv 数据进入 videooutput,无视频渲染
原因
系统环境变量存在 QMLSCENE_DEVICE=softwarecontext
VideoOutput 不能使用 qt 的软渲染即 Qt Quick Software Adaptation
Switch Scene Graph Adaptations
Switching to a different adaptation can be achieved in two ways:
- Use an environment variable - Set the
QT_QUICK_BACKEND
or the legacy QMLSCENE_DEVICE
environment variable before launching applications.
- Use a C++ API - Call QQuickWindow::setSceneGraphBackend() early on in the application’s main() function.
Scene Graph Adaptations
文档中提到,qt提供的软件渲染方案不支持渲染videooutput
Qt Multimedia VideoOutput
The Qt Multimedia module’s VideoOutput item is not supported with the Software adaptation. This is because VideoOutput uses the QVideoRendererControl item which requires custom QSGGeometryNode behavior, which is only present in the default OpenGL adaptation.