diff options
-rw-r--r-- | src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm index 2ea84758b..3b780e3d5 100644 --- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm +++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm @@ -84,18 +84,22 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name) if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) return m_playerMetaDataControl; - if (!m_videoOutput) { - if (qstrcmp(name, QVideoRendererControl_iid) == 0) + if (qstrcmp(name, QVideoRendererControl_iid) == 0) { + if (!m_videoOutput) m_videoOutput = new AVFVideoRendererControl(this); + + m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput)); + return m_videoOutput; + } #ifndef QT_NO_WIDGETS - if (qstrcmp(name, QVideoWidgetControl_iid) == 0) + if (qstrcmp(name, QVideoWidgetControl_iid) == 0) { + if (!m_videoOutput) m_videoOutput = new AVFVideoWidgetControl(this); -#endif - } - if (m_videoOutput) { + m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput)); return m_videoOutput; } +#endif return 0; } |