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

Side by Side Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 10918083: Changes to allow testing interface for new NaCl Proxy (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppb_testing_proxy.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 "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/threading/simple_thread.h" 8 #include "base/threading/simple_thread.h"
9 #include "media/audio/shared_memory_util.h" 9 #include "media/audio/shared_memory_util.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 PP_Resource config_id, 67 PP_Resource config_id,
68 PPB_Audio_Callback callback, 68 PPB_Audio_Callback callback,
69 void* user_data) 69 void* user_data)
70 : Resource(OBJECT_IS_PROXY, audio_id), 70 : Resource(OBJECT_IS_PROXY, audio_id),
71 config_(config_id) { 71 config_(config_id) {
72 SetCallback(callback, user_data); 72 SetCallback(callback, user_data);
73 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); 73 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_);
74 } 74 }
75 75
76 Audio::~Audio() { 76 Audio::~Audio() {
77 #if defined(OS_NACL)
78 // Invoke StopPlayback() to ensure audio back-end has a chance to send the
79 // escape value over the sync socket, which will terminate the client side
80 // audio callback loop. This is required for NaCl Plugins that can't escape
81 // by shutting down the sync_socket.
82 StopPlayback();
83 #endif
bbudge 2012/09/19 22:31:31 Thanks for the fix. I just noticed it on Windows (
77 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_); 84 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_);
78 } 85 }
79 86
80 PPB_Audio_API* Audio::AsPPB_Audio_API() { 87 PPB_Audio_API* Audio::AsPPB_Audio_API() {
81 return this; 88 return this;
82 } 89 }
83 90
84 PP_Resource Audio::GetCurrentConfig() { 91 PP_Resource Audio::GetCurrentConfig() {
85 // AddRef for the caller. 92 // AddRef for the caller.
86 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); 93 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_);
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 static_cast<Audio*>(enter.object())->SetStreamInfo( 339 static_cast<Audio*>(enter.object())->SetStreamInfo(
333 enter.resource()->pp_instance(), handle.shmem(), 340 enter.resource()->pp_instance(), handle.shmem(),
334 media::PacketSizeInBytes(handle.size()), 341 media::PacketSizeInBytes(handle.size()),
335 IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()), 342 IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()),
336 config.object()->GetSampleFrameCount()); 343 config.object()->GetSampleFrameCount());
337 } 344 }
338 } 345 }
339 346
340 } // namespace proxy 347 } // namespace proxy
341 } // namespace ppapi 348 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppb_testing_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698