summaryrefslogtreecommitdiffstats
path: root/src/plugins/common/evr
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-05 09:28:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-05 12:15:15 +0000
commit8421bdc381c3c64b3733dda5aec9d422282989d4 (patch)
treee9b74ae45dcdd7cb8997123e0cb4352ed673e8a3 /src/plugins/common/evr
parenta9789cf46b19726e201069e9d4dfee48f0570691 (diff)
DirectShow: Fix clang-tidy warnings about C-style casts
Replace by reinterpret_cast<>. Change-Id: Iebcac7858d875e2d6f53db21489d86beb19ba947 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/common/evr')
-rw-r--r--src/plugins/common/evr/evrcustompresenter.cpp40
-rw-r--r--src/plugins/common/evr/evrhelpers.h4
2 files changed, 28 insertions, 16 deletions
diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp
index d5d9df14f..fd3054b0b 100644
--- a/src/plugins/common/evr/evrcustompresenter.cpp
+++ b/src/plugins/common/evr/evrcustompresenter.cpp
@@ -1365,18 +1365,21 @@ HRESULT EVRCustomPresenter::createOptimalVideoType(IMFMediaType *proposedType, I
if (FAILED(hr))
goto done;
- hr = mtOptimal->SetBlob(MF_MT_GEOMETRIC_APERTURE, (UINT8*)&displayArea, sizeof(displayArea));
+ hr = mtOptimal->SetBlob(MF_MT_GEOMETRIC_APERTURE, reinterpret_cast<UINT8*>(&displayArea),
+ sizeof(displayArea));
if (FAILED(hr))
goto done;
// Set the pan/scan aperture and the minimum display aperture. We don't care
// about them per se, but the mixer will reject the type if these exceed the
// frame dimentions.
- hr = mtOptimal->SetBlob(MF_MT_PAN_SCAN_APERTURE, (UINT8*)&displayArea, sizeof(displayArea));
+ hr = mtOptimal->SetBlob(MF_MT_PAN_SCAN_APERTURE, reinterpret_cast<UINT8*>(&displayArea),
+ sizeof(displayArea));
if (FAILED(hr))
goto done;
- hr = mtOptimal->SetBlob(MF_MT_MINIMUM_DISPLAY_APERTURE, (UINT8*)&displayArea, sizeof(displayArea));
+ hr = mtOptimal->SetBlob(MF_MT_MINIMUM_DISPLAY_APERTURE, reinterpret_cast<UINT8*>(&displayArea),
+ sizeof(displayArea));
if (FAILED(hr))
goto done;
@@ -1474,7 +1477,7 @@ HRESULT EVRCustomPresenter::isMediaTypeSupported(IMFMediaType *proposed)
UINT32 width = 0, height = 0;
// Validate the format.
- HRESULT hr = qt_evr_getFourCC(proposed, (DWORD*)&d3dFormat);
+ HRESULT hr = qt_evr_getFourCC(proposed, reinterpret_cast<DWORD*>(&d3dFormat));
if (FAILED(hr))
return hr;
@@ -1503,7 +1506,7 @@ HRESULT EVRCustomPresenter::isMediaTypeSupported(IMFMediaType *proposed)
return hr;
// Reject interlaced formats.
- hr = proposed->GetUINT32(MF_MT_INTERLACE_MODE, (UINT32*)&interlaceMode);
+ hr = proposed->GetUINT32(MF_MT_INTERLACE_MODE, reinterpret_cast<UINT32*>(&interlaceMode));
if (FAILED(hr))
return hr;
@@ -1518,15 +1521,21 @@ HRESULT EVRCustomPresenter::isMediaTypeSupported(IMFMediaType *proposed)
// Any of these apertures may be unspecified in the media type, in which case
// we ignore it. We just want to reject invalid apertures.
- if (SUCCEEDED(proposed->GetBlob(MF_MT_PAN_SCAN_APERTURE, (UINT8*)&videoCropArea, sizeof(videoCropArea), NULL)))
+ if (SUCCEEDED(proposed->GetBlob(MF_MT_PAN_SCAN_APERTURE,
+ reinterpret_cast<UINT8*>(&videoCropArea),
+ sizeof(videoCropArea), nullptr))) {
hr = qt_evr_validateVideoArea(videoCropArea, width, height);
-
- if (SUCCEEDED(proposed->GetBlob(MF_MT_GEOMETRIC_APERTURE, (UINT8*)&videoCropArea, sizeof(videoCropArea), NULL)))
+ }
+ if (SUCCEEDED(proposed->GetBlob(MF_MT_GEOMETRIC_APERTURE,
+ reinterpret_cast<UINT8*>(&videoCropArea),
+ sizeof(videoCropArea), nullptr))) {
hr = qt_evr_validateVideoArea(videoCropArea, width, height);
-
- if (SUCCEEDED(proposed->GetBlob(MF_MT_MINIMUM_DISPLAY_APERTURE, (UINT8*)&videoCropArea, sizeof(videoCropArea), NULL)))
+ }
+ if (SUCCEEDED(proposed->GetBlob(MF_MT_MINIMUM_DISPLAY_APERTURE,
+ reinterpret_cast<UINT8*>(&videoCropArea),
+ sizeof(videoCropArea), nullptr))) {
hr = qt_evr_validateVideoArea(videoCropArea, width, height);
-
+ }
return hr;
}
@@ -1642,7 +1651,7 @@ HRESULT EVRCustomPresenter::processOutput()
m_clock->GetCorrelatedTime(0, &mixerEndTime, &systemTime);
LONGLONG latencyTime = mixerEndTime - mixerStartTime;
- notifyEvent(EC_PROCESSING_LATENCY, (LONG_PTR)&latencyTime, 0);
+ notifyEvent(EC_PROCESSING_LATENCY, reinterpret_cast<LONG_PTR>(&latencyTime), 0);
}
// Set up notification for when the sample is released.
@@ -1734,7 +1743,7 @@ HRESULT EVRCustomPresenter::deliverFrameStepSample(IMFSample *sample)
if (FAILED(hr))
goto done;
- m_frameStep.sampleNoRef = (DWORD_PTR)unk; // No add-ref.
+ m_frameStep.sampleNoRef = reinterpret_cast<DWORD_PTR>(unk); // No add-ref.
// NOTE: We do not AddRef the IUnknown pointer, because that would prevent the
// sample from invoking the OnSampleFree callback after the sample is presented.
@@ -1807,7 +1816,7 @@ HRESULT EVRCustomPresenter::onSampleFree(IMFAsyncResult *result)
if (FAILED(hr))
goto done;
- if (m_frameStep.sampleNoRef == (DWORD_PTR)unk) {
+ if (m_frameStep.sampleNoRef == reinterpret_cast<DWORD_PTR>(unk)) {
// Notify the EVR.
hr = completeFrameStep(sample);
if (FAILED(hr))
@@ -1997,7 +2006,8 @@ HRESULT setMixerSourceRect(IMFTransform *mixer, const MFVideoNormalizedRect &sou
HRESULT hr = mixer->GetAttributes(&attributes);
if (SUCCEEDED(hr)) {
- hr = attributes->SetBlob(video_ZOOM_RECT, (const UINT8*)&sourceRect, sizeof(sourceRect));
+ hr = attributes->SetBlob(video_ZOOM_RECT, reinterpret_cast<const UINT8*>(&sourceRect),
+ sizeof(sourceRect));
attributes->Release();
}
return hr;
diff --git a/src/plugins/common/evr/evrhelpers.h b/src/plugins/common/evr/evrhelpers.h
index 527612c45..b5bdf5ead 100644
--- a/src/plugins/common/evr/evrhelpers.h
+++ b/src/plugins/common/evr/evrhelpers.h
@@ -87,7 +87,9 @@ inline MFVideoArea qt_evr_makeMFArea(float x, float y, DWORD width, DWORD height
inline HRESULT qt_evr_getFrameRate(IMFMediaType *pType, MFRatio *pRatio)
{
- return MFGetAttributeRatio(pType, MF_MT_FRAME_RATE, (UINT32*)&pRatio->Numerator, (UINT32*)&pRatio->Denominator);
+ return MFGetAttributeRatio(pType, MF_MT_FRAME_RATE,
+ reinterpret_cast<UINT32*>(&pRatio->Numerator),
+ reinterpret_cast<UINT32*>(&pRatio->Denominator));
}
QVideoFrame::PixelFormat qt_evr_pixelFormatFromD3DFormat(DWORD format);