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

Side by Side Diff: media/capture/video/win/video_capture_device_mf_win.cc

Issue 2039943005: clang-tidy WaitableEvent refactor (Windows side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/gpu/rendering_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/win/video_capture_device_mf_win.h" 5 #include "media/capture/video/win/video_capture_device_mf_win.h"
6 6
7 #include <mfapi.h> 7 #include <mfapi.h>
8 #include <mferror.h> 8 #include <mferror.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 } 267 }
268 } 268 }
269 } 269 }
270 270
271 OnError(FROM_HERE, hr); 271 OnError(FROM_HERE, hr);
272 } 272 }
273 273
274 void VideoCaptureDeviceMFWin::StopAndDeAllocate() { 274 void VideoCaptureDeviceMFWin::StopAndDeAllocate() {
275 DCHECK(CalledOnValidThread()); 275 DCHECK(CalledOnValidThread());
276 base::WaitableEvent flushed(false, false); 276 base::WaitableEvent flushed(base::WaitableEvent::ResetPolicy::AUTOMATIC,
277 base::WaitableEvent::InitialState::NOT_SIGNALED);
277 const int kFlushTimeOutInMs = 1000; 278 const int kFlushTimeOutInMs = 1000;
278 bool wait = false; 279 bool wait = false;
279 { 280 {
280 base::AutoLock lock(lock_); 281 base::AutoLock lock(lock_);
281 if (capture_) { 282 if (capture_) {
282 capture_ = false; 283 capture_ = false;
283 callback_->SetSignalOnFlush(&flushed); 284 callback_->SetSignalOnFlush(&flushed);
284 wait = SUCCEEDED( 285 wait = SUCCEEDED(
285 reader_->Flush(static_cast<DWORD>(MF_SOURCE_READER_ALL_STREAMS))); 286 reader_->Flush(static_cast<DWORD>(MF_SOURCE_READER_ALL_STREAMS)));
286 if (!wait) { 287 if (!wait) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 HRESULT hr) { 331 HRESULT hr) {
331 if (client_.get()) { 332 if (client_.get()) {
332 client_->OnError( 333 client_->OnError(
333 from_here, 334 from_here,
334 base::StringPrintf("VideoCaptureDeviceMFWin: %s", 335 base::StringPrintf("VideoCaptureDeviceMFWin: %s",
335 logging::SystemErrorCodeToString(hr).c_str())); 336 logging::SystemErrorCodeToString(hr).c_str()));
336 } 337 }
337 } 338 }
338 339
339 } // namespace media 340 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/gpu/rendering_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698