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

Side by Side Diff: Source/modules/webaudio/DefaultAudioDestinationNode.cpp

Issue 663003002: Revert of Implement suspend/resume for AudioContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 { 83 {
84 float hardwareSampleRate = AudioDestination::hardwareSampleRate(); 84 float hardwareSampleRate = AudioDestination::hardwareSampleRate();
85 WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate); 85 WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
86 86
87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI nputChannels, channelCount(), hardwareSampleRate); 87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI nputChannels, channelCount(), hardwareSampleRate);
88 } 88 }
89 89
90 void DefaultAudioDestinationNode::startRendering() 90 void DefaultAudioDestinationNode::startRendering()
91 { 91 {
92 ASSERT(isInitialized()); 92 ASSERT(isInitialized());
93 if (isInitialized()) { 93 if (isInitialized())
94 ASSERT(!m_destination->isPlaying());
95 m_destination->start(); 94 m_destination->start();
96 }
97 }
98
99 void DefaultAudioDestinationNode::stopRendering()
100 {
101 ASSERT(isInitialized());
102 if (isInitialized()) {
103 ASSERT(m_destination->isPlaying());
104 m_destination->stop();
105 }
106 } 95 }
107 96
108 unsigned long DefaultAudioDestinationNode::maxChannelCount() const 97 unsigned long DefaultAudioDestinationNode::maxChannelCount() const
109 { 98 {
110 return AudioDestination::maxChannelCount(); 99 return AudioDestination::maxChannelCount();
111 } 100 }
112 101
113 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionState& exceptionState) 102 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionState& exceptionState)
114 { 103 {
115 // The channelCount for the input to this node controls the actual number of channels we 104 // The channelCount for the input to this node controls the actual number of channels we
(...skipping 16 matching lines...) Expand all
132 // Re-create destination. 121 // Re-create destination.
133 m_destination->stop(); 122 m_destination->stop();
134 createDestination(); 123 createDestination();
135 m_destination->start(); 124 m_destination->start();
136 } 125 }
137 } 126 }
138 127
139 } // namespace blink 128 } // namespace blink
140 129
141 #endif // ENABLE(WEB_AUDIO) 130 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/DefaultAudioDestinationNode.h ('k') | Source/modules/webaudio/OfflineAudioDestinationNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698