AVFoundation: Enable QVideoWidget on iOS
authorAndy Nichols <andy.nichols@digia.com>
Thu, 15 Aug 2013 14:31:34 +0000 (16:31 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 27 Aug 2013 12:16:18 +0000 (14:16 +0200)
Change-Id: I88041e7a2ea052fe449542eeaada31c09d93d163
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
src/plugins/avfoundation/mediaplayer/mediaplayer.pro

index 668a26e..398f00e 100644 (file)
 #if defined(Q_OS_OSX)
 # include "avfvideooutput.h"
 # include "avfvideorenderercontrol.h"
-
-# ifndef QT_NO_WIDGETS
-#  include "avfvideowidgetcontrol.h"
-# endif
+#endif
+#ifndef QT_NO_WIDGETS
+# include "avfvideowidgetcontrol.h"
 #endif
 
 QT_USE_NAMESPACE
@@ -93,7 +92,8 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
         m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
         return m_videoOutput;
     }
-# ifndef QT_NO_WIDGETS
+#endif
+#ifndef QT_NO_WIDGETS
     if (qstrcmp(name, QVideoWidgetControl_iid) == 0) {
         if (!m_videoOutput)
             m_videoOutput = new AVFVideoWidgetControl(this);
@@ -101,7 +101,6 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
         m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
         return m_videoOutput;
     }
-# endif
 #endif
     return 0;
 }
index f0bd18c..e5bccd1 100644 (file)
@@ -20,28 +20,16 @@ HEADERS += \
     avfmediaplayermetadatacontrol.h \
     avfmediaplayerservice.h \
     avfmediaplayersession.h \
-    avfmediaplayerserviceplugin.h
+    avfmediaplayerserviceplugin.h \
+    avfvideooutput.h
 
 OBJECTIVE_SOURCES += \
     avfmediaplayercontrol.mm \
     avfmediaplayermetadatacontrol.mm \
     avfmediaplayerservice.mm \
     avfmediaplayerserviceplugin.mm \
-    avfmediaplayersession.mm
-
-!ios {
-    HEADERS += \
-        avfvideorenderercontrol.h \
-        avfdisplaylink.h \
-        avfvideoframerenderer.h \
-        avfvideooutput.h
-    OBJECTIVE_SOURCES += \
-        avfvideorenderercontrol.mm \
-        avfdisplaylink.mm \
-        avfvideoframerenderer.mm \
-        avfvideooutput.mm
-
-    LIBS += -framework QuartzCore -framework AppKit
+    avfmediaplayersession.mm \
+    avfvideooutput.mm
 
     qtHaveModule(widgets) {
         QT += multimediawidgets-private
@@ -53,6 +41,18 @@ OBJECTIVE_SOURCES += \
             avfvideowidgetcontrol.mm \
             avfvideowidget.mm
     }
+
+!ios {
+    LIBS += -framework QuartzCore -framework AppKit
+
+    HEADERS += \
+        avfvideorenderercontrol.h \
+        avfdisplaylink.h \
+        avfvideoframerenderer.h
+    OBJECTIVE_SOURCES += \
+        avfvideorenderercontrol.mm \
+        avfdisplaylink.mm \
+        avfvideoframerenderer.mm
 }
 
 OTHER_FILES += \