Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: webrtc/modules/video_capture/windows/help_functions_ds.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698