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 "ppapi/proxy/ppb_audio_proxy.h" | 5 #include "ppapi/proxy/ppb_audio_proxy.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/threading/simple_thread.h" | 9 #include "base/threading/simple_thread.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 enter.object()->StartPlayback(); | 242 enter.object()->StartPlayback(); |
243 else | 243 else |
244 enter.object()->StopPlayback(); | 244 enter.object()->StopPlayback(); |
245 } | 245 } |
246 | 246 |
247 void PPB_Audio_Proxy::AudioChannelConnected( | 247 void PPB_Audio_Proxy::AudioChannelConnected( |
248 int32_t result, | 248 int32_t result, |
249 const HostResource& resource) { | 249 const HostResource& resource) { |
250 IPC::PlatformFileForTransit socket_handle = | 250 IPC::PlatformFileForTransit socket_handle = |
251 IPC::InvalidPlatformFileForTransit(); | 251 IPC::InvalidPlatformFileForTransit(); |
252 base::SharedMemoryHandle shared_memory = base::SharedMemory::NULLHandle(); | 252 base::SharedMemoryHandle shared_memory; |
253 uint32_t audio_buffer_length = 0; | 253 uint32_t audio_buffer_length = 0; |
254 | 254 |
255 int32_t result_code = result; | 255 int32_t result_code = result; |
256 if (result_code == PP_OK) { | 256 if (result_code == PP_OK) { |
257 result_code = GetAudioConnectedHandles(resource, &socket_handle, | 257 result_code = GetAudioConnectedHandles(resource, &socket_handle, |
258 &shared_memory, | 258 &shared_memory, |
259 &audio_buffer_length); | 259 &audio_buffer_length); |
260 } | 260 } |
261 | 261 |
262 // Send all the values, even on error. This simplifies some of our cleanup | 262 // Send all the values, even on error. This simplifies some of our cleanup |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 static_cast<Audio*>(enter.object())->SetStreamInfo( | 331 static_cast<Audio*>(enter.object())->SetStreamInfo( |
332 enter.resource()->pp_instance(), handle.shmem(), handle.size(), | 332 enter.resource()->pp_instance(), handle.shmem(), handle.size(), |
333 IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()), | 333 IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()), |
334 config.object()->GetSampleRate(), | 334 config.object()->GetSampleRate(), |
335 config.object()->GetSampleFrameCount()); | 335 config.object()->GetSampleFrameCount()); |
336 } | 336 } |
337 } | 337 } |
338 | 338 |
339 } // namespace proxy | 339 } // namespace proxy |
340 } // namespace ppapi | 340 } // namespace ppapi |
OLD | NEW |