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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_audio.h

Issue 10832285: Switch OnMoreData() to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review ready. Created 8 years, 4 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 // 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 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_ 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_
6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_ 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_
7 7
8 #include <pthread.h> 8 #include <pthread.h>
9 #include "native_client/src/include/nacl_base.h" 9 #include "native_client/src/include/nacl_base.h"
10 #include "native_client/src/include/nacl_macros.h" 10 #include "native_client/src/include/nacl_macros.h"
11 #include "native_client/src/include/portability.h" 11 #include "native_client/src/include/portability.h"
12 #include "native_client/src/include/ref_counted.h" 12 #include "native_client/src/include/ref_counted.h"
13 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" 13 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h"
14 #include "native_client/src/shared/srpc/nacl_srpc.h" 14 #include "native_client/src/shared/srpc/nacl_srpc.h"
15 #include "media/base/audio_bus.h"
15 #include "ppapi/c/pp_resource.h" 16 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/ppb_audio.h" 17 #include "ppapi/c/ppb_audio.h"
17 18
18 namespace ppapi_proxy { 19 namespace ppapi_proxy {
19 20
20 enum PluginAudioState { 21 enum PluginAudioState {
21 AUDIO_INCOMPLETE = 0, // StreamCreated not yet invoked 22 AUDIO_INCOMPLETE = 0, // StreamCreated not yet invoked
22 AUDIO_PENDING, // Incomplete and app requested StartPlayback 23 AUDIO_PENDING, // Incomplete and app requested StartPlayback
23 AUDIO_READY, // StreamCreated invoked, ready for playback 24 AUDIO_READY, // StreamCreated invoked, ready for playback
24 AUDIO_PLAYING // Audio in playback 25 AUDIO_PLAYING // Audio in playback
(...skipping 27 matching lines...) Expand all
52 PP_Resource resource_; 53 PP_Resource resource_;
53 NaClSrpcImcDescType socket_; 54 NaClSrpcImcDescType socket_;
54 NaClSrpcImcDescType shm_; 55 NaClSrpcImcDescType shm_;
55 size_t shm_size_; 56 size_t shm_size_;
56 void *shm_buffer_; 57 void *shm_buffer_;
57 PluginAudioState state_; 58 PluginAudioState state_;
58 uintptr_t thread_id_; 59 uintptr_t thread_id_;
59 bool thread_active_; 60 bool thread_active_;
60 PPB_Audio_Callback user_callback_; 61 PPB_Audio_Callback user_callback_;
61 void* user_data_; 62 void* user_data_;
63 // AudioBus for shuttling data across the shared memory.
64 scoped_ptr<media::AudioBus> audio_bus_;
65 // Internal buffer for user's integer audio data.
66 int audio_buffer_size_;
67 scoped_ptr<uint8_t> audio_buffer_;
Chris Rogers 2012/08/24 20:20:26 I think this should be scoped_array<> ??
DaleCurtis 2012/08/24 23:53:12 Done.
62 68
63 IMPLEMENT_RESOURCE(PluginAudio); 69 IMPLEMENT_RESOURCE(PluginAudio);
64 NACL_DISALLOW_COPY_AND_ASSIGN(PluginAudio); 70 NACL_DISALLOW_COPY_AND_ASSIGN(PluginAudio);
65 }; 71 };
66 72
67 } // namespace ppapi_proxy 73 } // namespace ppapi_proxy
68 74
69 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_ 75 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_AUDIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698