From f97d5eaaa539e2569f3ca3b8eef6649827b07bc1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 21 Apr 2017 15:37:59 +0200 Subject: DirectShow: Fix namespaced build with MinGW Remove QT_USE_NAMESPACE from headers and enclose headers/sources in QT_BEGIN/END_NAMESPACE. Fixes MinGW build error: qtbase/src/corelib/global/qtypeinfo.h:246:7: error: specialization of 'template class tn::QTypeInfo' in different namespace [-fpermissive] class QTypeInfo \ ^ qtbase/src/corelib/global/qtypeinfo.h:265:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) ^ helpers\directshowmediatype.h:92:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(DirectShowMediaType, Q_MOVABLE_TYPE); ^ qtbase/src/corelib/global/qtypeinfo.h:57:7: error: from definition of 'template class tn::QTypeInfo' [-fpermissive] class QTypeInfo ^ Task-number: QTBUG-60118 Change-Id: Idfe7a49b50a0046a5cb17630a3ec99615ec6150a Reviewed-by: Christian Stromme --- src/plugins/directshow/player/directshowplayerservice.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/directshow/player/directshowplayerservice.h') diff --git a/src/plugins/directshow/player/directshowplayerservice.h b/src/plugins/directshow/player/directshowplayerservice.h index d933bd660..dc0226001 100644 --- a/src/plugins/directshow/player/directshowplayerservice.h +++ b/src/plugins/directshow/player/directshowplayerservice.h @@ -55,17 +55,15 @@ #include #include +QT_BEGIN_NAMESPACE + class DirectShowAudioEndpointControl; class DirectShowMetaDataControl; class DirectShowPlayerControl; class DirectShowVideoRendererControl; -QT_BEGIN_NAMESPACE class QMediaContent; class QVideoWindowControl; -QT_END_NAMESPACE - -QT_USE_NAMESPACE class DirectShowPlayerService : public QMediaService { @@ -213,5 +211,6 @@ private: friend class DirectShowPlayerServiceThread; }; +QT_END_NAMESPACE #endif -- cgit v1.2.3 From 8e4d966f4e5546787257de046d2c3af8a19214b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 20 Oct 2016 18:32:48 +0200 Subject: DirectShow: Enable audio and video probes in DirectShow This change enables the video and audio probe functionality, so it can be used with the media player. [ChangeLog][DirectShow] Added support for audio and video probes in the mediaplayer. Task-number: QTBUG-56415 Change-Id: If6f36a693b1d22372eab130df07d435c9df5a796 Reviewed-by: Yoann Lopes --- .../directshow/player/directshowplayerservice.h | 56 +++++++++++++++------- 1 file changed, 40 insertions(+), 16 deletions(-) (limited to 'src/plugins/directshow/player/directshowplayerservice.h') diff --git a/src/plugins/directshow/player/directshowplayerservice.h b/src/plugins/directshow/player/directshowplayerservice.h index dc0226001..676d88fb5 100644 --- a/src/plugins/directshow/player/directshowplayerservice.h +++ b/src/plugins/directshow/player/directshowplayerservice.h @@ -61,6 +61,9 @@ class DirectShowAudioEndpointControl; class DirectShowMetaDataControl; class DirectShowPlayerControl; class DirectShowVideoRendererControl; +class DirectShowAudioProbeControl; +class DirectShowVideoProbeControl; +class DirectShowSampleGrabber; class QMediaContent; class QVideoWindowControl; @@ -103,10 +106,16 @@ protected: private Q_SLOTS: void videoOutputChanged(); + void onAudioBufferAvailable(double time, quint8 *buffer, long len); + void onVideoBufferAvailable(double time, quint8 *buffer, long len); + private: void releaseGraph(); void updateStatus(); + void updateAudioProbe(); + void updateVideoProbe(); + int findStreamTypes(IBaseFilter *source) const; int findStreamType(IPin *pin) const; @@ -127,29 +136,40 @@ private: void doReleaseAudioOutput(QMutexLocker *locker); void doReleaseVideoOutput(QMutexLocker *locker); void doReleaseGraph(QMutexLocker *locker); + void doSetVideoProbe(QMutexLocker *locker); + void doSetAudioProbe(QMutexLocker *locker); + void doReleaseVideoProbe(QMutexLocker *locker); + void doReleaseAudioProbe(QMutexLocker *locker); void graphEvent(QMutexLocker *locker); enum Task { - Shutdown = 0x0001, - SetUrlSource = 0x0002, - SetStreamSource = 0x0004, + Shutdown = 0x00001, + SetUrlSource = 0x00002, + SetStreamSource = 0x00004, SetSource = SetUrlSource | SetStreamSource, - SetAudioOutput = 0x0008, - SetVideoOutput = 0x0010, + SetAudioOutput = 0x00008, + SetVideoOutput = 0x00010, SetOutputs = SetAudioOutput | SetVideoOutput, - Render = 0x0020, - FinalizeLoad = 0x0040, - SetRate = 0x0080, - Seek = 0x0100, - Play = 0x0200, - Pause = 0x0400, - Stop = 0x0800, - ReleaseGraph = 0x1000, - ReleaseAudioOutput = 0x2000, - ReleaseVideoOutput = 0x4000, - ReleaseFilters = ReleaseGraph | ReleaseAudioOutput | ReleaseVideoOutput + SetAudioProbe = 0x00020, + SetVideoProbe = 0x00040, + SetProbes = SetAudioProbe | SetVideoProbe, + Render = 0x00080, + FinalizeLoad = 0x00100, + SetRate = 0x00200, + Seek = 0x00400, + Play = 0x00800, + Pause = 0x01000, + Stop = 0x02000, + ReleaseGraph = 0x04000, + ReleaseAudioOutput = 0x08000, + ReleaseVideoOutput = 0x10000, + ReleaseAudioProbe = 0x20000, + ReleaseVideoProbe = 0x40000, + ReleaseFilters = ReleaseGraph | ReleaseAudioOutput + | ReleaseVideoOutput | ReleaseAudioProbe + | ReleaseVideoProbe }; enum Event @@ -178,6 +198,10 @@ private: DirectShowVideoRendererControl *m_videoRendererControl; QVideoWindowControl *m_videoWindowControl; DirectShowAudioEndpointControl *m_audioEndpointControl; + DirectShowAudioProbeControl *m_audioProbeControl; + DirectShowVideoProbeControl *m_videoProbeControl; + DirectShowSampleGrabber *m_audioSampleGrabber; + DirectShowSampleGrabber *m_videoSampleGrabber; QThread *m_taskThread; DirectShowEventLoop *m_loop; -- cgit v1.2.3