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

Unified Diff: webrtc/modules/video_capture/windows/video_capture_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/video_capture_ds.cc
diff --git a/webrtc/modules/video_capture/windows/video_capture_ds.cc b/webrtc/modules/video_capture/windows/video_capture_ds.cc
index a75ef5bc49538916a5fd83af2100f247087da54f..a1ce958a724f061ee1dde46614669a77ac0f8fb9 100644
--- a/webrtc/modules/video_capture/windows/video_capture_ds.cc
+++ b/webrtc/modules/video_capture/windows/video_capture_ds.cc
@@ -23,12 +23,15 @@ namespace webrtc
namespace videocapturemodule
{
VideoCaptureDS::VideoCaptureDS()
- : _captureFilter(NULL),
- _graphBuilder(NULL), _mediaControl(NULL), _sinkFilter(NULL),
- _inputSendPin(NULL), _outputCapturePin(NULL), _dvFilter(NULL),
- _inputDvPin(NULL), _outputDvPin(NULL)
-{
-}
+ : _captureFilter(nullptr),
+ _graphBuilder(nullptr),
+ _mediaControl(nullptr),
+ _sinkFilter(nullptr),
+ _inputSendPin(nullptr),
+ _outputCapturePin(nullptr),
+ _dvFilter(nullptr),
+ _inputDvPin(nullptr),
+ _outputDvPin(nullptr) {}
VideoCaptureDS::~VideoCaptureDS()
{
@@ -83,9 +86,9 @@ int32_t VideoCaptureDS::Init(const char* deviceUniqueIdUTF8)
}
// Get the interface for DirectShow's GraphBuilder
- HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL,
- CLSCTX_INPROC_SERVER, IID_IGraphBuilder,
- (void **) &_graphBuilder);
+ HRESULT hr =
+ CoCreateInstance(CLSID_FilterGraph, nullptr, CLSCTX_INPROC_SERVER,
+ IID_IGraphBuilder, (void**)&_graphBuilder);
if (FAILED(hr))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
@@ -112,8 +115,7 @@ int32_t VideoCaptureDS::Init(const char* deviceUniqueIdUTF8)
_outputCapturePin = GetOutputPin(_captureFilter, PIN_CATEGORY_CAPTURE);
// Create the sink filte used for receiving Captured frames.
- _sinkFilter = new CaptureSinkFilter(SINK_FILTER_NAME, NULL, &hr,
- *this);
+ _sinkFilter = new CaptureSinkFilter(SINK_FILTER_NAME, nullptr, &hr, *this);
if (hr != S_OK)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
@@ -244,8 +246,8 @@ int32_t VideoCaptureDS::SetCameraOutput(
return -1;
}
- IAMStreamConfig* streamConfig = NULL;
- AM_MEDIA_TYPE *pmt = NULL;
+ IAMStreamConfig* streamConfig = nullptr;
+ AM_MEDIA_TYPE* pmt = nullptr;
VIDEO_STREAM_CONFIG_CAPS caps;
HRESULT hr = _outputCapturePin->QueryInterface(IID_IAMStreamConfig,
@@ -314,8 +316,8 @@ int32_t VideoCaptureDS::SetCameraOutput(
}
else
{
- hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputSendPin,
- NULL);
+ hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputSendPin,
+ nullptr);
}
if (hr != S_OK)
{
@@ -353,13 +355,12 @@ HRESULT VideoCaptureDS::ConnectDVCamera()
if (!_dvFilter)
{
- hr = CoCreateInstance(CLSID_DVVideoCodec, NULL, CLSCTX_INPROC,
- IID_IBaseFilter, (void **) &_dvFilter);
- if (hr != S_OK)
- {
- WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
- "Failed to create the dv decoder: %x", hr);
- return hr;
+ hr = CoCreateInstance(CLSID_DVVideoCodec, nullptr, CLSCTX_INPROC,
+ IID_IBaseFilter, (void**)&_dvFilter);
+ if (hr != S_OK) {
+ WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
+ "Failed to create the dv decoder: %x", hr);
+ return hr;
}
hr = _graphBuilder->AddFilter(_dvFilter, L"VideoDecoderDV");
if (hr != S_OK)
@@ -369,21 +370,19 @@ HRESULT VideoCaptureDS::ConnectDVCamera()
return hr;
}
_inputDvPin = GetInputPin(_dvFilter);
- if (_inputDvPin == NULL)
- {
- WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
- "Failed to get input pin from DV decoder");
- return -1;
+ if (_inputDvPin == nullptr) {
+ WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
+ "Failed to get input pin from DV decoder");
+ return -1;
}
_outputDvPin = GetOutputPin(_dvFilter, GUID_NULL);
- if (_outputDvPin == NULL)
- {
- WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
- "Failed to get output pin from DV decoder");
- return -1;
+ if (_outputDvPin == nullptr) {
+ WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
+ "Failed to get output pin from DV decoder");
+ return -1;
}
}
- hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputDvPin, NULL);
+ hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputDvPin, nullptr);
if (hr != S_OK)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
@@ -392,7 +391,7 @@ HRESULT VideoCaptureDS::ConnectDVCamera()
return hr;
}
- hr = _graphBuilder->ConnectDirect(_outputDvPin, _inputSendPin, NULL);
+ hr = _graphBuilder->ConnectDirect(_outputDvPin, _inputSendPin, nullptr);
if (hr != S_OK)
{
if (hr == HRESULT_FROM_WIN32(ERROR_TOO_MANY_OPEN_FILES))

Powered by Google App Engine
This is Rietveld 408576698