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

Unified Diff: ppapi/shared_impl/ppb_audio_shared.h

Issue 10832285: Switch OnMoreData() to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Use actual frame count for PPAPI. 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/shared_impl/ppb_audio_shared.h
diff --git a/ppapi/shared_impl/ppb_audio_shared.h b/ppapi/shared_impl/ppb_audio_shared.h
index ed3a5c266ef3a1ee23e905ea7a980e11b6d739b7..43e1a42ee0c5b824b20305107f271646b1406863 100644
--- a/ppapi/shared_impl/ppb_audio_shared.h
+++ b/ppapi/shared_impl/ppb_audio_shared.h
@@ -9,6 +9,7 @@
#include "base/shared_memory.h"
#include "base/sync_socket.h"
#include "base/threading/simple_thread.h"
+#include "media/base/audio_bus.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_audio_api.h"
@@ -53,7 +54,8 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared
void SetStreamInfo(PP_Instance instance,
base::SharedMemoryHandle shared_memory_handle,
size_t shared_memory_size,
- base::SyncSocket::Handle socket_handle);
+ base::SyncSocket::Handle socket_handle,
+ int sample_frame_count);
#if defined(OS_NACL)
// NaCl has a special API for IRT code to create threads that can call back
@@ -102,6 +104,13 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared
// User data pointer passed verbatim to the callback function.
void* user_data_;
+ // AudioBus for shuttling data across the shared memory.
+ scoped_ptr<media::AudioBus> audio_bus_;
+
+ // Internal buffer for user's integer audio data.
+ int audio_buffer_size_bytes_;
+ scoped_array<uint8_t> audio_buffer_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Shared);
};

Powered by Google App Engine
This is Rietveld 408576698