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

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 2023343002: Migrate WaitableEvent to enum-based constructor in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
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
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/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (!offload_thread_.IsRunning()) 63 if (!offload_thread_.IsRunning())
64 offload_thread_.Start(); 64 offload_thread_.Start();
65 65
66 return offload_thread_.task_runner(); 66 return offload_thread_.task_runner();
67 } 67 }
68 68
69 void WaitForOutstandingTasks() { 69 void WaitForOutstandingTasks() {
70 DCHECK(thread_checker_.CalledOnValidThread()); 70 DCHECK(thread_checker_.CalledOnValidThread());
71 DCHECK(offload_thread_users_); 71 DCHECK(offload_thread_users_);
72 DCHECK(offload_thread_.IsRunning()); 72 DCHECK(offload_thread_.IsRunning());
73 base::WaitableEvent waiter(false, false); 73 base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC,
74 base::WaitableEvent::InitialState::NOT_SIGNALED);
74 offload_thread_.task_runner()->PostTask( 75 offload_thread_.task_runner()->PostTask(
75 FROM_HERE, 76 FROM_HERE,
76 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter))); 77 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter)));
77 waiter.Wait(); 78 waiter.Wait();
78 } 79 }
79 80
80 void WaitForOutstandingTasksAndReleaseOffloadThread() { 81 void WaitForOutstandingTasksAndReleaseOffloadThread() {
81 DCHECK(thread_checker_.CalledOnValidThread()); 82 DCHECK(thread_checker_.CalledOnValidThread());
82 DCHECK(offload_thread_users_); 83 DCHECK(offload_thread_users_);
83 DCHECK(offload_thread_.IsRunning()); 84 DCHECK(offload_thread_.IsRunning());
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 (*video_frame)->visible_data(VideoFrame::kUPlane), 697 (*video_frame)->visible_data(VideoFrame::kUPlane),
697 (*video_frame)->stride(VideoFrame::kUPlane), 698 (*video_frame)->stride(VideoFrame::kUPlane),
698 (*video_frame)->visible_data(VideoFrame::kVPlane), 699 (*video_frame)->visible_data(VideoFrame::kVPlane),
699 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), 700 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(),
700 coded_size.height()); 701 coded_size.height());
701 702
702 return true; 703 return true;
703 } 704 }
704 705
705 } // namespace media 706 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/blocking_url_protocol.cc ('k') | media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698