MODULE_PLUGIN_TYPES = \
mediaservice
-mac {
- LIBS += -framework AppKit -framework QuartzCore -framework QTKit
-}
win32:LIBS += -luuid
HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
TEMPLATE = subdirs
-SUBDIRS += camera \
- mediaplayer
+!ios: SUBDIRS += camera
+
+SUBDIRS += mediaplayer
#include "avfmediaplayersession.h"
#include "avfmediaplayercontrol.h"
#include "avfmediaplayermetadatacontrol.h"
-#include "avfvideooutput.h"
-#include "avfvideorenderercontrol.h"
+#if defined(Q_OS_OSX)
+# include "avfvideooutput.h"
+# include "avfvideorenderercontrol.h"
-#ifndef QT_NO_WIDGETS
-#include "avfvideowidgetcontrol.h"
+# ifndef QT_NO_WIDGETS
+# include "avfvideowidgetcontrol.h"
+# endif
#endif
QT_USE_NAMESPACE
if (qstrcmp(name, QMetaDataReaderControl_iid) == 0)
return m_playerMetaDataControl;
-
+#if defined(Q_OS_OSX)
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
+# ifndef QT_NO_WIDGETS
if (qstrcmp(name, QVideoWidgetControl_iid) == 0) {
if (!m_videoOutput)
m_videoOutput = new AVFVideoWidgetControl(this);
m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
return m_videoOutput;
}
+# endif
#endif
-
return 0;
}
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO << control;
#endif
-
+#if defined(Q_OS_OSX)
if (m_videoOutput == control) {
AVFVideoRendererControl *renderControl = qobject_cast<AVFVideoRendererControl*>(m_videoOutput);
if (renderControl)
m_session->setVideoOutput(0);
delete control;
}
+#endif
}
m_player = [AVPlayer playerWithPlayerItem:m_playerItem];
[m_player retain];
+#if defined(Q_OS_OSX)
//Set the initial volume on new player object
if (self.session)
m_player.volume = m_session->volume() / 100.0f;
+#endif
//Create a new player layer if we don't have one already
if (!m_playerLayer)
m_volume = volume;
+#if defined(Q_OS_OSX)
AVPlayer *player = [(AVFMediaPlayerSessionObserver*)m_observer player];
if (player) {
[[(AVFMediaPlayerSessionObserver*)m_observer player] setVolume:m_volume / 100.0f];
}
+#endif
Q_EMIT volumeChanged(m_volume);
}
return;
m_muted = muted;
-
+#if defined(Q_OS_OSX)
[[(AVFMediaPlayerSessionObserver*)m_observer player] setMuted:m_muted];
-
+#endif
Q_EMIT mutedChanged(muted);
}
avfmediaplayermetadatacontrol.h \
avfmediaplayerservice.h \
avfmediaplayersession.h \
- avfmediaplayerserviceplugin.h \
- avfvideorenderercontrol.h \
- avfdisplaylink.h \
- avfvideoframerenderer.h \
- avfvideooutput.h
+ avfmediaplayerserviceplugin.h
OBJECTIVE_SOURCES += \
avfmediaplayercontrol.mm \
avfmediaplayermetadatacontrol.mm \
avfmediaplayerservice.mm \
avfmediaplayerserviceplugin.mm \
- avfmediaplayersession.mm \
- avfvideorenderercontrol.mm \
- avfdisplaylink.mm \
- avfvideoframerenderer.mm \
- avfvideooutput.mm
-
-qtHaveModule(widgets) {
- QT += multimediawidgets-private opengl
- HEADERS += \
- avfvideowidgetcontrol.h \
- avfvideowidget.h
+ avfmediaplayersession.mm
+!ios {
+ HEADERS += \
+ avfvideorenderercontrol.h \
+ avfdisplaylink.h \
+ avfvideoframerenderer.h \
+ avfvideooutput.h
OBJECTIVE_SOURCES += \
- avfvideowidgetcontrol.mm \
- avfvideowidget.mm
+ avfvideorenderercontrol.mm \
+ avfdisplaylink.mm \
+ avfvideoframerenderer.mm \
+ avfvideooutput.mm
+
+ LIBS += -framework QuartzCore -framework AppKit
+
+ qtHaveModule(widgets) {
+ QT += multimediawidgets-private opengl
+ HEADERS += \
+ avfvideowidgetcontrol.h \
+ avfvideowidget.h
+
+ OBJECTIVE_SOURCES += \
+ avfvideowidgetcontrol.mm \
+ avfvideowidget.mm
+ }
}
OTHER_FILES += \
mac:!simulator {
SUBDIRS += audiocapture
- !ios {
- SUBDIRS += qt7
- config_avfoundation: SUBDIRS += avfoundation
- }
+ config_avfoundation: SUBDIRS += avfoundation
+
+ !ios: SUBDIRS += qt7
}
config_opensles {