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

Side by Side Diff: media/cast/test/receiver.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <limits.h> 5 #include <limits.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <climits> 10 #include <climits>
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 FROM_HERE, 213 FROM_HERE,
214 base::Bind(&NaivePlayer::StartAudioOutputOnAudioManagerThread, 214 base::Bind(&NaivePlayer::StartAudioOutputOnAudioManagerThread,
215 base::Unretained(this))); 215 base::Unretained(this)));
216 // Note: No need to wait for audio polling to start since the push-and-pull 216 // Note: No need to wait for audio polling to start since the push-and-pull
217 // mechanism is synchronized via the |audio_playout_queue_|. 217 // mechanism is synchronized via the |audio_playout_queue_|.
218 InProcessReceiver::Start(); 218 InProcessReceiver::Start();
219 } 219 }
220 220
221 void Stop() final { 221 void Stop() final {
222 // First, stop audio output to the Chromium audio stack. 222 // First, stop audio output to the Chromium audio stack.
223 base::WaitableEvent done(false, false); 223 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
224 base::WaitableEvent::InitialState::NOT_SIGNALED);
224 DCHECK(!AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()); 225 DCHECK(!AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread());
225 AudioManager::Get()->GetTaskRunner()->PostTask( 226 AudioManager::Get()->GetTaskRunner()->PostTask(
226 FROM_HERE, 227 FROM_HERE,
227 base::Bind(&NaivePlayer::StopAudioOutputOnAudioManagerThread, 228 base::Bind(&NaivePlayer::StopAudioOutputOnAudioManagerThread,
228 base::Unretained(this), 229 base::Unretained(this),
229 &done)); 230 &done));
230 done.Wait(); 231 done.Wait();
231 232
232 // Now, stop receiving new frames. 233 // Now, stop receiving new frames.
233 InProcessReceiver::Stop(); 234 InProcessReceiver::Stop();
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 audio_config, 599 audio_config,
599 video_config, 600 video_config,
600 window_width, 601 window_width,
601 window_height); 602 window_height);
602 player.Start(); 603 player.Start();
603 604
604 message_loop.Run(); // Run forever (i.e., until SIGTERM). 605 message_loop.Run(); // Run forever (i.e., until SIGTERM).
605 NOTREACHED(); 606 NOTREACHED();
606 return 0; 607 return 0;
607 } 608 }
OLDNEW
« no previous file with comments | « media/cast/logging/log_event_dispatcher.cc ('k') | media/cast/test/utility/in_process_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698