summaryrefslogtreecommitdiffstats
path: root/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp')
-rw-r--r--src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp
index 1258d199c..190cb8b80 100644
--- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp
+++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp
@@ -38,6 +38,8 @@
****************************************************************************/
#include "mmrenderermediaplayerservice.h"
+#include "mmrendereraudiorolecontrol.h"
+#include "mmrenderercustomaudiorolecontrol.h"
#include "mmrenderermediaplayercontrol.h"
#include "mmrenderermetadatareadercontrol.h"
#include "mmrendererplayervideorenderercontrol.h"
@@ -66,6 +68,8 @@ MmRendererMediaPlayerService::~MmRendererMediaPlayerService()
delete m_videoWindowControl;
delete m_mediaPlayerControl;
delete m_metaDataReaderControl;
+ delete m_audioRoleControl;
+ delete m_customAudioRoleControl;
}
QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name)
@@ -76,15 +80,25 @@ QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name)
updateControls();
}
return m_mediaPlayerControl;
- }
- else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
+ } else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
if (!m_metaDataReaderControl) {
m_metaDataReaderControl = new MmRendererMetaDataReaderControl();
updateControls();
}
return m_metaDataReaderControl;
- }
- else if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
+ } else if (qstrcmp(name, QAudioRoleControl_iid) == 0) {
+ if (!m_audioRoleControl) {
+ m_audioRoleControl = new MmRendererAudioRoleControl();
+ updateControls();
+ }
+ return m_audioRoleControl;
+ } else if (qstrcmp(name, QCustomAudioRoleControl_iid) == 0) {
+ if (!m_customAudioRoleControl) {
+ m_customAudioRoleControl = new MmRendererCustomAudioRoleControl();
+ updateControls();
+ }
+ return m_customAudioRoleControl;
+ } else if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
if (!m_appHasDrmPermissionChecked) {
m_appHasDrmPermission = checkForDrmPermission();
m_appHasDrmPermissionChecked = true;
@@ -102,8 +116,7 @@ QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name)
updateControls();
}
return m_videoRendererControl;
- }
- else if (qstrcmp(name, QVideoWindowControl_iid) == 0) {
+ } else if (qstrcmp(name, QVideoWindowControl_iid) == 0) {
if (!m_videoWindowControl) {
m_videoWindowControl = new MmRendererVideoWindowControl();
updateControls();
@@ -123,6 +136,10 @@ void MmRendererMediaPlayerService::releaseControl(QMediaControl *control)
m_mediaPlayerControl = 0;
if (control == m_metaDataReaderControl)
m_metaDataReaderControl = 0;
+ if (control == m_audioRoleControl)
+ m_audioRoleControl = 0;
+ if (control == m_customAudioRoleControl)
+ m_customAudioRoleControl = 0;
delete control;
}
@@ -136,6 +153,12 @@ void MmRendererMediaPlayerService::updateControls()
if (m_metaDataReaderControl && m_mediaPlayerControl)
m_mediaPlayerControl->setMetaDataReaderControl(m_metaDataReaderControl);
+
+ if (m_audioRoleControl && m_mediaPlayerControl)
+ m_mediaPlayerControl->setAudioRoleControl(m_audioRoleControl);
+
+ if (m_customAudioRoleControl && m_mediaPlayerControl)
+ m_mediaPlayerControl->setCustomAudioRoleControl(m_customAudioRoleControl);
}
QT_END_NAMESPACE