Index: webrtc/modules/video_capture/windows/help_functions_ds.cc |
diff --git a/webrtc/modules/video_capture/windows/help_functions_ds.cc b/webrtc/modules/video_capture/windows/help_functions_ds.cc |
index 057bffb0af15c3f0832477cfaa3efa638f98de08..d3d1d1787e5f4ef93248b6f283975545e2fe767b 100644 |
--- a/webrtc/modules/video_capture/windows/help_functions_ds.cc |
+++ b/webrtc/modules/video_capture/windows/help_functions_ds.cc |
@@ -35,78 +35,73 @@ LONGLONG GetMaxOfFrameArray(LONGLONG *maxFps, long size) |
IPin* GetInputPin(IBaseFilter* filter) |
{ |
HRESULT hr; |
- IPin* pin = NULL; |
- IEnumPins* pPinEnum = NULL; |
+ IPin* pin = nullptr; |
+ IEnumPins* pPinEnum = nullptr; |
filter->EnumPins(&pPinEnum); |
- if (pPinEnum == NULL) |
- { |
- return NULL; |
+ if (pPinEnum == nullptr) { |
+ return nullptr; |
} |
// get first unconnected pin |
hr = pPinEnum->Reset(); // set to first pin |
- while (S_OK == pPinEnum->Next(1, &pin, NULL)) |
- { |
- PIN_DIRECTION pPinDir; |
- pin->QueryDirection(&pPinDir); |
- if (PINDIR_INPUT == pPinDir) // This is an input pin |
+ while (S_OK == pPinEnum->Next(1, &pin, nullptr)) { |
+ PIN_DIRECTION pPinDir; |
+ pin->QueryDirection(&pPinDir); |
+ if (PINDIR_INPUT == pPinDir) // This is an input pin |
+ { |
+ IPin* tempPin = nullptr; |
+ if (S_OK != pin->ConnectedTo(&tempPin)) // The pint is not connected |
{ |
- IPin* tempPin = NULL; |
- if (S_OK != pin->ConnectedTo(&tempPin)) // The pint is not connected |
- { |
- pPinEnum->Release(); |
- return pin; |
- } |
+ pPinEnum->Release(); |
+ return pin; |
} |
- pin->Release(); |
+ } |
+ pin->Release(); |
} |
pPinEnum->Release(); |
- return NULL; |
+ return nullptr; |
} |
IPin* GetOutputPin(IBaseFilter* filter, REFGUID Category) |
{ |
HRESULT hr; |
- IPin* pin = NULL; |
- IEnumPins* pPinEnum = NULL; |
+ IPin* pin = nullptr; |
+ IEnumPins* pPinEnum = nullptr; |
filter->EnumPins(&pPinEnum); |
- if (pPinEnum == NULL) |
- { |
- return NULL; |
+ if (pPinEnum == nullptr) { |
+ return nullptr; |
} |
// get first unconnected pin |
hr = pPinEnum->Reset(); // set to first pin |
- while (S_OK == pPinEnum->Next(1, &pin, NULL)) |
- { |
- PIN_DIRECTION pPinDir; |
- pin->QueryDirection(&pPinDir); |
- if (PINDIR_OUTPUT == pPinDir) // This is an output pin |
- { |
- if (Category == GUID_NULL || PinMatchesCategory(pin, Category)) |
- { |
- pPinEnum->Release(); |
- return pin; |
- } |
+ while (S_OK == pPinEnum->Next(1, &pin, nullptr)) { |
+ PIN_DIRECTION pPinDir; |
+ pin->QueryDirection(&pPinDir); |
+ if (PINDIR_OUTPUT == pPinDir) // This is an output pin |
+ { |
+ if (Category == GUID_NULL || PinMatchesCategory(pin, Category)) { |
+ pPinEnum->Release(); |
+ return pin; |
} |
- pin->Release(); |
- pin = NULL; |
+ } |
+ pin->Release(); |
+ pin = nullptr; |
} |
pPinEnum->Release(); |
- return NULL; |
+ return nullptr; |
} |
BOOL PinMatchesCategory(IPin *pPin, REFGUID Category) |
{ |
BOOL bFound = FALSE; |
- IKsPropertySet *pKs = NULL; |
+ IKsPropertySet* pKs = nullptr; |
HRESULT hr = pPin->QueryInterface(IID_PPV_ARGS(&pKs)); |
if (SUCCEEDED(hr)) |
{ |
GUID PinCategory; |
DWORD cbReturned; |
- hr = pKs->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, &PinCategory, |
- sizeof(GUID), &cbReturned); |
+ hr = pKs->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, nullptr, 0, |
+ &PinCategory, sizeof(GUID), &cbReturned); |
if (SUCCEEDED(hr) && (cbReturned == sizeof(GUID))) |
{ |
bFound = (PinCategory == Category); |