summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-12 10:59:51 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-12 15:19:04 +0200
commitd25ed5222aec9e642ac534aea463a91c1952f229 (patch)
tree751fb0fc3d0174db1d69d5dafedfca0d0932f14d /src
parent8849979754d45dc911e10e9b4942615352e5f3a0 (diff)
DirectShow: Use member initialization
Change-Id: I4e696083c2ed78b374f2df64706ecb2297f122dd Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/directshow/camera/dscameracontrol.cpp2
-rw-r--r--src/plugins/directshow/camera/dscameracontrol.h4
-rw-r--r--src/plugins/directshow/camera/dscameraservice.cpp2
-rw-r--r--src/plugins/directshow/camera/dscameraservice.h4
-rw-r--r--src/plugins/directshow/camera/dscamerasession.cpp17
-rw-r--r--src/plugins/directshow/camera/dscamerasession.h35
-rw-r--r--src/plugins/directshow/camera/dsvideorenderer.cpp1
-rw-r--r--src/plugins/directshow/camera/dsvideorenderer.h2
-rw-r--r--src/plugins/directshow/common/directshowbasefilter.cpp4
-rw-r--r--src/plugins/directshow/common/directshowbasefilter.h10
-rw-r--r--src/plugins/directshow/common/directshoweventloop.cpp5
-rw-r--r--src/plugins/directshow/common/directshoweventloop.h4
-rw-r--r--src/plugins/directshow/common/directshowmediatypeenum.cpp8
-rw-r--r--src/plugins/directshow/common/directshowmediatypeenum.h4
-rw-r--r--src/plugins/directshow/common/directshowpin.cpp6
-rw-r--r--src/plugins/directshow/common/directshowpin.h12
-rw-r--r--src/plugins/directshow/common/directshowpinenum.cpp5
-rw-r--r--src/plugins/directshow/common/directshowpinenum.h4
-rw-r--r--src/plugins/directshow/common/directshowsamplegrabber.cpp3
-rw-r--r--src/plugins/directshow/common/directshowsamplegrabber.h8
-rw-r--r--src/plugins/directshow/player/directshowaudioendpointcontrol.cpp2
-rw-r--r--src/plugins/directshow/player/directshowaudioendpointcontrol.h4
-rw-r--r--src/plugins/directshow/player/directshowevrvideowindowcontrol.cpp1
-rw-r--r--src/plugins/directshow/player/directshowevrvideowindowcontrol.h2
-rw-r--r--src/plugins/directshow/player/directshowioreader.cpp20
-rw-r--r--src/plugins/directshow/player/directshowioreader.h24
-rw-r--r--src/plugins/directshow/player/directshowiosource.cpp11
-rw-r--r--src/plugins/directshow/player/directshowiosource.h18
-rw-r--r--src/plugins/directshow/player/directshowmetadatacontrol.cpp1
-rw-r--r--src/plugins/directshow/player/directshowmetadatacontrol.h2
-rw-r--r--src/plugins/directshow/player/directshowplayercontrol.cpp13
-rw-r--r--src/plugins/directshow/player/directshowplayercontrol.h28
-rw-r--r--src/plugins/directshow/player/directshowplayerservice.cpp29
-rw-r--r--src/plugins/directshow/player/directshowplayerservice.h64
-rw-r--r--src/plugins/directshow/player/directshowvideorenderercontrol.cpp5
-rw-r--r--src/plugins/directshow/player/directshowvideorenderercontrol.h6
-rw-r--r--src/plugins/directshow/player/videosurfacefilter.cpp10
-rw-r--r--src/plugins/directshow/player/videosurfacefilter.h20
-rw-r--r--src/plugins/directshow/player/vmr9videowindowcontrol.cpp9
-rw-r--r--src/plugins/directshow/player/vmr9videowindowcontrol.h18
40 files changed, 144 insertions, 283 deletions
diff --git a/src/plugins/directshow/camera/dscameracontrol.cpp b/src/plugins/directshow/camera/dscameracontrol.cpp
index 67971d1b..3f60ec84 100644
--- a/src/plugins/directshow/camera/dscameracontrol.cpp
+++ b/src/plugins/directshow/camera/dscameracontrol.cpp
@@ -47,8 +47,6 @@ QT_BEGIN_NAMESPACE
DSCameraControl::DSCameraControl(QObject *parent)
: QCameraControl(parent)
- , m_state(QCamera::UnloadedState)
- , m_captureMode(QCamera::CaptureStillImage)
{
m_session = qobject_cast<DSCameraSession*>(parent);
connect(m_session, &DSCameraSession::statusChanged, this,
diff --git a/src/plugins/directshow/camera/dscameracontrol.h b/src/plugins/directshow/camera/dscameracontrol.h
index b9fb2766..2ad73700 100644
--- a/src/plugins/directshow/camera/dscameracontrol.h
+++ b/src/plugins/directshow/camera/dscameracontrol.h
@@ -69,8 +69,8 @@ public:
private:
DSCameraSession *m_session;
- QCamera::State m_state;
- QCamera::CaptureModes m_captureMode;
+ QCamera::State m_state = QCamera::UnloadedState;
+ QCamera::CaptureModes m_captureMode = QCamera::CaptureStillImage;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/camera/dscameraservice.cpp b/src/plugins/directshow/camera/dscameraservice.cpp
index 8115ef38..bb1691c2 100644
--- a/src/plugins/directshow/camera/dscameraservice.cpp
+++ b/src/plugins/directshow/camera/dscameraservice.cpp
@@ -62,14 +62,12 @@ DSCameraService::DSCameraService(QObject *parent):
, m_session(new DSCameraSession(this))
, m_control(new DSCameraControl(m_session))
, m_videoDevice(new DSVideoDeviceControl(m_session))
- , m_videoRenderer(0)
, m_imageCapture(new DSImageCaptureControl(m_session))
, m_viewfinderSettings(new DSCameraViewfinderSettingsControl(m_session))
, m_imageProcessingControl(new DSCameraImageProcessingControl(m_session))
, m_exposureControl(new DirectShowCameraExposureControl(m_session))
, m_captureDestinationControl(new DirectShowCameraCaptureDestinationControl(m_session))
, m_captureBufferFormatControl(new DirectShowCameraCaptureBufferFormatControl)
- , m_videoProbeControl(nullptr)
, m_zoomControl(new DirectShowCameraZoomControl(m_session))
, m_imageEncoderControl(new DirectShowCameraImageEncoderControl(m_session))
{
diff --git a/src/plugins/directshow/camera/dscameraservice.h b/src/plugins/directshow/camera/dscameraservice.h
index 9a8f745f..239a9b55 100644
--- a/src/plugins/directshow/camera/dscameraservice.h
+++ b/src/plugins/directshow/camera/dscameraservice.h
@@ -74,14 +74,14 @@ private:
DSCameraSession *m_session;
DSCameraControl *m_control;
DSVideoDeviceControl *m_videoDevice;
- QMediaControl *m_videoRenderer;
+ QMediaControl *m_videoRenderer = nullptr;
DSImageCaptureControl *m_imageCapture;
DSCameraViewfinderSettingsControl *m_viewfinderSettings;
DSCameraImageProcessingControl *m_imageProcessingControl;
DirectShowCameraExposureControl *m_exposureControl;
DirectShowCameraCaptureDestinationControl *m_captureDestinationControl;
DirectShowCameraCaptureBufferFormatControl *m_captureBufferFormatControl;
- DirectShowVideoProbeControl *m_videoProbeControl;
+ DirectShowVideoProbeControl *m_videoProbeControl = nullptr;
DirectShowCameraZoomControl *m_zoomControl;
DirectShowCameraImageEncoderControl *m_imageEncoderControl;
};
diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp
index 4c910028..c3fa8d22 100644
--- a/src/plugins/directshow/camera/dscamerasession.cpp
+++ b/src/plugins/directshow/camera/dscamerasession.cpp
@@ -58,23 +58,6 @@ QT_BEGIN_NAMESPACE
DSCameraSession::DSCameraSession(QObject *parent)
: QObject(parent)
- , m_graphBuilder(nullptr)
- , m_filterGraph(nullptr)
- , m_sourceDeviceName(QLatin1String("default"))
- , m_sourceFilter(nullptr)
- , m_needsHorizontalMirroring(false)
- , m_previewSampleGrabber(nullptr)
- , m_nullRendererFilter(nullptr)
- , m_previewStarted(false)
- , m_surface(nullptr)
- , m_previewPixelFormat(QVideoFrame::Format_Invalid)
- , m_stride(-1)
- , m_readyForCapture(false)
- , m_imageIdCounter(0)
- , m_currentImageId(-1)
- , m_captureDestinations(QCameraImageCapture::CaptureToFile)
- , m_videoProbeControl(nullptr)
- , m_status(QCamera::UnloadedStatus)
{
connect(this, SIGNAL(statusChanged(QCamera::Status)),
this, SLOT(updateReadyForCapture()));
diff --git a/src/plugins/directshow/camera/dscamerasession.h b/src/plugins/directshow/camera/dscamerasession.h
index 18fc0cca..a1934577 100644
--- a/src/plugins/directshow/camera/dscamerasession.h
+++ b/src/plugins/directshow/camera/dscamerasession.h
@@ -185,49 +185,48 @@ private:
QMutex m_presentMutex;
QMutex m_captureMutex;
- // Capture Graph
- ICaptureGraphBuilder2* m_graphBuilder;
- IGraphBuilder* m_filterGraph;
+ ICaptureGraphBuilder2* m_graphBuilder = nullptr;
+ IGraphBuilder* m_filterGraph = nullptr;
// Source (camera)
- QString m_sourceDeviceName;
- IBaseFilter* m_sourceFilter;
- bool m_needsHorizontalMirroring;
+ QString m_sourceDeviceName = QLatin1String("default");
+ IBaseFilter* m_sourceFilter = nullptr;
+ bool m_needsHorizontalMirroring = false;
QList<DirectShowMediaType> m_supportedFormats;
QList<QCameraViewfinderSettings> m_supportedViewfinderSettings;
DirectShowMediaType m_sourceFormat;
QMap<QCameraImageProcessingControl::ProcessingParameter, ImageProcessingParameterInfo> m_imageProcessingParametersInfos;
// Preview
- DirectShowSampleGrabber *m_previewSampleGrabber;
- IBaseFilter *m_nullRendererFilter;
+ DirectShowSampleGrabber *m_previewSampleGrabber = nullptr;
+ IBaseFilter *m_nullRendererFilter = nullptr;
QVideoFrame m_currentFrame;
- bool m_previewStarted;
- QAbstractVideoSurface* m_surface;
+ bool m_previewStarted = false;
+ QAbstractVideoSurface* m_surface = nullptr;
QVideoSurfaceFormat m_previewSurfaceFormat;
- QVideoFrame::PixelFormat m_previewPixelFormat;
+ QVideoFrame::PixelFormat m_previewPixelFormat = QVideoFrame::Format_RGB32;
QSize m_previewSize;
- int m_stride;
+ int m_stride = -1;
QCameraViewfinderSettings m_viewfinderSettings;
QCameraViewfinderSettings m_actualViewfinderSettings;
// Image capture
QString m_imageCaptureFileName;
QMediaStorageLocation m_fileNameGenerator;
- bool m_readyForCapture;
- int m_imageIdCounter;
- int m_currentImageId;
+ bool m_readyForCapture = false;
+ int m_imageIdCounter = 0;
+ int m_currentImageId = -1;
QVideoFrame m_capturedFrame;
- QCameraImageCapture::CaptureDestinations m_captureDestinations;
+ QCameraImageCapture::CaptureDestinations m_captureDestinations = QCameraImageCapture::CaptureToFile;
// Video probe
QMutex m_probeMutex;
- DirectShowVideoProbeControl *m_videoProbeControl;
+ DirectShowVideoProbeControl *m_videoProbeControl = nullptr;
QImageEncoderSettings m_imageEncoderSettings;
// Internal state
- QCamera::Status m_status;
+ QCamera::Status m_status = QCamera::UnloadedStatus;
QTimer m_deviceLostEventTimer;
QMap<QCameraImageProcessingControl::ProcessingParameter, QVariant> m_pendingImageProcessingParametrs;
diff --git a/src/plugins/directshow/camera/dsvideorenderer.cpp b/src/plugins/directshow/camera/dsvideorenderer.cpp
index bf0aa268..cde63af6 100644
--- a/src/plugins/directshow/camera/dsvideorenderer.cpp
+++ b/src/plugins/directshow/camera/dsvideorenderer.cpp
@@ -45,7 +45,6 @@ QT_BEGIN_NAMESPACE
DSVideoRendererControl::DSVideoRendererControl(DSCameraSession* session, QObject *parent)
:QVideoRendererControl(parent),
- m_surface(0),
m_session(session)
{
}
diff --git a/src/plugins/directshow/camera/dsvideorenderer.h b/src/plugins/directshow/camera/dsvideorenderer.h
index 3a4570b4..96cf7448 100644
--- a/src/plugins/directshow/camera/dsvideorenderer.h
+++ b/src/plugins/directshow/camera/dsvideorenderer.h
@@ -59,7 +59,7 @@ public:
void setSession(DSCameraSession* session);
private:
- QAbstractVideoSurface* m_surface;
+ QAbstractVideoSurface* m_surface = nullptr;
DSCameraSession* m_session;
};
diff --git a/src/plugins/directshow/common/directshowbasefilter.cpp b/src/plugins/directshow/common/directshowbasefilter.cpp
index b792c4d3..fd86cc3d 100644
--- a/src/plugins/directshow/common/directshowbasefilter.cpp
+++ b/src/plugins/directshow/common/directshowbasefilter.cpp
@@ -45,10 +45,6 @@ QT_BEGIN_NAMESPACE
DirectShowBaseFilter::DirectShowBaseFilter()
: m_mutex(QMutex::Recursive)
- , m_state(State_Stopped)
- , m_graph(NULL)
- , m_clock(NULL)
- , m_sink(NULL)
{
}
diff --git a/src/plugins/directshow/common/directshowbasefilter.h b/src/plugins/directshow/common/directshowbasefilter.h
index fe78f96b..ea5b8faf 100644
--- a/src/plugins/directshow/common/directshowbasefilter.h
+++ b/src/plugins/directshow/common/directshowbasefilter.h
@@ -79,12 +79,12 @@ public:
protected:
QMutex m_mutex;
- FILTER_STATE m_state;
- IFilterGraph *m_graph;
- IReferenceClock *m_clock;
- IMediaEventSink *m_sink;
+ FILTER_STATE m_state = State_Stopped;
+ IFilterGraph *m_graph = nullptr;
+ IReferenceClock *m_clock = nullptr;
+ IMediaEventSink *m_sink = nullptr;
QString m_filterName;
- REFERENCE_TIME m_startTime;
+ REFERENCE_TIME m_startTime = 0;
private:
Q_DISABLE_COPY(DirectShowBaseFilter)
diff --git a/src/plugins/directshow/common/directshoweventloop.cpp b/src/plugins/directshow/common/directshoweventloop.cpp
index fbc7b8ce..a848f41e 100644
--- a/src/plugins/directshow/common/directshoweventloop.cpp
+++ b/src/plugins/directshow/common/directshoweventloop.cpp
@@ -51,7 +51,6 @@ public:
DirectShowPostedEvent(QObject *receiver, QEvent *event)
: receiver(receiver)
, event(event)
- , next(0)
{
}
@@ -62,13 +61,11 @@ public:
QObject *receiver;
QEvent *event;
- DirectShowPostedEvent *next;
+ DirectShowPostedEvent *next = nullptr;
};
DirectShowEventLoop::DirectShowEventLoop(QObject *parent)
: QObject(parent)
- , m_postsHead(0)
- , m_postsTail(0)
, m_eventHandle(::CreateEvent(0, 0, 0, 0))
, m_waitHandle(::CreateEvent(0, 0, 0, 0))
{
diff --git a/src/plugins/directshow/common/directshoweventloop.h b/src/plugins/directshow/common/directshoweventloop.h
index a29274b7..b9003209 100644
--- a/src/plugins/directshow/common/directshoweventloop.h
+++ b/src/plugins/directshow/common/directshoweventloop.h
@@ -68,8 +68,8 @@ protected:
private:
void processEvents();
- DirectShowPostedEvent *m_postsHead;
- DirectShowPostedEvent *m_postsTail;
+ DirectShowPostedEvent *m_postsHead = nullptr;
+ DirectShowPostedEvent *m_postsTail = nullptr;
HANDLE m_eventHandle;
HANDLE m_waitHandle;
QMutex m_mutex;
diff --git a/src/plugins/directshow/common/directshowmediatypeenum.cpp b/src/plugins/directshow/common/directshowmediatypeenum.cpp
index 10623a24..0ff147fe 100644
--- a/src/plugins/directshow/common/directshowmediatypeenum.cpp
+++ b/src/plugins/directshow/common/directshowmediatypeenum.cpp
@@ -42,17 +42,13 @@
#include "directshowpin.h"
DirectShowMediaTypeEnum::DirectShowMediaTypeEnum(DirectShowPin *pin)
- : m_pin(pin)
- , m_mediaTypes(pin->supportedMediaTypes())
- , m_index(0)
+ : m_mediaTypes(pin->supportedMediaTypes())
{
m_pin->AddRef();
}
DirectShowMediaTypeEnum::DirectShowMediaTypeEnum(const QList<DirectShowMediaType> &types)
- : m_pin(NULL)
- , m_mediaTypes(types)
- , m_index(0)
+ : m_mediaTypes(types)
{
}
diff --git a/src/plugins/directshow/common/directshowmediatypeenum.h b/src/plugins/directshow/common/directshowmediatypeenum.h
index e78e0a0f..a5c34700 100644
--- a/src/plugins/directshow/common/directshowmediatypeenum.h
+++ b/src/plugins/directshow/common/directshowmediatypeenum.h
@@ -67,9 +67,9 @@ public:
private:
Q_DISABLE_COPY(DirectShowMediaTypeEnum)
- DirectShowPin *m_pin;
+ DirectShowPin *m_pin = nullptr;
QList<DirectShowMediaType> m_mediaTypes;
- int m_index;
+ int m_index = 0;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/common/directshowpin.cpp b/src/plugins/directshow/common/directshowpin.cpp
index 508a9b21..a9a1d829 100644
--- a/src/plugins/directshow/common/directshowpin.cpp
+++ b/src/plugins/directshow/common/directshowpin.cpp
@@ -52,7 +52,6 @@ DirectShowPin::DirectShowPin(DirectShowBaseFilter *filter, const QString &name,
, m_filter(filter)
, m_name(name)
, m_direction(direction)
- , m_peerPin(NULL)
{
}
@@ -380,8 +379,6 @@ HRESULT DirectShowPin::setActive(bool active)
DirectShowOutputPin::DirectShowOutputPin(DirectShowBaseFilter *filter, const QString &name)
: DirectShowPin(filter, name, PINDIR_OUTPUT)
- , m_allocator(NULL)
- , m_inputPin(NULL)
{
}
@@ -485,9 +482,6 @@ HRESULT DirectShowOutputPin::EndOfStream()
DirectShowInputPin::DirectShowInputPin(DirectShowBaseFilter *filter, const QString &name)
: DirectShowPin(filter, name, PINDIR_INPUT)
- , m_allocator(NULL)
- , m_flushing(false)
- , m_inErrorState(false)
{
ZeroMemory(&m_sampleProperties, sizeof(m_sampleProperties));
}
diff --git a/src/plugins/directshow/common/directshowpin.h b/src/plugins/directshow/common/directshowpin.h
index 5e513d00..419276c9 100644
--- a/src/plugins/directshow/common/directshowpin.h
+++ b/src/plugins/directshow/common/directshowpin.h
@@ -102,7 +102,7 @@ protected:
QString m_name;
PIN_DIRECTION m_direction;
- IPin *m_peerPin;
+ IPin *m_peerPin = nullptr;
DirectShowMediaType m_mediaType;
private:
@@ -128,8 +128,8 @@ public:
protected:
DirectShowOutputPin(DirectShowBaseFilter *filter, const QString &name);
- IMemAllocator *m_allocator;
- IMemInputPin *m_inputPin;
+ IMemAllocator *m_allocator = nullptr;
+ IMemInputPin *m_inputPin = nullptr;
private:
Q_DISABLE_COPY(DirectShowOutputPin)
@@ -166,9 +166,9 @@ public:
protected:
DirectShowInputPin(DirectShowBaseFilter *filter, const QString &name);
- IMemAllocator *m_allocator;
- bool m_flushing;
- bool m_inErrorState;
+ IMemAllocator *m_allocator = nullptr;
+ bool m_flushing = false;
+ bool m_inErrorState = false;
AM_SAMPLE2_PROPERTIES m_sampleProperties;
private:
diff --git a/src/plugins/directshow/common/directshowpinenum.cpp b/src/plugins/directshow/common/directshowpinenum.cpp
index 20fa93d6..7ba1bb6e 100644
--- a/src/plugins/directshow/common/directshowpinenum.cpp
+++ b/src/plugins/directshow/common/directshowpinenum.cpp
@@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE
DirectShowPinEnum::DirectShowPinEnum(DirectShowBaseFilter *filter)
: m_filter(filter)
- , m_index(0)
{
m_filter->AddRef();
const QList<DirectShowPin *> pinList = filter->pins();
@@ -55,9 +54,7 @@ DirectShowPinEnum::DirectShowPinEnum(DirectShowBaseFilter *filter)
}
DirectShowPinEnum::DirectShowPinEnum(const QList<IPin *> &pins)
- : m_filter(NULL)
- , m_pins(pins)
- , m_index(0)
+ : m_pins(pins)
{
for (IPin *pin : qAsConst(m_pins))
pin->AddRef();
diff --git a/src/plugins/directshow/common/directshowpinenum.h b/src/plugins/directshow/common/directshowpinenum.h
index d89f140b..aada1a71 100644
--- a/src/plugins/directshow/common/directshowpinenum.h
+++ b/src/plugins/directshow/common/directshowpinenum.h
@@ -68,9 +68,9 @@ public:
private:
Q_DISABLE_COPY(DirectShowPinEnum)
- DirectShowBaseFilter *m_filter;
+ DirectShowBaseFilter *m_filter = nullptr;
QList<IPin *> m_pins;
- int m_index;
+ int m_index = 0;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/common/directshowsamplegrabber.cpp b/src/plugins/directshow/common/directshowsamplegrabber.cpp
index 5744aea1..80d3f1c1 100644
--- a/src/plugins/directshow/common/directshowsamplegrabber.cpp
+++ b/src/plugins/directshow/common/directshowsamplegrabber.cpp
@@ -116,9 +116,6 @@ private:
DirectShowSampleGrabber::DirectShowSampleGrabber(QObject *p)
: QObject(p)
- , m_sampleGrabber(nullptr)
- , m_sampleGabberCb(nullptr)
- , m_callbackType(CallbackMethod::BufferCB)
{
// Create sample grabber filter
HRESULT hr = CoCreateInstance(cLSID_SampleGrabber, NULL, CLSCTX_INPROC, iID_ISampleGrabber, reinterpret_cast<void **>(&m_sampleGrabber));
diff --git a/src/plugins/directshow/common/directshowsamplegrabber.h b/src/plugins/directshow/common/directshowsamplegrabber.h
index a9b72fcd..5fc61de1 100644
--- a/src/plugins/directshow/common/directshowsamplegrabber.h
+++ b/src/plugins/directshow/common/directshowsamplegrabber.h
@@ -78,10 +78,10 @@ Q_SIGNALS:
void bufferAvailable(double time, const QByteArray &data);
private:
- IBaseFilter *m_filter;
- ISampleGrabber *m_sampleGrabber;
- SampleGrabberCallbackPrivate *m_sampleGabberCb;
- CallbackMethod m_callbackType;
+ IBaseFilter *m_filter = nullptr;
+ ISampleGrabber *m_sampleGrabber = nullptr;
+ SampleGrabberCallbackPrivate *m_sampleGabberCb = nullptr;
+ CallbackMethod m_callbackType= CallbackMethod::BufferCB;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/player/directshowaudioendpointcontrol.cpp b/src/plugins/directshow/player/directshowaudioendpointcontrol.cpp
index 78733972..3af9a5a2 100644
--- a/src/plugins/directshow/player/directshowaudioendpointcontrol.cpp
+++ b/src/plugins/directshow/player/directshowaudioendpointcontrol.cpp
@@ -48,8 +48,6 @@ DirectShowAudioEndpointControl::DirectShowAudioEndpointControl(
DirectShowPlayerService *service, QObject *parent)
: QAudioOutputSelectorControl(parent)
, m_service(service)
- , m_bindContext(0)
- , m_deviceEnumerator(0)
{
if (CreateBindCtx(0, &m_bindContext) == S_OK) {
m_deviceEnumerator = com_new<ICreateDevEnum>(CLSID_SystemDeviceEnum);
diff --git a/src/plugins/directshow/player/directshowaudioendpointcontrol.h b/src/plugins/directshow/player/directshowaudioendpointcontrol.h
index b6f8a672..1004489d 100644
--- a/src/plugins/directshow/player/directshowaudioendpointcontrol.h
+++ b/src/plugins/directshow/player/directshowaudioendpointcontrol.h
@@ -68,8 +68,8 @@ private:
void updateEndpoints();
DirectShowPlayerService *m_service;
- IBindCtx *m_bindContext;
- ICreateDevEnum *m_deviceEnumerator;
+ IBindCtx *m_bindContext = nullptr;
+ ICreateDevEnum *m_deviceEnumerator = nullptr;
QMap<QString, IMoniker *> m_devices;
QString m_defaultEndpoint;
diff --git a/src/plugins/directshow/player/directshowevrvideowindowcontrol.cpp b/src/plugins/directshow/player/directshowevrvideowindowcontrol.cpp
index fc1058d5..8ef5fd6c 100644
--- a/src/plugins/directshow/player/directshowevrvideowindowcontrol.cpp
+++ b/src/plugins/directshow/player/directshowevrvideowindowcontrol.cpp
@@ -43,7 +43,6 @@
DirectShowEvrVideoWindowControl::DirectShowEvrVideoWindowControl(QObject *parent)
: EvrVideoWindowControl(parent)
- , m_evrFilter(NULL)
{
}
diff --git a/src/plugins/directshow/player/directshowevrvideowindowcontrol.h b/src/plugins/directshow/player/directshowevrvideowindowcontrol.h
index fb661780..314aee3e 100644
--- a/src/plugins/directshow/player/directshowevrvideowindowcontrol.h
+++ b/src/plugins/directshow/player/directshowevrvideowindowcontrol.h
@@ -55,7 +55,7 @@ public:
IBaseFilter *filter();
private:
- IBaseFilter *m_evrFilter;
+ IBaseFilter *m_evrFilter = nullptr;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/player/directshowioreader.cpp b/src/plugins/directshow/player/directshowioreader.cpp
index 3482cee0..5fff295f 100644
--- a/src/plugins/directshow/player/directshowioreader.cpp
+++ b/src/plugins/directshow/player/directshowioreader.cpp
@@ -55,25 +55,23 @@ class DirectShowSampleRequest
public:
DirectShowSampleRequest(
IMediaSample *sample, DWORD_PTR userData, LONGLONG position, LONG length, BYTE *buffer)
- : next(0)
- , sample(sample)
+ : sample(sample)
, userData(userData)
, position(position)
, length(length)
, buffer(buffer)
- , result(S_FALSE)
{
}
DirectShowSampleRequest *remove() { DirectShowSampleRequest *n = next; delete this; return n; }
- DirectShowSampleRequest *next;
+ DirectShowSampleRequest *next = nullptr;
IMediaSample *sample;
DWORD_PTR userData;
LONGLONG position;
LONG length;
BYTE *buffer;
- HRESULT result;
+ HRESULT result = S_FALSE;
};
DirectShowIOReader::DirectShowIOReader(
@@ -81,18 +79,6 @@ DirectShowIOReader::DirectShowIOReader(
: m_source(source)
, m_device(device)
, m_loop(loop)
- , m_pendingHead(0)
- , m_pendingTail(0)
- , m_readyHead(0)
- , m_readyTail(0)
- , m_synchronousPosition(0)
- , m_synchronousLength(0)
- , m_synchronousBytesRead(0)
- , m_synchronousBuffer(0)
- , m_synchronousResult(S_OK)
- , m_totalLength(0)
- , m_availableLength(0)
- , m_flushing(false)
{
moveToThread(device->thread());
diff --git a/src/plugins/directshow/player/directshowioreader.h b/src/plugins/directshow/player/directshowioreader.h
index 55099064..a0f2d7ad 100644
--- a/src/plugins/directshow/player/directshowioreader.h
+++ b/src/plugins/directshow/player/directshowioreader.h
@@ -99,18 +99,18 @@ private:
DirectShowIOSource *m_source;
QIODevice *m_device;
DirectShowEventLoop *m_loop;
- DirectShowSampleRequest *m_pendingHead;
- DirectShowSampleRequest *m_pendingTail;
- DirectShowSampleRequest *m_readyHead;
- DirectShowSampleRequest *m_readyTail;
- LONGLONG m_synchronousPosition;
- LONG m_synchronousLength;
- qint64 m_synchronousBytesRead;
- BYTE *m_synchronousBuffer;
- HRESULT m_synchronousResult;
- LONGLONG m_totalLength;
- LONGLONG m_availableLength;
- bool m_flushing;
+ DirectShowSampleRequest *m_pendingHead = nullptr;
+ DirectShowSampleRequest *m_pendingTail = nullptr;
+ DirectShowSampleRequest *m_readyHead = nullptr;
+ DirectShowSampleRequest *m_readyTail = nullptr;
+ LONGLONG m_synchronousPosition = 0;
+ LONG m_synchronousLength = 0;
+ qint64 m_synchronousBytesRead = 0;
+ BYTE *m_synchronousBuffer = nullptr;
+ HRESULT m_synchronousResult = S_OK;
+ LONGLONG m_totalLength = 0;
+ LONGLONG m_availableLength = 0;
+ bool m_flushing = false;
QMutex m_mutex;
QWaitCondition m_wait;
};
diff --git a/src/plugins/directshow/player/directshowiosource.cpp b/src/plugins/directshow/player/directshowiosource.cpp
index d5833faf..934ac97f 100644
--- a/src/plugins/directshow/player/directshowiosource.cpp
+++ b/src/plugins/directshow/player/directshowiosource.cpp
@@ -66,16 +66,7 @@ static const GUID directshow_subtypes[] =
};
DirectShowIOSource::DirectShowIOSource(DirectShowEventLoop *loop)
- : m_ref(1)
- , m_state(State_Stopped)
- , m_reader(0)
- , m_loop(loop)
- , m_graph(0)
- , m_clock(0)
- , m_allocator(0)
- , m_peerPin(0)
- , m_pinId(QLatin1String("Data"))
- , m_queriedForAsyncReader(false)
+ : m_loop(loop)
{
// This filter has only one possible output type, that is, a stream of data
// with no particular subtype. The graph builder will try every demux/decode filters
diff --git a/src/plugins/directshow/player/directshowiosource.h b/src/plugins/directshow/player/directshowiosource.h
index 02639de7..83784251 100644
--- a/src/plugins/directshow/player/directshowiosource.h
+++ b/src/plugins/directshow/player/directshowiosource.h
@@ -119,19 +119,19 @@ public:
HRESULT STDMETHODCALLTYPE QueryDirection(PIN_DIRECTION *pPinDir) override;
private:
- volatile LONG m_ref;
- FILTER_STATE m_state;
- DirectShowIOReader *m_reader;
+ volatile LONG m_ref = 1;
+ FILTER_STATE m_state = State_Stopped;
+ DirectShowIOReader *m_reader = nullptr;
DirectShowEventLoop *m_loop;
- IFilterGraph *m_graph;
- IReferenceClock *m_clock;
- IMemAllocator *m_allocator;
- IPin *m_peerPin;
+ IFilterGraph *m_graph = nullptr;
+ IReferenceClock *m_clock = nullptr;
+ IMemAllocator *m_allocator = nullptr;
+ IPin *m_peerPin = nullptr;
DirectShowMediaType m_connectionMediaType;
QList<DirectShowMediaType> m_supportedMediaTypes;
QString m_filterName;
- const QString m_pinId;
- bool m_queriedForAsyncReader;
+ const QString m_pinId = QLatin1String("Data");
+ bool m_queriedForAsyncReader = false;
QMutex m_mutex;
};
diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.cpp b/src/plugins/directshow/player/directshowmetadatacontrol.cpp
index 915fa1c7..c87ce82c 100644
--- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp
+++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp
@@ -445,7 +445,6 @@ static QVariant convertValue(const PROPVARIANT& var)
DirectShowMetaDataControl::DirectShowMetaDataControl(QObject *parent)
: QMetaDataReaderControl(parent)
- , m_available(false)
{
}
diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.h b/src/plugins/directshow/player/directshowmetadatacontrol.h
index 4196a795..36a3ba84 100644
--- a/src/plugins/directshow/player/directshowmetadatacontrol.h
+++ b/src/plugins/directshow/player/directshowmetadatacontrol.h
@@ -76,7 +76,7 @@ private:
};
QVariantMap m_metadata;
- bool m_available;
+ bool m_available = false;
};
QT_END_NAMESPACE
diff --git a/src/plugins/directshow/player/directshowplayercontrol.cpp b/src/plugins/directshow/player/directshowplayercontrol.cpp
index 7de0a686..7e1413b5 100644
--- a/src/plugins/directshow/player/directshowplayercontrol.cpp
+++ b/src/plugins/directshow/player/directshowplayercontrol.cpp
@@ -50,19 +50,6 @@
DirectShowPlayerControl::DirectShowPlayerControl(DirectShowPlayerService *service, QObject *parent)
: QMediaPlayerControl(parent)
, m_service(service)
- , m_audio(0)
- , m_updateProperties(0)
- , m_state(QMediaPlayer::StoppedState)
- , m_status(QMediaPlayer::NoMedia)
- , m_error(QMediaPlayer::NoError)
- , m_streamTypes(0)
- , m_volume(100)
- , m_muted(false)
- , m_emitPosition(-1)
- , m_pendingPosition(-1)
- , m_duration(0)
- , m_playbackRate(0)
- , m_seekable(false)
{
}
diff --git a/src/plugins/directshow/player/directshowplayercontrol.h b/src/plugins/directshow/player/directshowplayercontrol.h
index dba9ab9a..7b235b91 100644
--- a/src/plugins/directshow/player/directshowplayercontrol.h
+++ b/src/plugins/directshow/player/directshowplayercontrol.h
@@ -129,20 +129,20 @@ private:
void setVolumeHelper(int volume);
DirectShowPlayerService *m_service;
- IBasicAudio *m_audio;
- QIODevice *m_stream;
- int m_updateProperties;
- QMediaPlayer::State m_state;
- QMediaPlayer::MediaStatus m_status;
- QMediaPlayer::Error m_error;
- int m_streamTypes;
- int m_volume;
- bool m_muted;
- qint64 m_emitPosition;
- qint64 m_pendingPosition;
- qint64 m_duration;
- qreal m_playbackRate;
- bool m_seekable;
+ IBasicAudio *m_audio = nullptr;
+ QIODevice *m_stream = nullptr;
+ int m_updateProperties = 0;
+ QMediaPlayer::State m_state = QMediaPlayer::StoppedState;
+ QMediaPlayer::MediaStatus m_status = QMediaPlayer::NoMedia;
+ QMediaPlayer::Error m_error = QMediaPlayer::NoError;
+ int m_streamTypes = 0;
+ int m_volume = 100;
+ bool m_muted = false;
+ qint64 m_emitPosition = -1;
+ qint64 m_pendingPosition = -1;
+ qint64 m_duration = 0;
+ qreal m_playbackRate = 0;
+ bool m_seekable = false;
QMediaContent m_media;
QString m_errorString;
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp
index 4b57cdcd..ad0dfabf 100644
--- a/src/plugins/directshow/player/directshowplayerservice.cpp
+++ b/src/plugins/directshow/player/directshowplayerservice.cpp
@@ -123,37 +123,8 @@ private:
DirectShowPlayerService::DirectShowPlayerService(QObject *parent)
: QMediaService(parent)
- , m_playerControl(0)
- , m_metaDataControl(0)
- , m_videoRendererControl(0)
- , m_videoWindowControl(0)
- , m_audioEndpointControl(0)
- , m_audioProbeControl(nullptr)
- , m_videoProbeControl(nullptr)
- , m_audioSampleGrabber(nullptr)
- , m_videoSampleGrabber(nullptr)
- , m_taskThread(0)
, m_loop(qt_directShowEventLoop())
- , m_pendingTasks(0)
- , m_executingTask(0)
- , m_executedTasks(0)
, m_taskHandle(::CreateEvent(0, 0, 0, 0))
- , m_eventHandle(0)
- , m_graphStatus(NoMedia)
- , m_stream(0)
- , m_graph(0)
- , m_graphBuilder(nullptr)
- , m_source(0)
- , m_audioOutput(0)
- , m_videoOutput(0)
- , m_rate(1.0)
- , m_position(0)
- , m_seekPosition(-1)
- , m_duration(0)
- , m_buffering(false)
- , m_seekable(false)
- , m_atEnd(false)
- , m_dontCacheNextSeekResult(false)
{
m_playerControl = new DirectShowPlayerControl(this);
m_metaDataControl = new DirectShowMetaDataControl(this);
diff --git a/src/plugins/directshow/player/directshowplayerservice.h b/src/plugins/directshow/player/directshowplayerservice.h
index a6eeb8a7..329a463e 100644
--- a/src/plugins/directshow/player/directshowplayerservice.h
+++ b/src/plugins/directshow/player/directshowplayerservice.h
@@ -193,44 +193,44 @@ private:
InvalidMedia
};
- DirectShowPlayerControl *m_playerControl;
- DirectShowMetaDataControl *m_metaDataControl;
- DirectShowVideoRendererControl *m_videoRendererControl;
- QVideoWindowControl *m_videoWindowControl;
- DirectShowAudioEndpointControl *m_audioEndpointControl;
- DirectShowAudioProbeControl *m_audioProbeControl;
- DirectShowVideoProbeControl *m_videoProbeControl;
- DirectShowSampleGrabber *m_audioSampleGrabber;
- DirectShowSampleGrabber *m_videoSampleGrabber;
-
- QThread *m_taskThread;
+ DirectShowPlayerControl *m_playerControl = nullptr;
+ DirectShowMetaDataControl *m_metaDataControl = nullptr;
+ DirectShowVideoRendererControl *m_videoRendererControl = nullptr;
+ QVideoWindowControl *m_videoWindowControl = nullptr;
+ DirectShowAudioEndpointControl *m_audioEndpointControl = nullptr;
+ DirectShowAudioProbeControl *m_audioProbeControl = nullptr;
+ DirectShowVideoProbeControl *m_videoProbeControl = nullptr;
+ DirectShowSampleGrabber *m_audioSampleGrabber = nullptr;
+ DirectShowSampleGrabber *m_videoSampleGrabber = nullptr;
+
+ QThread *m_taskThread = nullptr;
DirectShowEventLoop *m_loop;
- int m_pendingTasks;
- int m_executingTask;
- int m_executedTasks;
- int m_streamTypes;
+ int m_pendingTasks = 0;
+ int m_executingTask = 0;
+ int m_executedTasks = 0;
+ int m_streamTypes = 0;
HANDLE m_taskHandle;
- HANDLE m_eventHandle;
- GraphStatus m_graphStatus;
- QMediaPlayer::Error m_error;
- QIODevice *m_stream;
- IFilterGraph2 *m_graph;
- ICaptureGraphBuilder2 *m_graphBuilder;
- IBaseFilter *m_source;
- IBaseFilter *m_audioOutput;
- IBaseFilter *m_videoOutput;
- qreal m_rate;
- qint64 m_position;
- qint64 m_seekPosition;
- qint64 m_duration;
+ HANDLE m_eventHandle = nullptr;
+ GraphStatus m_graphStatus = NoMedia;
+ QMediaPlayer::Error m_error = QMediaPlayer::NoError;
+ QIODevice *m_stream = nullptr;
+ IFilterGraph2 *m_graph = nullptr;
+ ICaptureGraphBuilder2 *m_graphBuilder = nullptr;
+ IBaseFilter *m_source = nullptr;
+ IBaseFilter *m_audioOutput = nullptr;
+ IBaseFilter *m_videoOutput = nullptr;
+ qreal m_rate = 1;
+ qint64 m_position = 0;
+ qint64 m_seekPosition = -1;
+ qint64 m_duration = 0;
QMediaTimeRange m_playbackRange;
QUrl m_url;
QString m_errorString;
QMutex m_mutex;
- bool m_buffering;
- bool m_seekable;
- bool m_atEnd;
- bool m_dontCacheNextSeekResult;
+ bool m_buffering = false;
+ bool m_seekable = false;
+ bool m_atEnd = false;
+ bool m_dontCacheNextSeekResult = false;
QVariantMap m_metadata;
friend class DirectShowPlayerServiceThread;
diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
index 88b5a51e..18eb9218 100644
--- a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
+++ b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
@@ -51,11 +51,6 @@
DirectShowVideoRendererControl::DirectShowVideoRendererControl(DirectShowEventLoop *loop, QObject *parent)
: QVideoRendererControl(parent)
, m_loop(loop)
- , m_surface(0)
- , m_filter(0)
-#if QT_CONFIG(evr)
- , m_evrPresenter(0)
-#endif
{
}
diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.h b/src/plugins/directshow/player/directshowvideorenderercontrol.h
index b2abeeae..09d66b13 100644
--- a/src/plugins/directshow/player/directshowvideorenderercontrol.h
+++ b/src/plugins/directshow/player/directshowvideorenderercontrol.h
@@ -71,10 +71,10 @@ Q_SIGNALS:
private:
DirectShowEventLoop *m_loop;
- QAbstractVideoSurface *m_surface;
- IBaseFilter *m_filter;
+ QAbstractVideoSurface *m_surface = nullptr;
+ IBaseFilter *m_filter = nullptr;
#if QT_CONFIG(evr)
- EVRCustomPresenter *m_evrPresenter;
+ EVRCustomPresenter *m_evrPresenter = nullptr;
#endif
};
diff --git a/src/plugins/directshow/player/videosurfacefilter.cpp b/src/plugins/directshow/player/videosurfacefilter.cpp
index 70159d5e..bb06d187 100644
--- a/src/plugins/directshow/player/videosurfacefilter.cpp
+++ b/src/plugins/directshow/player/videosurfacefilter.cpp
@@ -222,20 +222,10 @@ HRESULT VideoSurfaceInputPin::Receive(IMediaSample *pMediaSample)
VideoSurfaceFilter::VideoSurfaceFilter(QAbstractVideoSurface *surface, DirectShowEventLoop *loop, QObject *parent)
: QObject(parent)
, m_loop(loop)
- , m_pin(NULL)
, m_surface(surface)
- , m_bytesPerLine(0)
- , m_surfaceStarted(false)
, m_renderMutex(QMutex::Recursive)
- , m_running(false)
- , m_pendingSample(NULL)
- , m_pendingSampleEndTime(0)
, m_renderEvent(CreateEvent(NULL, FALSE, FALSE, NULL))
, m_flushEvent(CreateEvent(NULL, TRUE, FALSE, NULL))
- , m_adviseCookie(0)
- , m_EOS(false)
- , m_EOSDelivered(false)
- , m_EOSTimer(0)
{
supportedFormatsChanged();
connect(surface, &QAbstractVideoSurface::supportedFormatsChanged,
diff --git a/src/plugins/directshow/player/videosurfacefilter.h b/src/plugins/directshow/player/videosurfacefilter.h
index 56791f27..91f1b28a 100644
--- a/src/plugins/directshow/player/videosurfacefilter.h
+++ b/src/plugins/directshow/player/videosurfacefilter.h
@@ -130,28 +130,28 @@ private:
QMutex m_mutex;
DirectShowEventLoop *m_loop;
- VideoSurfaceInputPin *m_pin;
+ VideoSurfaceInputPin *m_pin = nullptr;
QWaitCondition m_waitSurface;
QAbstractVideoSurface *m_surface;
QVideoSurfaceFormat m_surfaceFormat;
- int m_bytesPerLine;
- bool m_surfaceStarted;
+ int m_bytesPerLine = 0;
+ bool m_surfaceStarted = false;
QList<GUID> m_supportedTypes;
QReadWriteLock m_typesLock;
QMutex m_renderMutex;
- bool m_running;
- IMediaSample *m_pendingSample;
- REFERENCE_TIME m_pendingSampleEndTime;
+ bool m_running = false;
+ IMediaSample *m_pendingSample = nullptr;
+ REFERENCE_TIME m_pendingSampleEndTime = 0;
HANDLE m_renderEvent;
HANDLE m_flushEvent;
- DWORD_PTR m_adviseCookie;
+ DWORD_PTR m_adviseCookie = 0;
- bool m_EOS;
- bool m_EOSDelivered;
- UINT m_EOSTimer;
+ bool m_EOS = false;
+ bool m_EOSDelivered = false;
+ UINT m_EOSTimer = 0;
friend class VideoSurfaceInputPin;
};
diff --git a/src/plugins/directshow/player/vmr9videowindowcontrol.cpp b/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
index c026a12d..76444be0 100644
--- a/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
+++ b/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
@@ -49,15 +49,6 @@
Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
: QVideoWindowControl(parent)
, m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9))
- , m_windowId(0)
- , m_windowColor(RGB(0, 0, 0))
- , m_dirtyValues(0)
- , m_aspectRatioMode(Qt::KeepAspectRatio)
- , m_brightness(0)
- , m_contrast(0)
- , m_hue(0)
- , m_saturation(0)
- , m_fullScreen(false)
{
if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter, IID_IVMRFilterConfig9)) {
config->SetRenderingMode(VMR9Mode_Windowless);
diff --git a/src/plugins/directshow/player/vmr9videowindowcontrol.h b/src/plugins/directshow/player/vmr9videowindowcontrol.h
index 8ab9bd50..c814c2c8 100644
--- a/src/plugins/directshow/player/vmr9videowindowcontrol.h
+++ b/src/plugins/directshow/player/vmr9videowindowcontrol.h
@@ -91,16 +91,16 @@ private:
IVMRMixerControl9 *control, VMR9ProcAmpControlFlags property, int value) const;
IBaseFilter *m_filter;
- WId m_windowId;
- COLORREF m_windowColor;
- DWORD m_dirtyValues;
- Qt::AspectRatioMode m_aspectRatioMode;
+ WId m_windowId = 0;
+ COLORREF m_windowColor = RGB(0, 0, 0);
+ DWORD m_dirtyValues = 0;
+ Qt::AspectRatioMode m_aspectRatioMode = Qt::KeepAspectRatio;
QRect m_displayRect;
- int m_brightness;
- int m_contrast;
- int m_hue;
- int m_saturation;
- bool m_fullScreen;
+ int m_brightness = 0;
+ int m_contrast = 0;
+ int m_hue = 0;
+ int m_saturation = 0;
+ bool m_fullScreen = false;
};
QT_END_NAMESPACE