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

Unified Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 22886005: Switch audio synchronization from sleep() based to select() based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK. Created 7 years, 2 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
« no previous file with comments | « ppapi/proxy/audio_input_resource.cc ('k') | ppapi/shared_impl/ppb_audio_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_audio_proxy.cc
diff --git a/ppapi/proxy/ppb_audio_proxy.cc b/ppapi/proxy/ppb_audio_proxy.cc
index 49ed0afb2d2e255757645b0347d42e0567e79680..58f5abc0d4141f747e3a2845dd1682ccfc4388ff 100644
--- a/ppapi/proxy/ppb_audio_proxy.cc
+++ b/ppapi/proxy/ppb_audio_proxy.cc
@@ -6,7 +6,6 @@
#include "base/compiler_specific.h"
#include "base/threading/simple_thread.h"
-#include "media/audio/shared_memory_util.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/c/ppb_audio_config.h"
@@ -262,15 +261,7 @@ void PPB_Audio_Proxy::AudioChannelConnected(
// us, as long as the remote side always closes the handles it receives
// (in OnMsgNotifyAudioStreamCreated), even in the failure case.
SerializedHandle fd_wrapper(SerializedHandle::SOCKET, socket_handle);
-
- // Note that we must call TotalSharedMemorySizeInBytes because
- // Audio allocates extra space in shared memory for book-keeping, so the
- // actual size of the shared memory buffer is larger than audio_buffer_length.
- // When sending to NaCl, NaClIPCAdapter expects this size to match the size
- // of the full shared memory buffer.
- SerializedHandle handle_wrapper(
- shared_memory,
- media::TotalSharedMemorySizeInBytes(audio_buffer_length));
+ SerializedHandle handle_wrapper(shared_memory, audio_buffer_length);
dispatcher()->Send(new PpapiMsg_PPBAudio_NotifyAudioStreamCreated(
API_ID_PPB_AUDIO, resource, result_code, fd_wrapper, handle_wrapper));
}
@@ -333,13 +324,8 @@ void PPB_Audio_Proxy::OnMsgNotifyAudioStreamCreated(
} else {
EnterResourceNoLock<PPB_AudioConfig_API> config(
static_cast<Audio*>(enter.object())->GetCurrentConfig(), true);
- // See the comment above about how we must call
- // TotalSharedMemorySizeInBytes to get the actual size of the buffer. Here,
- // we must call PacketSizeInBytes to get back the size of the audio buffer,
- // excluding the bytes that audio uses for book-keeping.
static_cast<Audio*>(enter.object())->SetStreamInfo(
- enter.resource()->pp_instance(), handle.shmem(),
- media::PacketSizeInBytes(handle.size()),
+ enter.resource()->pp_instance(), handle.shmem(), handle.size(),
IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()),
config.object()->GetSampleRate(),
config.object()->GetSampleFrameCount());
« no previous file with comments | « ppapi/proxy/audio_input_resource.cc ('k') | ppapi/shared_impl/ppb_audio_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698