OLD | NEW |
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 "content/renderer/pepper/pepper_platform_audio_output_impl.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 FROM_HERE, | 131 FROM_HERE, |
132 base::Bind(&PepperPlatformAudioOutputImpl::InitializeOnIOThread, | 132 base::Bind(&PepperPlatformAudioOutputImpl::InitializeOnIOThread, |
133 this, params)); | 133 this, params)); |
134 return true; | 134 return true; |
135 } | 135 } |
136 | 136 |
137 void PepperPlatformAudioOutputImpl::InitializeOnIOThread( | 137 void PepperPlatformAudioOutputImpl::InitializeOnIOThread( |
138 const media::AudioParameters& params) { | 138 const media::AudioParameters& params) { |
139 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> | 139 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> |
140 BelongsToCurrentThread()); | 140 BelongsToCurrentThread()); |
| 141 const int kSessionId = 0; |
141 if (ipc_) | 142 if (ipc_) |
142 ipc_->CreateStream(this, params); | 143 ipc_->CreateStream(this, params, kSessionId); |
143 } | 144 } |
144 | 145 |
145 void PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread() { | 146 void PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread() { |
146 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> | 147 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> |
147 BelongsToCurrentThread()); | 148 BelongsToCurrentThread()); |
148 if (ipc_) | 149 if (ipc_) |
149 ipc_->PlayStream(); | 150 ipc_->PlayStream(); |
150 } | 151 } |
151 | 152 |
152 void PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread() { | 153 void PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread() { |
(...skipping 12 matching lines...) Expand all Loading... |
165 return; | 166 return; |
166 | 167 |
167 ipc_->CloseStream(); | 168 ipc_->CloseStream(); |
168 ipc_.reset(); | 169 ipc_.reset(); |
169 | 170 |
170 Release(); // Release for the delegate, balances out the reference taken in | 171 Release(); // Release for the delegate, balances out the reference taken in |
171 // PepperPluginDelegateImpl::CreateAudio. | 172 // PepperPluginDelegateImpl::CreateAudio. |
172 } | 173 } |
173 | 174 |
174 } // namespace content | 175 } // namespace content |
OLD | NEW |