diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-05-07 23:51:09 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-05-09 16:57:30 +0400 |
commit | 2acb3c5749326e59f6f2c6f48692a32dc7e705f5 (patch) | |
tree | 4b6985d401ea648b1562c3b4a6bb868e61c5105d /src/filters/transform | |
parent | ae3db48090dc9837fbb439503075521e356dcfa7 (diff) |
Use nullptr instead of NULL whenever possible.
Microsoft recommends to avoid using NULL or zero (0) as a null pointer constant since nullptr is less vulnerable to misuse and works better in most situations.
Also fix some cases where NULL was used instead of 0 or FALSE.
Diffstat (limited to 'src/filters/transform')
26 files changed, 409 insertions, 409 deletions
diff --git a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp index 2692758a7..b3424e517 100644 --- a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp +++ b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -41,8 +41,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -50,7 +50,7 @@ const AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAVI2AC3Filter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAVI2AC3Filter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -91,7 +91,7 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl {
HRESULT hr;
- BYTE* pIn = NULL;
+ BYTE* pIn = nullptr;
if (FAILED(hr = pSample->GetPointer(&pIn))) {
return hr;
}
@@ -102,7 +102,7 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl return S_FALSE;
}
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
if (FAILED(hr = pOutSample->GetPointer(&pOut))) {
return hr;
}
@@ -154,11 +154,11 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl fDiscontinuity = false;
} else {
- pOutSample->SetTime(NULL, NULL);
+ pOutSample->SetTime(nullptr, nullptr);
pOutSample->SetDiscontinuity(FALSE);
}
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
if (FAILED(hr = pOutSample->GetPointer(&pOut))) {
return hr;
}
diff --git a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp index e54beb624..ee87da93b 100644 --- a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp +++ b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp @@ -54,7 +54,7 @@ CBaseVideoFilter::CBaseVideoFilter(TCHAR* pName, LPUNKNOWN lpunk, HRESULT* phr, *phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
@@ -90,7 +90,7 @@ CBasePin* CBaseVideoFilter::GetPin(int n) case 1:
return m_pOutput;
}
- return NULL;
+ return nullptr;
}
HRESULT CBaseVideoFilter::Receive(IMediaSample* pIn)
@@ -133,7 +133,7 @@ HRESULT CBaseVideoFilter::GetDeliveryBuffer(int w, int h, IMediaSample** ppOut) return hr;
}
- if (FAILED(hr = m_pOutput->GetDeliveryBuffer(ppOut, NULL, NULL, 0))) {
+ if (FAILED(hr = m_pOutput->GetDeliveryBuffer(ppOut, nullptr, nullptr, 0))) {
return hr;
}
@@ -188,7 +188,7 @@ HRESULT CBaseVideoFilter::ReconnectOutput(int w, int h, bool bSendSample, int re return E_FAIL;
}
- BITMAPINFOHEADER* bmi = NULL;
+ BITMAPINFOHEADER* bmi = nullptr;
if (mt.formattype == FORMAT_VideoInfo) {
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.Format();
@@ -227,7 +227,7 @@ HRESULT CBaseVideoFilter::ReconnectOutput(int w, int h, bool bSendSample, int re CComPtr<IMediaSample> pOut;
if (SUCCEEDED(m_pOutput->GetConnected()->ReceiveConnection(m_pOutput, &mt))) {
if (bSendSample) {
- if (SUCCEEDED(m_pOutput->GetDeliveryBuffer(&pOut, NULL, NULL, 0))) {
+ if (SUCCEEDED(m_pOutput->GetDeliveryBuffer(&pOut, nullptr, nullptr, 0))) {
AM_MEDIA_TYPE* pmt;
if (SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
CMediaType mt2 = *pmt;
@@ -634,7 +634,7 @@ HRESULT CBaseVideoFilter::SetMediaType(PIN_DIRECTION dir, const CMediaType* pmt) //
CBaseVideoInputAllocator::CBaseVideoInputAllocator(HRESULT* phr)
- : CMemAllocator(NAME("CBaseVideoInputAllocator"), NULL, phr)
+ : CMemAllocator(NAME("CBaseVideoInputAllocator"), nullptr, phr)
{
if (phr) {
*phr = S_OK;
@@ -668,7 +668,7 @@ STDMETHODIMP CBaseVideoInputAllocator::GetBuffer(IMediaSample** ppBuffer, REFERE CBaseVideoInputPin::CBaseVideoInputPin(TCHAR* pObjectName, CBaseVideoFilter* pFilter, HRESULT* phr, LPCWSTR pName)
: CTransformInputPin(pObjectName, pFilter, phr, pName)
- , m_pAllocator(NULL)
+ , m_pAllocator(nullptr)
{
}
@@ -681,7 +681,7 @@ STDMETHODIMP CBaseVideoInputPin::GetAllocator(IMemAllocator** ppAllocator) {
CheckPointer(ppAllocator, E_POINTER);
- if (m_pAllocator == NULL) {
+ if (m_pAllocator == nullptr) {
HRESULT hr = S_OK;
m_pAllocator = DEBUG_NEW CBaseVideoInputAllocator(&hr);
m_pAllocator->AddRef();
diff --git a/src/filters/transform/BufferFilter/BufferFilter.cpp b/src/filters/transform/BufferFilter/BufferFilter.cpp index 5b195a6ca..f40a4bc39 100644 --- a/src/filters/transform/BufferFilter/BufferFilter.cpp +++ b/src/filters/transform/BufferFilter/BufferFilter.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -34,8 +34,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -43,7 +43,7 @@ const AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -88,7 +88,7 @@ CBufferFilter::CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr) hr = E_OUTOFMEMORY;
}
if (FAILED(hr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
break;
}
} while (false);
@@ -157,7 +157,7 @@ HRESULT CBufferFilter::Receive(IMediaSample* pSample) ASSERT(pSample);
IMediaSample* pOutSample;
- ASSERT(m_pOutput != NULL);
+ ASSERT(m_pOutput != nullptr);
// Set up the output sample
hr = InitializeOutputSample(pSample, &pOutSample);
@@ -215,8 +215,8 @@ HRESULT CBufferFilter::Receive(IMediaSample* pSample) HRESULT CBufferFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
{
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
pIn->GetPointer(&pDataIn);
pOut->GetPointer(&pDataOut);
diff --git a/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp b/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp index b2e1044a9..c9f1cc143 100644 --- a/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp +++ b/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -37,8 +37,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -46,7 +46,7 @@ const AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDeCSSFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDeCSSFilter>, nullptr, &sudFilter[0]},
};
int g_cTemplates = _countof(g_Templates);
@@ -119,7 +119,7 @@ CDeCSSFilter::CDeCSSFilter(LPUNKNOWN lpunk, HRESULT* phr) *phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
}
@@ -140,8 +140,8 @@ HRESULT CDeCSSFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) DeleteMediaType(pmt);
}
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
pIn->GetPointer(&pDataIn);
pOut->GetPointer(&pDataOut);
@@ -149,7 +149,7 @@ HRESULT CDeCSSFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) long len = pIn->GetActualDataLength();
long size = pOut->GetSize();
- if (len == 0 || pDataIn == NULL) { // format changes do not carry any data
+ if (len == 0 || pDataIn == nullptr) { // format changes do not carry any data
pOut->SetActualDataLength(0);
return S_OK;
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp index 23b07dcba..3b343921b 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp @@ -117,7 +117,7 @@ void CDXVADecoder::Flush() m_pPictureStore[i].bRefPicture = false;
m_pPictureStore[i].bInUse = false;
m_pPictureStore[i].bDisplayed = false;
- m_pPictureStore[i].pSample = NULL;
+ m_pPictureStore[i].pSample = nullptr;
m_pPictureStore[i].nCodecSpecific = -1;
m_pPictureStore[i].dwDisplayCount = 0;
}
@@ -126,7 +126,7 @@ void CDXVADecoder::Flush() m_bFlushed = true;
m_nFieldSurface = -1;
m_dwDisplayCount = 1;
- m_pFieldSample = NULL;
+ m_pFieldSample = nullptr;
}
HRESULT CDXVADecoder::ConfigureDXVA1()
@@ -142,7 +142,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1() ConfigRequested.bConfigBitstreamRaw = 2;
writeDXVA_QueryOrReplyFunc(&ConfigRequested.dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- hr = m_pAMVideoAccelerator->Execute(ConfigRequested.dwFunction, &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(ConfigRequested.dwFunction, &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), 0, nullptr);
// Copy to DXVA2 structure (simplify code based on accelerator config)
m_DXVA2Config.guidConfigBitstreamEncryption = m_DXVA1Config.guidConfigBitstreamEncryption;
@@ -163,7 +163,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1() if (SUCCEEDED(hr)) {
writeDXVA_QueryOrReplyFunc(&m_DXVA1Config.dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- hr = m_pAMVideoAccelerator->Execute(m_DXVA1Config.dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(m_DXVA1Config.dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), 0, nullptr);
// TODO : check config!
//ASSERT (ConfigRequested.bConfigBitstreamRaw == 2);
@@ -181,7 +181,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1() CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IAMVideoAccelerator* pAMVideoAccelerator, const GUID* guidDecoder, int nPicEntryNumber)
{
- CDXVADecoder* pDecoder = NULL;
+ CDXVADecoder* pDecoder = nullptr;
if ((*guidDecoder == DXVA2_ModeH264_E) || (*guidDecoder == DXVA2_ModeH264_F) || (*guidDecoder == DXVA_Intel_H264_ClearVideo)) {
pDecoder = DEBUG_NEW CDXVADecoderH264(pFilter, pAMVideoAccelerator, H264_VLD, nPicEntryNumber);
@@ -198,7 +198,7 @@ CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IAMVideoA CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IDirectXVideoDecoder* pDirectXVideoDec, const GUID* guidDecoder, int nPicEntryNumber, DXVA2_ConfigPictureDecode* pDXVA2Config)
{
- CDXVADecoder* pDecoder = NULL;
+ CDXVADecoder* pDecoder = nullptr;
if ((*guidDecoder == DXVA2_ModeH264_E) || (*guidDecoder == DXVA2_ModeH264_F) || (*guidDecoder == DXVA_Intel_H264_ClearVideo)) {
pDecoder = DEBUG_NEW CDXVADecoderH264(pFilter, pDirectXVideoDec, H264_VLD, nPicEntryNumber, pDXVA2Config);
@@ -299,7 +299,7 @@ HRESULT CDXVADecoder::GetDeliveryBuffer(REFERENCE_TIME rtStart, REFERENCE_TIME r if (SUCCEEDED(hr)) {
pNewSample->SetTime(&rtStart, &rtStop);
- pNewSample->SetMediaTime(NULL, NULL);
+ pNewSample->SetMediaTime(nullptr, nullptr);
*ppSampleToDeliver = pNewSample.Detach();
}
return hr;
@@ -315,7 +315,7 @@ HRESULT CDXVADecoder::Execute() HRESULT hr2;
//writeDXVA_QueryOrReplyFunc(&dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- //hr = m_pAMVideoAccelerator->Execute (dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), NULL, 0, m_dwNumBuffersInfo, m_DXVA1BufferInfo);
+ //hr = m_pAMVideoAccelerator->Execute (dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), nullptr, 0, m_dwNumBuffersInfo, m_DXVA1BufferInfo);
DWORD dwResult;
dwFunction = 0x01000000;
@@ -356,7 +356,7 @@ HRESULT CDXVADecoder::QueryStatus(PVOID LPDXVAStatus, UINT nSize) switch (m_nEngine) {
case ENGINE_DXVA1:
- hr = m_pAMVideoAccelerator->Execute(dwFunction, NULL, 0, LPDXVAStatus, nSize, 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(dwFunction, nullptr, 0, LPDXVAStatus, nSize, 0, nullptr);
break;
case ENGINE_DXVA2:
@@ -420,7 +420,7 @@ HRESULT CDXVADecoder::BeginFrame(int nSurfaceIndex, IMediaSample* pSampleToDeliv BeginFrameInfo.dwSizeInputData = sizeof(nSurfaceIndex);
BeginFrameInfo.pInputData = &nSurfaceIndex;
BeginFrameInfo.dwSizeOutputData = 0;
- BeginFrameInfo.pOutputData = NULL;
+ BeginFrameInfo.pOutputData = nullptr;
DO_DXVA_PENDING_LOOP(m_pAMVideoAccelerator->BeginFrame(&BeginFrameInfo));
@@ -437,7 +437,7 @@ HRESULT CDXVADecoder::BeginFrame(int nSurfaceIndex, IMediaSample* pSampleToDeliv if (pSampleService) {
hr = pSampleService->GetService(MR_BUFFER_SERVICE, __uuidof(IDirect3DSurface9), (void**) &pDecoderRenderTarget);
if (SUCCEEDED(hr)) {
- DO_DXVA_PENDING_LOOP(m_pDirectXVideoDec->BeginFrame(pDecoderRenderTarget, NULL));
+ DO_DXVA_PENDING_LOOP(m_pDirectXVideoDec->BeginFrame(pDecoderRenderTarget, nullptr));
}
}
}
@@ -473,7 +473,7 @@ HRESULT CDXVADecoder::EndFrame(int nSurfaceIndex) break;
case ENGINE_DXVA2:
- hr = m_pDirectXVideoDec->EndFrame(NULL);
+ hr = m_pDirectXVideoDec->EndFrame(nullptr);
break;
default:
ASSERT(FALSE);
@@ -499,9 +499,9 @@ bool CDXVADecoder::AddToStore(int nSurfaceIndex, IMediaSample* pSample, bool bRe } else {
//TRACE(_T("Add Stor: [%10I64d - %10I64d], Ind = %d, Codec=%d\n"), rtStart, rtStop, nSurfaceIndex, nCodecSpecific);
/*
- ASSERT(m_pPictureStore[nSurfaceIndex].pSample == NULL);
+ ASSERT(m_pPictureStore[nSurfaceIndex].pSample == nullptr);
ASSERT(!m_pPictureStore[nSurfaceIndex].bInUse);
- ASSERT((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == NULL));
+ ASSERT((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == nullptr));
*/
m_pPictureStore[nSurfaceIndex].bRefPicture = bRefPicture;
@@ -707,7 +707,7 @@ void CDXVADecoder::FreePictureSlot(int nSurfaceIndex) m_pPictureStore[nSurfaceIndex].dwDisplayCount = m_dwDisplayCount++;
m_pPictureStore[nSurfaceIndex].bInUse = false;
m_pPictureStore[nSurfaceIndex].bDisplayed = false;
- m_pPictureStore[nSurfaceIndex].pSample = NULL;
+ m_pPictureStore[nSurfaceIndex].pSample = nullptr;
m_pPictureStore[nSurfaceIndex].nCodecSpecific = -1;
m_nWaitingPics--;
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp index 68c40d362..71ffbe82a 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp @@ -1,5 +1,5 @@ /*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -335,7 +335,7 @@ void CDXVADecoderH264::SetExtraData(BYTE* pDataIn, UINT nSize) AVCodecContext* pAVCtx = m_pFilter->GetAVCtx();
m_nNALLength = pAVCtx->nal_length_size;
- FFH264DecodeBuffer(pAVCtx, pDataIn, nSize, NULL, NULL, NULL);
+ FFH264DecodeBuffer(pAVCtx, pDataIn, nSize, nullptr, nullptr, nullptr);
FFH264SetDxvaSliceLong(pAVCtx, m_pSliceLong);
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp index 6037452c2..286ba9d0c 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp @@ -91,7 +91,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME if (!m_PictureParams.bSecondField) {
m_rtStart = rtStart;
m_rtStop = rtStop;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
hr = GetFreeSurfaceIndex(m_nSurfaceIndex, &m_pSampleToDeliver, rtStart, rtStop);
if (FAILED(hr)) {
ASSERT(hr == VFW_E_NOT_COMMITTED); // Normal when stop playing
@@ -101,7 +101,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME } else {
m_rtStart = rtStart;
m_rtStop = rtStop;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
hr = GetFreeSurfaceIndex(m_nSurfaceIndex, &m_pSampleToDeliver, rtStart, rtStop);
if (FAILED(hr)) {
ASSERT(hr == VFW_E_NOT_COMMITTED); // Normal when stop playing
@@ -110,7 +110,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME }
// m_pSampleToDeliver is unused for DXVA1
- if (GetEngine() == ENGINE_DXVA2 && m_pSampleToDeliver == NULL) {
+ if (GetEngine() == ENGINE_DXVA2 && m_pSampleToDeliver == nullptr) {
return S_FALSE;
}
@@ -236,7 +236,7 @@ void CDXVADecoderMpeg2::Flush() m_wRefPictureIndex[1] = NO_REF_FRAME;
m_nSurfaceIndex = 0;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
m_bSecondField = false;
m_rtStart = _I64_MIN;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp index 3e2bc0aed..a08b414b1 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp @@ -1,5 +1,5 @@ /*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -142,7 +142,7 @@ HRESULT CDXVADecoderVC1::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME r // ***************
if (nFrameSize) { // Decoding Second Field
- FFVC1UpdatePictureParam(&m_PictureParams, m_pFilter->GetAVCtx(), NULL, NULL, pDataIn, nSize, NULL, TRUE, &m_bFrame_repeat_pict);
+ FFVC1UpdatePictureParam(&m_PictureParams, m_pFilter->GetAVCtx(), nullptr, nullptr, pDataIn, nSize, nullptr, TRUE, &m_bFrame_repeat_pict);
CHECK_HR_TRACE(BeginFrame(nSurfaceIndex, pSampleToDeliver));
@@ -250,7 +250,7 @@ BYTE* CDXVADecoderVC1::FindNextStartCode(BYTE* pBuffer, UINT nSize, UINT& nPacke ASSERT(FALSE); // Should never happen!
- return NULL;
+ return nullptr;
}
void CDXVADecoderVC1::CopyBitstream(BYTE* pDXVABuffer, BYTE* pBuffer, UINT& nSize)
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp index a5cd1877e..ee09201da 100644 --- a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp @@ -154,7 +154,7 @@ bool CheckPCID(WORD pcid, const WORD* pPCIDs, size_t len) inline MpegEncContext* GetMpegEncContext(struct AVCodecContext* pAVCtx)
{
Mpeg1Context* s1;
- MpegEncContext* s = NULL;
+ MpegEncContext* s = nullptr;
switch (pAVCtx->codec_id) {
case AV_CODEC_ID_VC1:
@@ -177,11 +177,11 @@ int FFH264DecodeBuffer(struct AVCodecContext* pAVCtx, REFERENCE_TIME* pOutrtStart)
{
int result = -1;
- if (pBuffer != NULL) {
+ if (pBuffer != nullptr) {
H264Context* h = (H264Context*) pAVCtx->priv_data;
result = av_h264_decode_frame(pAVCtx, pOutPOC, pOutrtStart, pBuffer, nSize);
- if (result != -1 && h->s.current_picture_ptr != NULL && pFramePOC) {
+ if (result != -1 && h->s.current_picture_ptr != nullptr && pFramePOC) {
*pFramePOC = h->s.current_picture_ptr->poc;
}
}
@@ -228,14 +228,14 @@ int FFH264CheckCompatibility(int nWidth, int profile_higher_than_high = 0;
int max_ref_frames_dpb41 = min(11, 8388608 / (nWidth * nHeight));
- if (pBuffer != NULL) {
- av_h264_decode_frame(pAVCtx, NULL, NULL, pBuffer, nSize);
+ if (pBuffer != nullptr) {
+ av_h264_decode_frame(pAVCtx, nullptr, nullptr, pBuffer, nSize);
}
cur_sps = pContext->sps_buffers[0];
cur_pps = pContext->pps_buffers[0];
- if (cur_sps != NULL) {
+ if (cur_sps != nullptr) {
int max_ref_frames = 0;
if (cur_sps->bit_depth_luma > 8 || cur_sps->chroma_format_idc > 1) {
@@ -470,14 +470,14 @@ void FFH264UpdateRefFramesList(DXVA_PicParams_H264* pDXVAPicParams, struct AVCod AssociatedFlag = pic->long_ref != 0;
} else {
// Long list reference frames
- pic = NULL;
+ pic = nullptr;
while (!pic && j < h->short_ref_count + 16) {
pic = h->long_ref[j++ - h->short_ref_count];
}
AssociatedFlag = 1;
}
- if (pic != NULL) {
+ if (pic != nullptr) {
pDXVAPicParams->FrameNumList[i] = pic->long_ref ? pic->pic_id : pic->frame_num;
pDXVAPicParams->FieldOrderCntList[i][0] = 0;
pDXVAPicParams->FieldOrderCntList[i][1] = 0;
@@ -833,7 +833,7 @@ unsigned long FFGetMBNumber(struct AVCodecContext* pAVCtx) {
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->mb_num : 0;
+ return (s != nullptr) ? s->mb_num : 0;
}
int FFIsSkipped(struct AVCodecContext* pAVCtx)
@@ -888,14 +888,14 @@ int FFGetCodedPicture(struct AVCodecContext* pAVCtx) {
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->current_picture.f.coded_picture_number : 0;
+ return (s != nullptr) ? s->current_picture.f.coded_picture_number : 0;
}
BOOL FFGetAlternateScan(struct AVCodecContext* pAVCtx)
{
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->alternate_scan : 0;
+ return (s != nullptr) ? s->alternate_scan : 0;
}
BOOL DXVACheckFramesize(int width, int height, DWORD nPCIVendor, DWORD nPCIDevice)
diff --git a/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp b/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp index b10403b6c..4528621d3 100644 --- a/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp +++ b/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp @@ -26,8 +26,8 @@ // Workaround: graphedit crashes when a filter exposes more than 115 input MediaTypes!
const AMOVIESETUP_PIN sudpPinsVideoDec[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, CMPCVideoDecFilter::sudPinTypesInCount > 115 ? 115 : CMPCVideoDecFilter::sudPinTypesInCount, CMPCVideoDecFilter::sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, CMPCVideoDecFilter::sudPinTypesOutCount, CMPCVideoDecFilter::sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, CMPCVideoDecFilter::sudPinTypesInCount > 115 ? 115 : CMPCVideoDecFilter::sudPinTypesInCount, CMPCVideoDecFilter::sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, CMPCVideoDecFilter::sudPinTypesOutCount, CMPCVideoDecFilter::sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilters[] = {
@@ -35,7 +35,7 @@ const AMOVIESETUP_FILTER sudFilters[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilters[0].strName, &__uuidof(CMPCVideoDecFilter), CreateInstance<CMPCVideoDecFilter>, NULL, &sudFilters[0]},
+ {sudFilters[0].strName, &__uuidof(CMPCVideoDecFilter), CreateInstance<CMPCVideoDecFilter>, nullptr, &sudFilters[0]},
{L"CMPCVideoDecPropertyPage", &__uuidof(CMPCVideoDecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>>},
{L"CMPCVideoDecPropertyPage2", &__uuidof(CMPCVideoDecCodecWnd), CreateInstance<CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>>},
};
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index 2ef06fb4b..853401ffc 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -114,51 +114,51 @@ DXVA_PARAMS DXVA_VC1 = { FFMPEG_CODECS ffCodecs[] = {
#if HAS_FFMPEG_VIDEO_DECODERS
// Flash video
- { &MEDIASUBTYPE_FLV1, AV_CODEC_ID_FLV1, NULL },
- { &MEDIASUBTYPE_flv1, AV_CODEC_ID_FLV1, NULL },
- { &MEDIASUBTYPE_FLV4, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_flv4, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_VP6F, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_vp6f, AV_CODEC_ID_VP6F, NULL },
+ { &MEDIASUBTYPE_FLV1, AV_CODEC_ID_FLV1, nullptr },
+ { &MEDIASUBTYPE_flv1, AV_CODEC_ID_FLV1, nullptr },
+ { &MEDIASUBTYPE_FLV4, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_flv4, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_VP6F, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_vp6f, AV_CODEC_ID_VP6F, nullptr },
// VP3
- { &MEDIASUBTYPE_VP30, AV_CODEC_ID_VP3, NULL },
- { &MEDIASUBTYPE_VP31, AV_CODEC_ID_VP3, NULL },
+ { &MEDIASUBTYPE_VP30, AV_CODEC_ID_VP3, nullptr },
+ { &MEDIASUBTYPE_VP31, AV_CODEC_ID_VP3, nullptr },
// VP5
- { &MEDIASUBTYPE_VP50, AV_CODEC_ID_VP5, NULL },
- { &MEDIASUBTYPE_vp50, AV_CODEC_ID_VP5, NULL },
+ { &MEDIASUBTYPE_VP50, AV_CODEC_ID_VP5, nullptr },
+ { &MEDIASUBTYPE_vp50, AV_CODEC_ID_VP5, nullptr },
// VP6
- { &MEDIASUBTYPE_VP60, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp60, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP61, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp61, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP62, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp62, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP6A, AV_CODEC_ID_VP6A, NULL },
- { &MEDIASUBTYPE_vp6a, AV_CODEC_ID_VP6A, NULL },
+ { &MEDIASUBTYPE_VP60, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp60, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP61, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp61, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP62, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp62, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP6A, AV_CODEC_ID_VP6A, nullptr },
+ { &MEDIASUBTYPE_vp6a, AV_CODEC_ID_VP6A, nullptr },
// VP8
- { &MEDIASUBTYPE_VP80, AV_CODEC_ID_VP8, NULL },
+ { &MEDIASUBTYPE_VP80, AV_CODEC_ID_VP8, nullptr },
// Xvid
- { &MEDIASUBTYPE_XVID, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_xvid, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_XVIX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_xvix, AV_CODEC_ID_MPEG4, NULL },
+ { &MEDIASUBTYPE_XVID, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_xvid, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_XVIX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_xvix, AV_CODEC_ID_MPEG4, nullptr },
// DivX
- { &MEDIASUBTYPE_DX50, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dx50, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DIVX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_divx, AV_CODEC_ID_MPEG4, NULL },
+ { &MEDIASUBTYPE_DX50, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dx50, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DIVX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_divx, AV_CODEC_ID_MPEG4, nullptr },
// WMV1/2/3
- { &MEDIASUBTYPE_WMV1, AV_CODEC_ID_WMV1, NULL },
- { &MEDIASUBTYPE_wmv1, AV_CODEC_ID_WMV1, NULL },
- { &MEDIASUBTYPE_WMV2, AV_CODEC_ID_WMV2, NULL },
- { &MEDIASUBTYPE_wmv2, AV_CODEC_ID_WMV2, NULL },
+ { &MEDIASUBTYPE_WMV1, AV_CODEC_ID_WMV1, nullptr },
+ { &MEDIASUBTYPE_wmv1, AV_CODEC_ID_WMV1, nullptr },
+ { &MEDIASUBTYPE_WMV2, AV_CODEC_ID_WMV2, nullptr },
+ { &MEDIASUBTYPE_wmv2, AV_CODEC_ID_WMV2, nullptr },
{ &MEDIASUBTYPE_WMV3, AV_CODEC_ID_WMV3, &DXVA_VC1 },
{ &MEDIASUBTYPE_wmv3, AV_CODEC_ID_WMV3, &DXVA_VC1 },
@@ -167,52 +167,52 @@ FFMPEG_CODECS ffCodecs[] = { { &MEDIASUBTYPE_MPG2, AV_CODEC_ID_MPEG2VIDEO, &DXVA_Mpeg2 },
// MSMPEG-4
- { &MEDIASUBTYPE_DIV3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DVX3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_dvx3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_MP43, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_mp43, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_COL1, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_col1, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV4, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div4, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV5, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div5, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV6, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div6, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_AP41, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_ap41, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_MPG3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_mpg3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV2, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_div2, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_MP42, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_mp42, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_MPG4, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_mpg4, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_DIV1, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_div1, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_MP41, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_mp41, AV_CODEC_ID_MSMPEG4V1, NULL },
+ { &MEDIASUBTYPE_DIV3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DVX3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_dvx3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_MP43, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_mp43, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_COL1, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_col1, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV4, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div4, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV5, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div5, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV6, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div6, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_AP41, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_ap41, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_MPG3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_mpg3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV2, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_div2, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_MP42, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_mp42, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_MPG4, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_mpg4, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_DIV1, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_div1, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_MP41, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_mp41, AV_CODEC_ID_MSMPEG4V1, nullptr },
// AMV Video
- { &MEDIASUBTYPE_AMVV, AV_CODEC_ID_AMV, NULL },
+ { &MEDIASUBTYPE_AMVV, AV_CODEC_ID_AMV, nullptr },
// MJPEG
- { &MEDIASUBTYPE_MJPG, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_QTJpeg, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_MJPA, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_MJPB, AV_CODEC_ID_MJPEGB, NULL },
+ { &MEDIASUBTYPE_MJPG, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_QTJpeg, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_MJPA, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_MJPB, AV_CODEC_ID_MJPEGB, nullptr },
// TSCC
- { &MEDIASUBTYPE_TSCC, AV_CODEC_ID_TSCC, NULL },
+ { &MEDIASUBTYPE_TSCC, AV_CODEC_ID_TSCC, nullptr },
// Indeo 3/4/5
- { &MEDIASUBTYPE_IV31, AV_CODEC_ID_INDEO3, NULL },
- { &MEDIASUBTYPE_IV32, AV_CODEC_ID_INDEO3, NULL },
- { &MEDIASUBTYPE_IV41, AV_CODEC_ID_INDEO4, NULL },
- { &MEDIASUBTYPE_IV50, AV_CODEC_ID_INDEO5, NULL },
+ { &MEDIASUBTYPE_IV31, AV_CODEC_ID_INDEO3, nullptr },
+ { &MEDIASUBTYPE_IV32, AV_CODEC_ID_INDEO3, nullptr },
+ { &MEDIASUBTYPE_IV41, AV_CODEC_ID_INDEO4, nullptr },
+ { &MEDIASUBTYPE_IV50, AV_CODEC_ID_INDEO5, nullptr },
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// H264/AVC
@@ -232,27 +232,27 @@ FFMPEG_CODECS ffCodecs[] = { #if HAS_FFMPEG_VIDEO_DECODERS
// SVQ3
- { &MEDIASUBTYPE_SVQ3, AV_CODEC_ID_SVQ3, NULL },
+ { &MEDIASUBTYPE_SVQ3, AV_CODEC_ID_SVQ3, nullptr },
// SVQ1
- { &MEDIASUBTYPE_SVQ1, AV_CODEC_ID_SVQ1, NULL },
+ { &MEDIASUBTYPE_SVQ1, AV_CODEC_ID_SVQ1, nullptr },
// H263
- { &MEDIASUBTYPE_H263, AV_CODEC_ID_H263, NULL },
- { &MEDIASUBTYPE_h263, AV_CODEC_ID_H263, NULL },
+ { &MEDIASUBTYPE_H263, AV_CODEC_ID_H263, nullptr },
+ { &MEDIASUBTYPE_h263, AV_CODEC_ID_H263, nullptr },
- { &MEDIASUBTYPE_S263, AV_CODEC_ID_H263, NULL },
- { &MEDIASUBTYPE_s263, AV_CODEC_ID_H263, NULL },
+ { &MEDIASUBTYPE_S263, AV_CODEC_ID_H263, nullptr },
+ { &MEDIASUBTYPE_s263, AV_CODEC_ID_H263, nullptr },
// Real Video
- { &MEDIASUBTYPE_RV10, AV_CODEC_ID_RV10, NULL },
- { &MEDIASUBTYPE_RV20, AV_CODEC_ID_RV20, NULL },
- { &MEDIASUBTYPE_RV30, AV_CODEC_ID_RV30, NULL },
- { &MEDIASUBTYPE_RV40, AV_CODEC_ID_RV40, NULL },
+ { &MEDIASUBTYPE_RV10, AV_CODEC_ID_RV10, nullptr },
+ { &MEDIASUBTYPE_RV20, AV_CODEC_ID_RV20, nullptr },
+ { &MEDIASUBTYPE_RV30, AV_CODEC_ID_RV30, nullptr },
+ { &MEDIASUBTYPE_RV40, AV_CODEC_ID_RV40, nullptr },
// Theora
- { &MEDIASUBTYPE_THEORA, AV_CODEC_ID_THEORA, NULL },
- { &MEDIASUBTYPE_theora, AV_CODEC_ID_THEORA, NULL },
+ { &MEDIASUBTYPE_THEORA, AV_CODEC_ID_THEORA, nullptr },
+ { &MEDIASUBTYPE_theora, AV_CODEC_ID_THEORA, nullptr },
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// WVC1
@@ -261,46 +261,46 @@ FFMPEG_CODECS ffCodecs[] = { #if HAS_FFMPEG_VIDEO_DECODERS
// Other MPEG-4
- { &MEDIASUBTYPE_MP4V, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_mp4v, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_M4S2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_m4s2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_MP4S, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_mp4s, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IV1, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3iv1, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IV2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3iv2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IVX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3ivx, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_BLZ0, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_blz0, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DM4V, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dm4v, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FFDS, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ffds, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FVFW, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_fvfw, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DXGM, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dxgm, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_fmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_HDX4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_hdx4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_LMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_lmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_NDIG, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ndig, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_RMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_rmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_SMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_smp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_SEDG, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_sedg, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_UMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ump4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_WV1F, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_wv1f, AV_CODEC_ID_MPEG4, NULL }
+ { &MEDIASUBTYPE_MP4V, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_mp4v, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_M4S2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_m4s2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_MP4S, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_mp4s, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IV1, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3iv1, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IV2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3iv2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IVX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3ivx, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_BLZ0, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_blz0, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DM4V, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dm4v, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FFDS, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ffds, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FVFW, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_fvfw, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DXGM, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dxgm, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_fmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_HDX4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_hdx4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_LMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_lmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_NDIG, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ndig, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_RMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_rmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_SMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_smp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_SEDG, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_sedg, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_UMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ump4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_WV1F, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_wv1f, AV_CODEC_ID_MPEG4, nullptr }
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
};
@@ -526,7 +526,7 @@ BOOL CALLBACK EnumFindProcessWnd(HWND hwnd, LPARAM lParam) CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
: CBaseVideoFilter(MPCVideoDecName, lpunk, phr, __uuidof(this))
{
- HWND hWnd = NULL;
+ HWND hWnd = nullptr;
if (SysVersion::IsVistaOrLater()) {
for (int i = 0; i < _countof(ffCodecs); i++) {
@@ -549,9 +549,9 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) }
m_pCpuId = DEBUG_NEW CCpuId();
- m_pAVCodec = NULL;
- m_pAVCtx = NULL;
- m_pFrame = NULL;
+ m_pAVCodec = nullptr;
+ m_pAVCtx = nullptr;
+ m_pFrame = nullptr;
m_nCodecNb = -1;
m_nCodecId = AV_CODEC_ID_NONE;
m_bReorderBFrame = true;
@@ -573,22 +573,22 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) m_nThreadNumber = 0;
m_nDiscardMode = AVDISCARD_DEFAULT;
m_bDXVACompatible = true;
- m_pFFBuffer = NULL;
+ m_pFFBuffer = nullptr;
m_nFFBufferSize = 0;
- m_pAlignedFFBuffer = NULL;
+ m_pAlignedFFBuffer = nullptr;
m_nAlignedFFBufferSize = 0;
ResetBuffer();
m_nWidth = 0;
m_nHeight = 0;
- m_pSwsContext = NULL;
+ m_pSwsContext = nullptr;
m_bUseDXVA = true;
m_bUseFFmpeg = true;
m_nDXVAMode = MODE_SOFTWARE;
- m_pDXVADecoder = NULL;
- m_pVideoOutputFormat = NULL;
+ m_pDXVADecoder = nullptr;
+ m_pVideoOutputFormat = nullptr;
m_nVideoOutputCount = 0;
m_hDevice = INVALID_HANDLE_VALUE;
@@ -950,14 +950,14 @@ void CMPCVideoDecFilter::Cleanup() #if HAS_FFMPEG_VIDEO_DECODERS
if (m_pSwsContext) {
sws_freeContext(m_pSwsContext);
- m_pSwsContext = NULL;
+ m_pSwsContext = nullptr;
}
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
- m_pAVCodec = NULL;
- m_pAVCtx = NULL;
- m_pFrame = NULL;
- m_pFFBuffer = NULL;
+ m_pAVCodec = nullptr;
+ m_pAVCtx = nullptr;
+ m_pFrame = nullptr;
+ m_pFFBuffer = nullptr;
m_nFFBufferSize = 0;
m_nFFBufferPos = 0;
m_nFFPicEnd = INT_MIN;
@@ -971,9 +971,9 @@ void CMPCVideoDecFilter::Cleanup() m_hDevice = INVALID_HANDLE_VALUE;
}
- m_pDeviceManager = NULL;
- m_pDecoderService = NULL;
- m_pDecoderRenderTarget = NULL;
+ m_pDeviceManager = nullptr;
+ m_pDecoderService = nullptr;
+ m_pDecoderRenderTarget = nullptr;
}
void CMPCVideoDecFilter::CalcAvgTimePerFrame()
@@ -1059,7 +1059,7 @@ CString CMPCVideoDecFilter::GetFileExtension() BeginEnumFilters(m_pGraph, pEF, pBF) {
CComQIPtr<IFileSourceFilter> pFSF = pBF;
if (pFSF) {
- LPOLESTR pFN = NULL;
+ LPOLESTR pFN = nullptr;
AM_MEDIA_TYPE mt;
if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
ext = CPath(CStringW(pFN)).GetExtension();
@@ -1141,7 +1141,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy m_pAVCtx->codec_tag = mpg2v->hdr.bmiHeader.biCompression;
m_pAVCtx->bits_per_coded_sample = mpg2v->hdr.bmiHeader.biBitCount;
- if (mpg2v->hdr.bmiHeader.biCompression == NULL) {
+ if (mpg2v->hdr.bmiHeader.biCompression == 0) {
m_pAVCtx->codec_tag = pmt->subtype.Data1;
} else if ((m_pAVCtx->codec_tag == MAKEFOURCC('a', 'v', 'c', '1')) || (m_pAVCtx->codec_tag == MAKEFOURCC('A', 'V', 'C', '1'))) {
m_pAVCtx->nal_length_size = mpg2v->dwFlags;
@@ -1184,7 +1184,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy ConnectTo(m_pAVCtx);
CalcAvgTimePerFrame();
- if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) < 0) {
+ if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) < 0) {
return VFW_E_INVALIDMEDIATYPE;
}
@@ -1234,7 +1234,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy if ((nThreadNumber > 1) && IsMultiThreadSupported(m_nCodecId)) {
FFSetThreadNumber(m_pAVCtx, m_nCodecId, nThreadNumber);
}
- if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) < 0) {
+ if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) < 0) {
return VFW_E_INVALIDMEDIATYPE;
}
}
@@ -1280,7 +1280,7 @@ bool CMPCVideoDecFilter::IsDXVASupported() {
if (m_nCodecNb != -1) {
// Does the codec suppport DXVA ?
- if (ffCodecs[m_nCodecNb].DXVAModes != NULL) {
+ if (ffCodecs[m_nCodecNb].DXVAModes != nullptr) {
// Enabled by user ?
if (m_bUseDXVA) {
// is the file compatible ?
@@ -1349,9 +1349,9 @@ void CMPCVideoDecFilter::AllocExtradata(AVCodecContext* pAVCtx, const CMediaType {
// code from LAV ...
// Process Extradata
- BYTE* extra = NULL;
+ BYTE* extra = nullptr;
unsigned int extralen = 0;
- getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), NULL, &extralen);
+ getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), nullptr, &extralen);
BOOL bH264avc = FALSE;
if (extralen > 0) {
@@ -1402,7 +1402,7 @@ void CMPCVideoDecFilter::AllocExtradata(AVCodecContext* pAVCtx, const CMediaType } else {
// Just copy extradata for other formats
extra = (uint8_t*)av_mallocz(extralen + FF_INPUT_BUFFER_PADDING_SIZE);
- getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), extra, NULL);
+ getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), extra, nullptr);
}
// Hack to discard invalid MP4 metadata with AnnexB style video
if (m_nCodecId == AV_CODEC_ID_H264 && !bH264avc && extra[0] == 1) {
@@ -1515,7 +1515,7 @@ HRESULT CMPCVideoDecFilter::EndOfStream() #if HAS_FFMPEG_VIDEO_DECODERS
if (m_nDXVAMode == MODE_SOFTWARE) {
REFERENCE_TIME rtStart = 0, rtStop = 0;
- SoftwareDecode(NULL, NULL, 0, rtStart, rtStop);
+ SoftwareDecode(nullptr, nullptr, 0, rtStart, rtStop);
} else
#endif
if (m_nDXVAMode == MODE_DXVA2) { // TODO - need to check DXVA1 on WinXP
@@ -1592,7 +1592,7 @@ unsigned __int64 CMPCVideoDecFilter::GetCspFromMediaType(GUID& subtype) void CMPCVideoDecFilter::InitSwscale()
{
- if (m_pSwsContext == NULL) {
+ if (m_pSwsContext == nullptr) {
BITMAPINFOHEADER bihOut;
ExtractBIH(&m_pOutput->CurrentMediaType(), &bihOut);
@@ -1606,7 +1606,7 @@ void CMPCVideoDecFilter::InitSwscale() }
m_pSwsContext = sws_getCachedContext(
- NULL,
+ nullptr,
m_pAVCtx->width,
m_pAVCtx->height,
pix_fmt,
@@ -1614,15 +1614,15 @@ void CMPCVideoDecFilter::InitSwscale() m_pAVCtx->height,
csp_ffdshow2lavc(m_nOutCsp),
sws_Flags | SWS_PRINT_INFO,
- NULL,
- NULL,
- NULL);
+ nullptr,
+ nullptr,
+ nullptr);
m_nSwOutBpp = bihOut.biBitCount;
m_pOutSize.cx = bihOut.biWidth;
m_pOutSize.cy = abs(bihOut.biHeight);
- int* inv_tbl = NULL, *tbl = NULL;
+ int* inv_tbl = nullptr, *tbl = nullptr;
int srcRange, dstRange, brightness, contrast, saturation;
int ret = sws_getColorspaceDetails(m_pSwsContext, &inv_tbl, &srcRange, &tbl, &dstRange, &brightness, &contrast, &saturation);
if (ret >= 0) {
@@ -1709,7 +1709,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int HRESULT hr = S_OK;
int got_picture;
int used_bytes;
- BOOL bFlush = (pDataIn == NULL);
+ BOOL bFlush = (pDataIn == nullptr);
AVPacket avpkt;
av_init_packet(&avpkt);
@@ -1745,7 +1745,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int avpkt.dts = rtStop;
avpkt.flags = AV_PKT_FLAG_KEY;
} else {
- avpkt.data = NULL;
+ avpkt.data = nullptr;
avpkt.size = 0;
}
used_bytes = avcodec_decode_video2(m_pAVCtx, m_pFrame, &got_picture, &avpkt);
@@ -1791,7 +1791,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int }
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
UpdateAspectRatio();
if (FAILED(hr = GetDeliveryBuffer(m_pAVCtx->width, m_pAVCtx->height, &pOut)) || FAILED(hr = pOut->GetPointer(&pDataOut))) {
@@ -1817,12 +1817,12 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int ReorderBFrames(rtStart, rtStop);
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
- if (m_pSwsContext == NULL) {
+ if (m_pSwsContext == nullptr) {
InitSwscale();
}
- if (m_pSwsContext != NULL) {
+ if (m_pSwsContext != nullptr) {
int outStride = m_pOutSize.cx;
BYTE* outData = pDataOut;
@@ -1840,7 +1840,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int outData = m_pAlignedFFBuffer;
}
- uint8_t* dst[4] = {NULL, NULL, NULL, NULL};
+ uint8_t* dst[4] = {nullptr, nullptr, nullptr, nullptr};
stride_t dstStride[4] = {0, 0, 0, 0};
const TcspInfo* outcspInfo = csp_getInfo(m_nOutCsp);
@@ -2142,8 +2142,8 @@ HRESULT CMPCVideoDecFilter::FindDXVA2DecoderConfiguration(IDirectXVideoDecoderSe UINT cConfigurations = 0;
bool bIsPrefered = false;
- D3DFORMAT* pFormats = NULL; // size = cFormats
- DXVA2_ConfigPictureDecode* pConfig = NULL; // size = cConfigurations
+ D3DFORMAT* pFormats = nullptr; // size = cFormats
+ DXVA2_ConfigPictureDecode* pConfig = nullptr; // size = cConfigurations
// Find the valid render target formats for this decoder GUID.
hr = pDecoderService->GetDecoderRenderTargets(guidDecoder, &cFormats, &pFormats);
@@ -2159,7 +2159,7 @@ HRESULT CMPCVideoDecFilter::FindDXVA2DecoderConfiguration(IDirectXVideoDecoderSe m_VideoDesc.Format = pFormats[iFormat];
// Get the available configurations.
- hr = pDecoderService->GetDecoderConfigurations(guidDecoder, &m_VideoDesc, NULL, &cConfigurations, &pConfig);
+ hr = pDecoderService->GetDecoderConfigurations(guidDecoder, &m_VideoDesc, nullptr, &cConfigurations, &pConfig);
if (FAILED(hr)) {
continue;
@@ -2204,7 +2204,7 @@ HRESULT CMPCVideoDecFilter::ConfigureDXVA2(IPin* pPin) CComPtr<IMFGetService> pGetService;
CComPtr<IDirect3DDeviceManager9> pDeviceManager;
CComPtr<IDirectXVideoDecoderService> pDecoderService;
- GUID* pDecoderGuids = NULL;
+ GUID* pDecoderGuids = nullptr;
HANDLE hDevice = INVALID_HANDLE_VALUE;
// Query the pin for IMFGetService.
@@ -2353,10 +2353,10 @@ HRESULT CMPCVideoDecFilter::CreateDXVA2Decoder(UINT nNumRenderTargets, IDirect3D HRESULT hr;
CComPtr<IDirectXVideoDecoder> pDirectXVideoDec;
- m_pDecoderRenderTarget = NULL;
+ m_pDecoderRenderTarget = nullptr;
if (m_pDXVADecoder) {
- m_pDXVADecoder->SetDirectXVideoDec(NULL);
+ m_pDXVADecoder->SetDirectXVideoDec(nullptr);
}
hr = m_pDecoderService->CreateVideoDecoder(m_DXVADecoderGUID, &m_VideoDesc, &m_DXVA2Config,
@@ -2384,10 +2384,10 @@ HRESULT CMPCVideoDecFilter::FindDXVA1DecoderConfiguration(IAMVideoAccelerator* p {
HRESULT hr = E_FAIL;
DWORD dwFormats = 0;
- DDPIXELFORMAT* pPixelFormats = NULL;
+ DDPIXELFORMAT* pPixelFormats = nullptr;
- pAMVideoAccelerator->GetUncompFormatsSupported(guidDecoder, &dwFormats, NULL);
+ pAMVideoAccelerator->GetUncompFormatsSupported(guidDecoder, &dwFormats, nullptr);
if (dwFormats > 0) {
// Find the valid render target formats for this decoder GUID.
pPixelFormats = DEBUG_NEW DDPIXELFORMAT[dwFormats];
@@ -2478,7 +2478,7 @@ STDMETHODIMP CMPCVideoDecFilter::GetPages(CAUUID* pPages) #endif
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMPCVideoDecSettingsWnd);
if (pPages->cElems > 1) {
pPages->pElems[1] = __uuidof(CMPCVideoDecCodecWnd);
@@ -2494,16 +2494,16 @@ STDMETHODIMP CMPCVideoDecFilter::CreatePage(const GUID& guid, IPropertyPage** pp {
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMPCVideoDecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>(nullptr, &hr))->AddRef();
} else if (guid == __uuidof(CMPCVideoDecCodecWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -2570,8 +2570,8 @@ STDMETHODIMP_(int) CMPCVideoDecFilter::GetDiscardMode() STDMETHODIMP_(GUID*) CMPCVideoDecFilter::GetDXVADecoderGuid()
{
- if (m_pGraph == NULL) {
- return NULL;
+ if (m_pGraph == nullptr) {
+ return nullptr;
} else {
return &m_DXVADecoderGUID;
}
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp index 71bbb0056..dfe2fb24b 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp @@ -101,7 +101,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() const int h25 = IPP_SCALE(25);
DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP;
CPoint p(10, 10);
- GUID* DxvaGui = NULL;
+ GUID* DxvaGui = nullptr;
#if HAS_FFMPEG_VIDEO_DECODERS
m_grpFFMpeg.Create(ResStr(IDS_VDF_FFSETTINGS), WS_VISIBLE | WS_CHILD | BS_GROUPBOX, CRect(p + CPoint(-5, 0), CSize(IPP_SCALE(350), h20 + h25 * 3 + h20)), this, (UINT)IDC_STATIC);
@@ -174,7 +174,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() m_edtVideoCardDescription.SetWindowText(m_pMDF->GetVideoCardDescription());
DxvaGui = m_pMDF->GetDXVADecoderGuid();
- if (DxvaGui != NULL) {
+ if (DxvaGui != nullptr) {
CString DXVAMode = GetDXVAMode(DxvaGui);
m_edtDXVAMode.SetWindowText(DXVAMode);
} else {
diff --git a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp index 759380dc1..1d450ae1f 100644 --- a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp +++ b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp @@ -28,7 +28,7 @@ CDXVA2Sample::CDXVA2Sample(CVideoDecDXVAAllocator* pAlloc, HRESULT* phr)
- : CMediaSample(NAME("CDXVA2Sample"), (CBaseAllocator*)pAlloc, phr, NULL, 0)
+ : CMediaSample(NAME("CDXVA2Sample"), (CBaseAllocator*)pAlloc, phr, nullptr, 0)
, m_dwSurfaceId(0)
{
}
@@ -68,7 +68,7 @@ STDMETHODIMP CDXVA2Sample::GetService(REFGUID guidService, REFIID riid, LPVOID* {
if (guidService != MR_BUFFER_SERVICE) {
return MF_E_UNSUPPORTED_SERVICE;
- } else if (m_pSurface == NULL) {
+ } else if (m_pSurface == nullptr) {
return E_NOINTERFACE;
} else {
return m_pSurface->QueryInterface(riid, ppv);
@@ -95,9 +95,9 @@ STDMETHODIMP_(int) CDXVA2Sample::GetDXSurfaceId() }
CVideoDecDXVAAllocator::CVideoDecDXVAAllocator(CMPCVideoDecFilter* pVideoDecFilter, HRESULT* phr)
- : CBaseAllocator(NAME("CVideoDecDXVAAllocator"), NULL, phr)
+ : CBaseAllocator(NAME("CVideoDecDXVAAllocator"), nullptr, phr)
, m_pVideoDecFilter(pVideoDecFilter)
- , m_ppRTSurfaceArray(NULL)
+ , m_ppRTSurfaceArray(nullptr)
, m_nSurfaceArrayCount(0)
{
}
@@ -127,7 +127,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc() // Allocate a new array of pointers.
m_ppRTSurfaceArray = DEBUG_NEW IDirect3DSurface9 * [m_lCount];
- if (m_ppRTSurfaceArray == NULL) {
+ if (m_ppRTSurfaceArray == nullptr) {
hr = E_OUTOFMEMORY;
} else {
ZeroMemory(m_ppRTSurfaceArray, sizeof(IDirect3DSurface9*) * m_lCount);
@@ -146,7 +146,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc() 0,
DXVA2_VideoDecoderRenderTarget,
m_ppRTSurfaceArray,
- NULL
+ nullptr
);
}
@@ -154,7 +154,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc() // Important : create samples in reverse order !
for (m_lAllocated = m_lCount - 1; m_lAllocated >= 0; m_lAllocated--) {
CDXVA2Sample* pSample = DEBUG_NEW CDXVA2Sample(this, &hr);
- if (pSample == NULL) {
+ if (pSample == nullptr) {
hr = E_OUTOFMEMORY;
break;
}
@@ -182,7 +182,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc() void CVideoDecDXVAAllocator::Free()
{
- CMediaSample* pSample = NULL;
+ CMediaSample* pSample = nullptr;
m_pVideoDecFilter->FlushDXVADecoder();
// m_FreeSurface.RemoveAll();
@@ -195,13 +195,13 @@ void CVideoDecDXVAAllocator::Free() if (m_ppRTSurfaceArray) {
for (UINT i = 0; i < m_nSurfaceArrayCount; i++) {
- if (m_ppRTSurfaceArray[i] != NULL) {
+ if (m_ppRTSurfaceArray[i] != nullptr) {
m_ppRTSurfaceArray[i]->Release();
}
}
delete [] m_ppRTSurfaceArray;
- m_ppRTSurfaceArray = NULL;
+ m_ppRTSurfaceArray = nullptr;
}
m_lAllocated = 0;
m_nSurfaceArrayCount = 0;
diff --git a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp index 2032731c3..9f38a7852 100644 --- a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp +++ b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp @@ -1,5 +1,5 @@ /*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -28,7 +28,7 @@ CVideoDecOutputPin::CVideoDecOutputPin(TCHAR* pObjectName, CBaseVideoFilter* pFi : CBaseVideoOutputPin(pObjectName, pFilter, phr, pName)
{
m_pVideoDecFilter = static_cast<CMPCVideoDecFilter*>(pFilter);
- m_pDXVA2Allocator = NULL;
+ m_pDXVA2Allocator = nullptr;
m_dwDXVA1SurfaceCount = 0;
m_GuidDecoderDXVA1 = GUID_NULL;
memset(&m_ddUncompPixelFormat, 0, sizeof(m_ddUncompPixelFormat));
@@ -115,7 +115,7 @@ STDMETHODIMP CVideoDecOutputPin::GetCreateVideoAcceleratorData(const GUID* pGuid m_pVideoDecFilter->SetDXVA1Params(&m_GuidDecoderDXVA1, &m_ddUncompPixelFormat);
pConnectMode = (DXVA_ConnectMode*)CoTaskMemAlloc(sizeof(DXVA_ConnectMode));
- if (pConnectMode != NULL) {
+ if (pConnectMode != nullptr) {
pConnectMode->guidMode = m_GuidDecoderDXVA1;
pConnectMode->wRestrictedMode = m_pVideoDecFilter->GetDXVA1RestrictedMode();
*pdwSizeMiscData = sizeof(DXVA_ConnectMode);
diff --git a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp index 6488010df..8dc2ef37e 100644 --- a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp +++ b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp @@ -168,10 +168,10 @@ void CFFAudioDecoder::LogLibavcodec(void* par, int level, const char* fmt, va_li } CFFAudioDecoder::CFFAudioDecoder() - : m_pAVCodec(NULL) - , m_pAVCtx(NULL) - , m_pParser(NULL) - , m_pFrame(NULL) + : m_pAVCodec(nullptr) + , m_pAVCtx(nullptr) + , m_pParser(nullptr) + , m_pFrame(nullptr) { memset(&m_raData, 0, sizeof(m_raData)); } @@ -234,14 +234,14 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput) GUID format_type = pInput->CurrentMediaType().formattype; DWORD formatlen = pInput->CurrentMediaType().cbFormat; unsigned extralen = 0; - getExtraData((BYTE*)format, &format_type, formatlen, NULL, &extralen); + getExtraData((BYTE*)format, &format_type, formatlen, nullptr, &extralen); memset(&m_raData, 0, sizeof(m_raData)); if (extralen) { if (nCodecId == AV_CODEC_ID_COOK || nCodecId == AV_CODEC_ID_ATRAC3 || nCodecId == AV_CODEC_ID_SIPR) { uint8_t* extra = (uint8_t*)av_mallocz(extralen + FF_INPUT_BUFFER_PADDING_SIZE); - getExtraData((BYTE*)format, &format_type, formatlen, extra, NULL); + getExtraData((BYTE*)format, &format_type, formatlen, extra, nullptr); if (extra[0] == '.' && extra[1] == 'r' && extra[2] == 'a' && extra[3] == 0xfd) { HRESULT hr = ParseRealAudioHeader(extra, extralen); @@ -265,11 +265,11 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput) } else { m_pAVCtx->extradata_size = extralen; m_pAVCtx->extradata = (uint8_t*)av_mallocz(m_pAVCtx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); - getExtraData((BYTE*)format, &format_type, formatlen, (BYTE*)m_pAVCtx->extradata, NULL); + getExtraData((BYTE*)format, &format_type, formatlen, (BYTE*)m_pAVCtx->extradata, nullptr); } } - if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) >= 0) { + if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) >= 0) { m_pFrame = avcodec_alloc_frame(); bRet = true; } @@ -308,7 +308,7 @@ HRESULT CFFAudioDecoder::Decode(enum AVCodecID nCodecId, BYTE* p, int buffsize, av_init_packet(&avpkt); if (b_use_parse) { - BYTE* pOut = NULL; + BYTE* pOut = nullptr; int pOut_size = 0; int used_bytes = av_parser_parse2(m_pParser, m_pAVCtx, &pOut, &pOut_size, p, buffsize, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0); @@ -396,7 +396,7 @@ void CFFAudioDecoder::FlushBuffers() void CFFAudioDecoder::StreamFinish() { - m_pAVCodec = NULL; + m_pAVCodec = nullptr; if (m_pAVCtx) { if (m_pAVCtx->extradata) { av_freep(&m_pAVCtx->extradata); @@ -409,7 +409,7 @@ void CFFAudioDecoder::StreamFinish() if (m_pParser) { av_parser_close(m_pParser); - m_pParser = NULL; + m_pParser = nullptr; } if (m_pFrame) { diff --git a/src/filters/transform/MpaDecFilter/Mixer.cpp b/src/filters/transform/MpaDecFilter/Mixer.cpp index a566c5b52..8c3aeece4 100644 --- a/src/filters/transform/MpaDecFilter/Mixer.cpp +++ b/src/filters/transform/MpaDecFilter/Mixer.cpp @@ -31,8 +31,8 @@ extern "C" { #include "AudioHelper.h" CMixer::CMixer() - : m_pAVRCxt(NULL) - , m_matrix_dbl(NULL) + : m_pAVRCxt(nullptr) + , m_matrix_dbl(nullptr) , m_in_avsf(AV_SAMPLE_FMT_NONE) , m_in_layout(0) , m_out_layout(0) diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp index 8193d3f91..b874d942b 100644 --- a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp +++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp @@ -197,8 +197,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -206,7 +206,7 @@ const AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, &__uuidof(CMpaDecFilter), CreateInstance<CMpaDecFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, &__uuidof(CMpaDecFilter), CreateInstance<CMpaDecFilter>, nullptr, &sudFilter[0]},
{L"CMpaDecPropertyPage", &__uuidof(CMpaDecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpaDecSettingsWnd>>},
};
@@ -352,7 +352,7 @@ CMpaDecFilter::CMpaDecFilter(LPUNKNOWN lpunk, HRESULT* phr) *phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
@@ -507,10 +507,10 @@ HRESULT CMpaDecFilter::Receive(IMediaSample* pIn) CMediaType mt(*pmt);
m_pInput->SetMediaType(&mt);
DeleteMediaType(pmt);
- pmt = NULL;
+ pmt = nullptr;
}
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -1494,19 +1494,19 @@ HRESULT CMpaDecFilter::ProcessPS2ADPCM() HRESULT CMpaDecFilter::GetDeliveryBuffer(IMediaSample** pSample, BYTE** pData)
{
HRESULT hr;
- *pData = NULL;
+ *pData = nullptr;
- if (FAILED(hr = m_pOutput->GetDeliveryBuffer(pSample, NULL, NULL, 0))
+ if (FAILED(hr = m_pOutput->GetDeliveryBuffer(pSample, nullptr, nullptr, 0))
|| FAILED(hr = (*pSample)->GetPointer(pData))) {
return hr;
}
- AM_MEDIA_TYPE* pmt = NULL;
+ AM_MEDIA_TYPE* pmt = nullptr;
if (SUCCEEDED((*pSample)->GetMediaType(&pmt)) && pmt) {
CMediaType mt = *pmt;
m_pOutput->SetMediaType(&mt);
DeleteMediaType(pmt);
- pmt = NULL;
+ pmt = nullptr;
}
return S_OK;
@@ -1584,7 +1584,7 @@ HRESULT CMpaDecFilter::Deliver(BYTE* pBuff, int size, AVSampleFormat avsf, DWORD }
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(GetDeliveryBuffer(&pOut, &pDataOut))) {
return E_FAIL;
}
@@ -1595,7 +1595,7 @@ HRESULT CMpaDecFilter::Deliver(BYTE* pBuff, int size, AVSampleFormat avsf, DWORD }
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetPreroll(FALSE);
pOut->SetDiscontinuity(m_fDiscontinuity);
@@ -1681,7 +1681,7 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, int size, WORD type, int sa }
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(GetDeliveryBuffer(&pOut, &pDataOut))) {
return E_FAIL;
}
@@ -1734,7 +1734,7 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, int size, WORD type, int sa }
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetPreroll(FALSE);
pOut->SetDiscontinuity(m_fDiscontinuity);
@@ -2000,7 +2000,7 @@ HRESULT CMpaDecFilter::GetMediaType(int iPosition, CMediaType* pmt) CMediaType mt = m_pInput->CurrentMediaType();
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.Format();
- if (wfe == NULL) {
+ if (wfe == nullptr) {
return E_INVALIDARG;
}
@@ -2296,7 +2296,7 @@ STDMETHODIMP CMpaDecFilter::GetPages(CAUUID* pPages) pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpaDecSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -2309,14 +2309,14 @@ STDMETHODIMP CMpaDecFilter::CreatePage(const GUID& guid, IPropertyPage** ppPage) {
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpaDecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpaDecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpaDecSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp index 95387e7f9..78d162ce2 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp @@ -62,8 +62,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -71,7 +71,7 @@ const AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpeg2DecFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpeg2DecFilter>, nullptr, &sudFilter[0]},
{L"CMpeg2DecPropertyPage", &__uuidof(CMpeg2DecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>>},
};
@@ -359,7 +359,7 @@ CBasePin* CMpeg2DecFilter::GetPin(int n) case 3:
return m_pClosedCaptionOutput;
}
- return NULL;
+ return nullptr;
}
HRESULT CMpeg2DecFilter::EndOfStream()
@@ -403,7 +403,7 @@ void CMpeg2DecFilter::InputTypeChanged() const CMediaType& mt = m_pInput->CurrentMediaType();
- BYTE* pSequenceHeader = NULL;
+ BYTE* pSequenceHeader = nullptr;
DWORD cbSequenceHeader = 0;
if (mt.formattype == FORMAT_MPEGVideo) {
@@ -516,7 +516,7 @@ HRESULT CMpeg2DecFilter::Transform(IMediaSample* pIn) {
HRESULT hr;
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -685,7 +685,7 @@ HRESULT CMpeg2DecFilter::DeliverFast() }
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(m_fb.w, m_fb.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
@@ -745,7 +745,7 @@ HRESULT CMpeg2DecFilter::DeliverFast() rtStop = m_rate.StartTime + (rtStop - m_rate.StartTime) * m_rate.Rate / 10000;
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
//
@@ -866,7 +866,7 @@ HRESULT CMpeg2DecFilter::Deliver(bool fRepeatLast) HRESULT hr;
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(m_fb.w, m_fb.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
@@ -910,7 +910,7 @@ HRESULT CMpeg2DecFilter::Deliver(bool fRepeatLast) rtStop = m_rate.StartTime + (rtStop - m_rate.StartTime) * m_rate.Rate / 10000;
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
//
@@ -1094,7 +1094,7 @@ STDMETHODIMP CMpeg2DecFilter::GetPages(CAUUID* pPages) pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpeg2DecSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -1107,14 +1107,14 @@ STDMETHODIMP CMpeg2DecFilter::CreatePage(const GUID& guid, IPropertyPage** ppPag {
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpeg2DecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -1694,7 +1694,7 @@ HRESULT CSubpicInputPin::Transform(IMediaSample* pSample) DeleteMediaType(pmt);
}
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pSample->GetPointer(&pDataIn))) {
return hr;
}
@@ -2426,8 +2426,8 @@ HRESULT CClosedCaptionOutputPin::Deliver(const void* ptr, int len) if (len > 4 && ptr && *(DWORD*)ptr == 0xf8014343 && IsConnected()) {
CComPtr<IMediaSample> pSample;
- GetDeliveryBuffer(&pSample, NULL, NULL, 0);
- BYTE* pData = NULL;
+ GetDeliveryBuffer(&pSample, nullptr, nullptr, 0);
+ BYTE* pData = nullptr;
pSample->GetPointer(&pData);
*(DWORD*)pData = 0xb2010000;
memcpy(pData + 4, ptr, len);
diff --git a/src/filters/transform/VSFilter/DirectVobSub.cpp b/src/filters/transform/VSFilter/DirectVobSub.cpp index 2f1d0aa3a..3347baa42 100644 --- a/src/filters/transform/VSFilter/DirectVobSub.cpp +++ b/src/filters/transform/VSFilter/DirectVobSub.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -51,7 +51,7 @@ CDirectVobSub::CDirectVobSub() m_SubtitleSpeedDiv = theApp.GetProfileInt(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_SUBTITLESPEEDDIV), 1000);
m_fMediaFPSEnabled = !!theApp.GetProfileInt(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPSENABLED), 0);
m_ePARCompensationType = static_cast<CSimpleTextSubtitle::EPARCompensationType>(theApp.GetProfileInt(ResStr(IDS_R_TEXT), ResStr(IDS_RT_AUTOPARCOMPENSATION), 0));
- pData = NULL;
+ pData = nullptr;
if (theApp.GetProfileBinary(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPS), &pData, &nSize) && pData) {
if (nSize != sizeof(m_MediaFPS)) {
m_MediaFPS = 25.0;
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp index a007d4140..1315bc172 100644 --- a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp +++ b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp @@ -64,9 +64,9 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI lf.lfOutPrecision = OUT_CHARACTER_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = ANTIALIASED_QUALITY;
- HDC hdc = GetDC(NULL);
+ HDC hdc = GetDC(nullptr);
lf.lfHeight = -MulDiv(10, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- ReleaseDC(NULL, hdc);
+ ReleaseDC(nullptr, hdc);
lf.lfWeight = FW_BOLD;
_tcscpy_s(lf.lfFaceName, _T("Arial"));
m_hfont = CreateFontIndirect(&lf);
@@ -80,8 +80,8 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI m_fLoading = true;
m_hSystrayThread = 0;
- m_tbid.hSystrayWnd = NULL;
- m_tbid.graph = NULL;
+ m_tbid.hSystrayWnd = nullptr;
+ m_tbid.graph = nullptr;
m_tbid.fRunOnce = false;
m_tbid.fShowIcon = (theApp.m_AppName.Find(_T("zplayer"), 0) < 0 || !!theApp.GetProfileInt(ResStr(IDS_R_GENERAL), ResStr(IDS_RG_ENABLEZPICON), 0));
@@ -102,7 +102,7 @@ CDirectVobSubFilter::~CDirectVobSubFilter() if (m_pSubPicQueue) {
m_pSubPicQueue->Invalidate();
}
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
if (m_hfont) {
DeleteObject(m_hfont);
@@ -198,7 +198,7 @@ HRESULT CDirectVobSubFilter::Transform(IMediaSample* pIn) //
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(pIn->GetPointer(&pDataIn)) || !pDataIn) {
return S_FALSE;
}
@@ -247,14 +247,14 @@ HRESULT CDirectVobSubFilter::Transform(IMediaSample* pIn) //
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(spd.w, spd.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
}
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetDiscontinuity(pIn->IsDiscontinuity() == S_OK);
pOut->SetSyncPoint(pIn->IsSyncPoint() == S_OK);
@@ -324,7 +324,7 @@ CBasePin* CDirectVobSubFilter::GetPin(int n) n -= (int)m_pTextInput.GetCount();
- return NULL;
+ return nullptr;
}
int CDirectVobSubFilter::GetPinCount()
@@ -462,7 +462,7 @@ HRESULT CDirectVobSubFilter::BreakConnect(PIN_DIRECTION dir) } else if (dir == PINDIR_OUTPUT) {
// not really needed, but may free up a little memory
CAutoLock cAutoLock(&m_csQueueLock);
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
}
return __super::BreakConnect(dir);
@@ -509,7 +509,7 @@ void CDirectVobSubFilter::InitSubPicQueue() {
CAutoLock cAutoLock(&m_csQueueLock);
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
m_pTempPicBuff.Free();
m_pTempPicBuff.Allocate(4 * m_w * m_h);
@@ -559,26 +559,26 @@ void CDirectVobSubFilter::InitSubPicQueue() : (ISubPicQueue*)DEBUG_NEW CSubPicQueueNoThread(pSubPicAllocator, &hr);
if (FAILED(hr)) {
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
}
UpdateSubtitle(false);
if (m_hbm) {
DeleteObject(m_hbm);
- m_hbm = NULL;
+ m_hbm = nullptr;
}
if (m_hdc) {
DeleteDC(m_hdc);
- m_hdc = NULL;
+ m_hdc = nullptr;
}
struct {
BITMAPINFOHEADER bih;
DWORD mask[3];
} b = {{sizeof(BITMAPINFOHEADER), m_w, -(int)m_h, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0}, 0xFF0000, 0x00FF00, 0x0000FF};
- m_hdc = CreateCompatibleDC(NULL);
- m_hbm = CreateDIBSection(m_hdc, (BITMAPINFO*)&b, DIB_RGB_COLORS, NULL, NULL, 0);
+ m_hdc = CreateCompatibleDC(nullptr);
+ m_hbm = CreateDIBSection(m_hdc, (BITMAPINFO*)&b, DIB_RGB_COLORS, nullptr, nullptr, 0);
BITMAP bm;
GetObject(m_hbm, sizeof(bm), &bm);
@@ -675,7 +675,7 @@ int CDirectVobSubFilter::FindPreferedLanguage(bool fHideToo) if (!lang.IsEmpty()) {
for (int ret = 0; ret < nLangs; ret++) {
CString l;
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
get_LanguageName(ret, &pName);
l = pName;
CoTaskMemFree(pName);
@@ -771,7 +771,7 @@ STDMETHODIMP CDirectVobSubFilter::Enable(long lIndex, DWORD dwFlags) put_HideSubtitles(false);
put_SelectedLanguage(i);
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
if (SUCCEEDED(get_LanguageName(i, &pName))) {
UpdatePreferedLanguages(CString(pName));
if (pName) {
@@ -825,7 +825,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* }
if (ppszName) {
- *ppszName = NULL;
+ *ppszName = nullptr;
CStringW str;
if (i == -1) {
@@ -848,7 +848,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* if (!str.IsEmpty()) {
*ppszName = (WCHAR*)CoTaskMemAlloc((str.GetLength() + 1) * sizeof(WCHAR));
- if (*ppszName == NULL) {
+ if (*ppszName == nullptr) {
return S_FALSE;
}
wcscpy_s(*ppszName, str.GetLength() + 1, str);
@@ -856,11 +856,11 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* }
if (ppObject) {
- *ppObject = NULL;
+ *ppObject = nullptr;
}
if (ppUnk) {
- *ppUnk = NULL;
+ *ppUnk = nullptr;
}
return S_OK;
@@ -868,7 +868,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* STDMETHODIMP CDirectVobSubFilter::GetClassID(CLSID* pClsid)
{
- if (pClsid == NULL) {
+ if (pClsid == nullptr) {
return E_POINTER;
}
*pClsid = m_clsid;
@@ -882,7 +882,7 @@ STDMETHODIMP CDirectVobSubFilter::GetPages(CAUUID* pPages) pPages->cElems = 7;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems == NULL) {
+ if (pPages->pElems == nullptr) {
return E_OUTOFMEMORY;
}
@@ -949,7 +949,7 @@ STDMETHODIMP CDirectVobSubFilter::get_LanguageName(int iLanguage, WCHAR** ppName CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
if (i < pSubStream->GetStreamCount()) {
- pSubStream->GetStreamInfo(i, ppName, NULL);
+ pSubStream->GetStreamInfo(i, ppName, nullptr);
hr = NOERROR;
break;
}
@@ -1237,7 +1237,7 @@ HRESULT CDirectVobSubFilter2::JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pNam cmt.majortype = MEDIATYPE_Video;
cmt.subtype = MEDIASUBTYPE_YUY2;
cmt.formattype = FORMAT_VideoInfo;
- cmt.pUnk = NULL;
+ cmt.pUnk = nullptr;
cmt.bFixedSizeSamples = TRUE;
cmt.bTemporalCompression = TRUE;
cmt.lSampleSize = 384 * 288 * 2;
@@ -1386,8 +1386,8 @@ bool CDirectVobSubFilter2::ShouldWeAutoload(IFilterGraph* pGraph) BeginEnumFilters(pGraph, pEF, pBF) {
if (CComQIPtr<IFileSourceFilter> pFSF = pBF) {
- LPOLESTR fnw = NULL;
- if (!pFSF || FAILED(pFSF->GetCurFile(&fnw, NULL)) || !fnw) {
+ LPOLESTR fnw = nullptr;
+ if (!pFSF || FAILED(pFSF->GetCurFile(&fnw, nullptr)) || !fnw) {
continue;
}
fn = CString(fnw);
@@ -1421,7 +1421,7 @@ void CDirectVobSubFilter2::GetRidOfInternalScriptRenderer() && SUCCEEDED(pPin->ConnectedTo(&pPinTo))) {
m_pGraph->Disconnect(pPinTo);
m_pGraph->Disconnect(pPin);
- m_pGraph->ConnectDirect(pPinTo, GetPin(2 + m_pTextInput.GetCount() - 1), NULL);
+ m_pGraph->ConnectDirect(pPinTo, GetPin(2 + m_pTextInput.GetCount() - 1), nullptr);
}
}
EndEnumPins;
@@ -1517,7 +1517,7 @@ void CDirectVobSubFilter::UpdateSubtitle(bool fApplyDefStyle) if (!m_fHideSubtitles) {
int i = m_iSelectedLanguage;
- for (POSITION pos = m_pSubStreams.GetHeadPosition(); i >= 0 && pos; pSubStream = NULL) {
+ for (POSITION pos = m_pSubStreams.GetHeadPosition(); i >= 0 && pos; pSubStream = nullptr) {
pSubStream = m_pSubStreams.GetNext(pos);
if (i < pSubStream->GetStreamCount()) {
@@ -1764,7 +1764,7 @@ DWORD CDirectVobSubFilter::ThreadProc() CFileStatus status;
if (CFileGetStatus(fn, status) && m_frd.mtime[i] != status.m_mtime) {
for (j = 0; j < 10; j++) {
- FILE* f = NULL;
+ FILE* f = nullptr;
if (!_tfopen_s(&f, fn, _T("rb+"))) {
fclose(f);
j = 0;
diff --git a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp index 1b7554358..0144a1aad 100644 --- a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp +++ b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp @@ -41,7 +41,7 @@ BOOL WINAPI MyGetDialogSize(int iResourceID, DLGPROC pDlgProc, LPARAM lParam, SI pDlgProc,
lParam);
- if (hwnd == NULL) {
+ if (hwnd == nullptr) {
return FALSE;
}
@@ -80,8 +80,8 @@ STDMETHODIMP CDVSBasePPage::GetPageInfo(LPPROPPAGEINFO pPageInfo) pPageInfo->cb = sizeof(PROPPAGEINFO);
pPageInfo->pszTitle = pszTitle;
- pPageInfo->pszDocString = NULL;
- pPageInfo->pszHelpFile = NULL;
+ pPageInfo->pszDocString = nullptr;
+ pPageInfo->pszHelpFile = nullptr;
pPageInfo->dwHelpContext = 0;
// Set defaults in case GetDialogSize fails
pPageInfo->size.cx = 340;
@@ -108,7 +108,7 @@ STDMETHODIMP CDVSBasePPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal }
m_hwnd = CreateDialogParam(AfxGetResourceHandle(), MAKEINTRESOURCE(m_DialogId), hwndParent, DialogProc, (LPARAM)this);
- if (m_hwnd == NULL) {
+ if (m_hwnd == nullptr) {
return E_OUTOFMEMORY;
}
@@ -184,7 +184,7 @@ HRESULT CDVSBasePPage::OnConnect(IUnknown* pUnknown) HRESULT CDVSBasePPage::OnDisconnect()
{
- if (m_pDirectVobSub == NULL) {
+ if (m_pDirectVobSub == nullptr) {
return E_UNEXPECTED;
}
@@ -294,7 +294,7 @@ void CDVSBasePPage::BindControl(UINT id, CWnd& control) CDVSMainPPage::CDVSMainPPage(LPUNKNOWN pUnk, HRESULT* phr)
: CDVSBasePPage(NAME("DirectVobSub Property Page (main)"), pUnk, IDD_DVSMAINPAGE, IDD_DVSMAINPAGE)
, m_nLangs(0)
- , m_ppLangs(NULL)
+ , m_ppLangs(nullptr)
{
BindControl(IDC_FILENAME, m_fnedit);
BindControl(IDC_LANGCOMBO, m_langs);
@@ -319,7 +319,7 @@ void CDVSMainPPage::FreeLangs() }
CoTaskMemFree(m_ppLangs);
m_nLangs = 0;
- m_ppLangs = NULL;
+ m_ppLangs = nullptr;
}
}
@@ -338,7 +338,7 @@ bool CDVSMainPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) == IDC_OPEN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, NULL,
+ CFileDialog fd(TRUE, nullptr, nullptr,
OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,
_T(".idx .smi .sub .srt .psb .ssa .ass .usf|*.idx;*.smi;*.sub;*.srt;*.psb;*.ssa;*.ass;*.usf|")
_T("All files (*.*)|*.*||"),
@@ -403,7 +403,7 @@ void CDVSMainPPage::UpdateObjectData(bool fSave) }
m_pDirectVobSub->get_SelectedLanguage(&m_iSelectedLanguage);
m_pDirectVobSub->get_Placement(&m_fOverridePlacement, &m_PlacementXperc, &m_PlacementYperc);
- m_pDirectVobSub->get_VobSubSettings(NULL, &m_fOnlyShowForcedVobSubs, NULL);
+ m_pDirectVobSub->get_VobSubSettings(nullptr, &m_fOnlyShowForcedVobSubs, nullptr);
m_pDirectVobSub->get_TextSettings(&m_defStyle);
m_pDirectVobSub->get_AspectRatioSettings(&m_ePARCompensationType);
}
@@ -767,11 +767,11 @@ bool CDVSAboutPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) case BN_CLICKED: {
if (LOWORD(wParam) == IDC_HOMEPAGEBTN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_HOMEPAGE), NULL, NULL, SW_SHOWNORMAL);
+ ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_HOMEPAGE), nullptr, nullptr, SW_SHOWNORMAL);
return true;
} else if (LOWORD(wParam) == IDC_BUGREPORTBTN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_EMAIL), NULL, NULL, SW_SHOWNORMAL);
+ ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_EMAIL), nullptr, nullptr, SW_SHOWNORMAL);
return true;
}
}
@@ -959,7 +959,7 @@ void CDVSColorPPage::UpdateControlData(bool fSave) m_preflist.ResetContent();
m_dynchglist.ResetContent();
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
UINT nSize;
if (!theApp.GetProfileBinary(ResStr(IDS_R_GENERAL), ResStr(IDS_RG_COLORFORMATS), &pData, &nSize)
@@ -1038,11 +1038,11 @@ bool CDVSPathsPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) BROWSEINFO bi;
bi.hwndOwner = m_Dlg;
- bi.pidlRoot = NULL;
+ bi.pidlRoot = nullptr;
bi.pszDisplayName = pathbuff;
bi.lpszTitle = _T("");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_EDITBOX | BIF_VALIDATE | BIF_USENEWUI;
- bi.lpfn = NULL;
+ bi.lpfn = nullptr;
bi.lParam = 0;
bi.iImage = 0;
diff --git a/src/filters/transform/VSFilter/StyleEditorDialog.cpp b/src/filters/transform/VSFilter/StyleEditorDialog.cpp index f22c17e00..a686c2b93 100644 --- a/src/filters/transform/VSFilter/StyleEditorDialog.cpp +++ b/src/filters/transform/VSFilter/StyleEditorDialog.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -36,7 +36,7 @@ END_MESSAGE_MAP() // CStyleEditorDialog dialog
IMPLEMENT_DYNAMIC(CStyleEditorDialog, CDialog)
-CStyleEditorDialog::CStyleEditorDialog(CString title, STSStyle* pstss, CWnd* pParent /*=NULL*/)
+CStyleEditorDialog::CStyleEditorDialog(CString title, STSStyle* pstss, CWnd* pParent /*=nullptr*/)
: CDialog(CStyleEditorDialog::IDD, pParent)
, m_title(title)
, m_stss(*pstss)
diff --git a/src/filters/transform/VSFilter/Systray.cpp b/src/filters/transform/VSFilter/Systray.cpp index bd9aa7e13..3b491158b 100644 --- a/src/filters/transform/VSFilter/Systray.cpp +++ b/src/filters/transform/VSFilter/Systray.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -251,7 +251,7 @@ LRESULT CSystrayWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam) DWORD flags, group, prevgroup = (DWORD) - 1;
for (UINT i = 0; i < cStreams; i++) {
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
if (S_OK == pStreams[j]->Info(i, 0, &flags, 0, &group, &pName, 0, 0)) {
if (prevgroup != group && i > 1) {
@@ -324,14 +324,14 @@ DWORD CALLBACK SystrayThreadProc(void* pParam) AFX_MANAGE_STATE(AfxGetStaticModuleState());
CSystrayWindow wnd((SystrayIconData*)pParam);
- if (!wnd.CreateEx(0, AfxRegisterWndClass(0), _T("DVSWND"), WS_OVERLAPPED, CRect(0, 0, 0, 0), NULL, 0, NULL)) {
+ if (!wnd.CreateEx(0, AfxRegisterWndClass(0), _T("DVSWND"), WS_OVERLAPPED, CRect(0, 0, 0, 0), nullptr, 0, nullptr)) {
return (DWORD) - 1;
}
((SystrayIconData*)pParam)->hSystrayWnd = wnd.m_hWnd;
MSG msg;
- while (GetMessage(&msg, NULL/*wnd.m_hWnd*/, 0, 0)) {
+ while (GetMessage(&msg, nullptr/*wnd.m_hWnd*/, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -345,10 +345,10 @@ DWORD CALLBACK SystrayThreadProc(void* pParam) static TCHAR* CallPPage(IFilterGraph* pGraph, int idx, HWND hWnd)
{
int i = 0;
- WCHAR* wstr = NULL;
+ WCHAR* wstr = nullptr;
CComPtr<IBaseFilter> pFilter;
CAUUID caGUID;
- caGUID.pElems = NULL;
+ caGUID.pElems = nullptr;
BeginEnumFilters(pGraph, pEF, pBF) {
CComQIPtr<ISpecifyPropertyPages> pSPS = pBF;
@@ -368,7 +368,7 @@ static TCHAR* CallPPage(IFilterGraph* pGraph, int idx, HWND hWnd) }
EndEnumFilters;
- TCHAR* ret = NULL;
+ TCHAR* ret = nullptr;
if (pFilter) {
if (hWnd != INVALID_HANDLE_VALUE) {
diff --git a/src/filters/transform/VSFilter/VSFilter.cpp b/src/filters/transform/VSFilter/VSFilter.cpp index d3ba6c3fe..edc7ab760 100644 --- a/src/filters/transform/VSFilter/VSFilter.cpp +++ b/src/filters/transform/VSFilter/VSFilter.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -105,9 +105,9 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = { };
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut},
- {L"Input2", TRUE, FALSE, FALSE, TRUE, &CLSID_NULL, NULL, _countof(sudPinTypesIn2), sudPinTypesIn2}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut},
+ {L"Input2", TRUE, FALSE, FALSE, TRUE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn2), sudPinTypesIn2}
};
/*const*/
@@ -117,8 +117,8 @@ AMOVIESETUP_FILTER sudFilter[] = { };
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDirectVobSubFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDirectVobSubFilter2>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDirectVobSubFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDirectVobSubFilter2>, nullptr, &sudFilter[1]},
{L"DVSMainPPage", &__uuidof(CDVSMainPPage), CreateInstance<CDVSMainPPage>},
{L"DVSGeneralPPage", &__uuidof(CDVSGeneralPPage), CreateInstance<CDVSGeneralPPage>},
{L"DVSMiscPPage", &__uuidof(CDVSMiscPPage), CreateInstance<CDVSMiscPPage>},
diff --git a/src/filters/transform/VSFilter/csriapi.cpp b/src/filters/transform/VSFilter/csriapi.cpp index 4189789fc..505663dbb 100644 --- a/src/filters/transform/VSFilter/csriapi.cpp +++ b/src/filters/transform/VSFilter/csriapi.cpp @@ -50,7 +50,7 @@ CSRIAPI csri_inst* csri_open_file(csri_rend* renderer, const char* filename, str int namesize;
wchar_t* namebuf;
- namesize = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
+ namesize = MultiByteToWideChar(CP_UTF8, 0, filename, -1, nullptr, 0);
if (!namesize) {
return 0;
}
diff --git a/src/filters/transform/VSFilter/plugins.cpp b/src/filters/transform/VSFilter/plugins.cpp index e8218dcc2..c193e0eab 100644 --- a/src/filters/transform/VSFilter/plugins.cpp +++ b/src/filters/transform/VSFilter/plugins.cpp @@ -84,7 +84,7 @@ namespace Plugin HRESULT hr;
if (!(m_pSubPicQueue = DEBUG_NEW CSubPicQueueNoThread(pAllocator, &hr)) || FAILED(hr)) {
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
return false;
}
}
@@ -182,14 +182,14 @@ namespace Plugin bool Open(CString fn) {
SetFileName(_T(""));
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
if (CVobSubFile* vsf = DEBUG_NEW CVobSubFile(&m_csSubLock)) {
m_pSubPicProvider = (ISubPicProvider*)vsf;
if (vsf->Open(CString(fn))) {
SetFileName(fn);
} else {
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
}
}
@@ -216,7 +216,7 @@ namespace Plugin bool Open(CString fn, int CharSet = DEFAULT_CHARSET) {
SetFileName(_T(""));
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
if (!m_pSubPicProvider) {
if (CRenderedTextSubtitle* rts = DEBUG_NEW CRenderedTextSubtitle(&m_csSubLock)) {
@@ -224,7 +224,7 @@ namespace Plugin if (rts->Open(CString(fn), CharSet)) {
SetFileName(fn);
} else {
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
}
}
}
@@ -282,7 +282,7 @@ namespace Plugin int ConfigProc(FilterActivation* fa, const FilterFunctions* ff, HWND hwnd) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
_T("VobSub files (*.idx;*.sub)|*.idx;*.sub||"), CWnd::FromHandle(hwnd), 0);
if (fd.DoModal() != IDOK) {
@@ -314,7 +314,7 @@ namespace Plugin AFX_MANAGE_STATE(AfxGetStaticModuleState());
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
formats, CWnd::FromHandle(hwnd), sizeof(OPENFILENAME));
UINT_PTR CALLBACK OpenHookProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
@@ -420,19 +420,19 @@ namespace Plugin ScriptFunctionDef vobsub_func_defs[] = {
{ (ScriptFunctionPtr)vobsubScriptConfig, "Config", "0s" },
- { NULL },
+ { nullptr },
};
CScriptObject vobsub_obj = {
- NULL, vobsub_func_defs
+ nullptr, vobsub_func_defs
};
struct FilterDefinition filterDef_vobsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"VobSub", // name
"Adds subtitles from a vob sequence.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
vobsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -440,27 +440,27 @@ namespace Plugin baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&vobsub_obj, // script_obj
baseFssProc, // fssProc
};
ScriptFunctionDef textsub_func_defs[] = {
{ (ScriptFunctionPtr)textsubScriptConfig, "Config", "0si" },
- { NULL },
+ { nullptr },
};
CScriptObject textsub_obj = {
- NULL, textsub_func_defs
+ nullptr, textsub_func_defs
};
struct FilterDefinition filterDef_textsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"TextSub", // name
"Adds subtitles from srt, sub, psb, smi, ssa, ass file formats.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
textsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -468,8 +468,8 @@ namespace Plugin baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&textsub_obj, // script_obj
baseFssProc, // fssProc
};
@@ -549,7 +549,7 @@ namespace Plugin int ConfigProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff, VDXHWND hwnd) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
_T("VobSub files (*.idx;*.sub)|*.idx;*.sub||"), CWnd::FromHandle((HWND)hwnd), 0);
if (fd.DoModal() != IDOK) {
@@ -583,7 +583,7 @@ namespace Plugin /* off encoding changing */
#ifndef _DEBUG
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
formats, CWnd::FromHandle((HWND)hwnd), sizeof(OPENFILENAME));
UINT_PTR CALLBACK OpenHookProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
@@ -593,7 +593,7 @@ namespace Plugin fd.m_pOFN->lCustData = (LPARAM)DEFAULT_CHARSET;
#else
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_ENABLESIZING | OFN_HIDEREADONLY,
formats, CWnd::FromHandle((HWND)hwnd), sizeof(OPENFILENAME));
#endif
if (fd.DoModal() != IDOK) {
@@ -621,12 +621,12 @@ namespace Plugin int vobsubInitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
{
- return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CVobSubVirtualDubFilter()) == NULL);
+ return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CVobSubVirtualDubFilter()) == nullptr);
}
int textsubInitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
{
- return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CTextSubVirtualDubFilter()) == NULL);
+ return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CTextSubVirtualDubFilter()) == nullptr);
}
void baseDeinitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
@@ -691,19 +691,19 @@ namespace Plugin VDXScriptFunctionDef vobsub_func_defs[] = {
{ (VDXScriptFunctionPtr)vobsubScriptConfig, "Config", "0s" },
- { NULL },
+ { nullptr },
};
VDXScriptObject vobsub_obj = {
- NULL, vobsub_func_defs
+ nullptr, vobsub_func_defs
};
struct VDXFilterDefinition filterDef_vobsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"VobSub", // name
"Adds subtitles from a vob sequence.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
vobsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -711,27 +711,27 @@ namespace Plugin baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&vobsub_obj, // script_obj
baseFssProc, // fssProc
};
VDXScriptFunctionDef textsub_func_defs[] = {
{ (VDXScriptFunctionPtr)textsubScriptConfig, "Config", "0si" },
- { NULL },
+ { nullptr },
};
VDXScriptObject textsub_obj = {
- NULL, textsub_func_defs
+ nullptr, textsub_func_defs
};
struct VDXFilterDefinition filterDef_textsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"TextSub", // name
"Adds subtitles from srt, sub, psb, smi, ssa, ass file formats.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
textsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -739,8 +739,8 @@ namespace Plugin baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&textsub_obj, // script_obj
baseFssProc, // fssProc
};
@@ -750,8 +750,8 @@ namespace Plugin extern "C" __declspec(dllexport) int __cdecl VirtualdubFilterModuleInit2(VDXFilterModule* fm, const VDXFilterFunctions* ff, int& vdfd_ver, int& vdfd_compat)
{
- if (((fd_vobsub = ff->addFilter(fm, &filterDef_vobsub, sizeof(VDXFilterDefinition))) == NULL)
- || ((fd_textsub = ff->addFilter(fm, &filterDef_textsub, sizeof(VDXFilterDefinition))) == NULL)) {
+ if (((fd_vobsub = ff->addFilter(fm, &filterDef_vobsub, sizeof(VDXFilterDefinition))) == nullptr)
+ || ((fd_textsub = ff->addFilter(fm, &filterDef_textsub, sizeof(VDXFilterDefinition))) == nullptr)) {
return 1;
}
@@ -881,7 +881,7 @@ namespace Plugin env->AddFunction("TextSub", "csif", TextSubCreateSIF, 0);
env->AddFunction("MaskSub", "siifi", MaskSubCreateSIIFI, 0);
env->SetVar(env->SaveString("RGBA"), false);
- return NULL;
+ return nullptr;
}
}
@@ -1039,7 +1039,7 @@ namespace Plugin env->AddFunction("TextSubSwapUV", "b", TextSubSwapUV, 0);
env->AddFunction("MaskSub", "[file]s[width]i[height]i[fps]f[length]i[charset]i[vfr]s", MaskSubCreate, 0);
env->SetVar(env->SaveString("RGBA"), false);
- return NULL;
+ return nullptr;
}
}
|