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

Side by Side Diff: media/audio/audio_output_device.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
« no previous file with comments | « no previous file | media/audio/clockless_audio_sink.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/audio/audio_output_device.h" 5 #include "media/audio/audio_output_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 : ScopedTaskRunnerObserver(io_task_runner), 56 : ScopedTaskRunnerObserver(io_task_runner),
57 callback_(NULL), 57 callback_(NULL),
58 ipc_(std::move(ipc)), 58 ipc_(std::move(ipc)),
59 state_(IDLE), 59 state_(IDLE),
60 start_on_authorized_(false), 60 start_on_authorized_(false),
61 play_on_start_(true), 61 play_on_start_(true),
62 session_id_(session_id), 62 session_id_(session_id),
63 device_id_(device_id), 63 device_id_(device_id),
64 security_origin_(security_origin), 64 security_origin_(security_origin),
65 stopping_hack_(false), 65 stopping_hack_(false),
66 did_receive_auth_(true, false), 66 did_receive_auth_(base::WaitableEvent::ResetPolicy::MANUAL,
67 base::WaitableEvent::InitialState::NOT_SIGNALED),
67 device_status_(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL) { 68 device_status_(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL) {
68 CHECK(ipc_); 69 CHECK(ipc_);
69 70
70 // The correctness of the code depends on the relative values assigned in the 71 // The correctness of the code depends on the relative values assigned in the
71 // State enum. 72 // State enum.
72 static_assert(IPC_CLOSED < IDLE, "invalid enum value assignment 0"); 73 static_assert(IPC_CLOSED < IDLE, "invalid enum value assignment 0");
73 static_assert(IDLE < AUTHORIZING, "invalid enum value assignment 1"); 74 static_assert(IDLE < AUTHORIZING, "invalid enum value assignment 1");
74 static_assert(AUTHORIZING < AUTHORIZED, "invalid enum value assignment 2"); 75 static_assert(AUTHORIZING < AUTHORIZED, "invalid enum value assignment 2");
75 static_assert(AUTHORIZED < CREATING_STREAM, 76 static_assert(AUTHORIZED < CREATING_STREAM,
76 "invalid enum value assignment 3"); 77 "invalid enum value assignment 3");
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 444
444 // Update the audio-delay measurement, inform about the number of skipped 445 // Update the audio-delay measurement, inform about the number of skipped
445 // frames, and ask client to render audio. Since |output_bus_| is wrapping 446 // frames, and ask client to render audio. Since |output_bus_| is wrapping
446 // the shared memory the Render() call is writing directly into the shared 447 // the shared memory the Render() call is writing directly into the shared
447 // memory. 448 // memory.
448 render_callback_->Render(output_bus_.get(), std::round(frames_delayed), 449 render_callback_->Render(output_bus_.get(), std::round(frames_delayed),
449 frames_skipped); 450 frames_skipped);
450 } 451 }
451 452
452 } // namespace media 453 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/clockless_audio_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698