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

Unified Diff: webkit/plugins/ppapi/ppb_audio_input_impl.cc

Issue 9705056: PepperPlatformAudioInputImpl: support audio input device selection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync&resolve again Created 8 years, 9 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 | « webkit/plugins/ppapi/ppb_audio_input_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_audio_input_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_audio_input_impl.cc b/webkit/plugins/ppapi/ppb_audio_input_impl.cc
index a46db98a14419565ad392548bd9093fe4ee365ad..d7df0c198b4f1c50017d4c9707c64e493f46c511 100644
--- a/webkit/plugins/ppapi/ppb_audio_input_impl.cc
+++ b/webkit/plugins/ppapi/ppb_audio_input_impl.cc
@@ -94,10 +94,14 @@ void PPB_AudioInput_Impl::StreamCreated(
base::SharedMemoryHandle shared_memory_handle,
size_t shared_memory_size,
base::SyncSocket::Handle socket) {
- // TODO(yzshen): Report open failure.
OnOpenComplete(PP_OK, shared_memory_handle, shared_memory_size, socket);
}
+void PPB_AudioInput_Impl::StreamCreationFailed() {
+ OnOpenComplete(PP_ERROR_FAILED, base::SharedMemory::NULLHandle(), 0,
+ base::SyncSocket::kInvalidHandle);
+}
+
int32_t PPB_AudioInput_Impl::InternalEnumerateDevices(
PP_Resource* devices,
PP_CompletionCallback callback) {
@@ -122,11 +126,10 @@ int32_t PPB_AudioInput_Impl::InternalOpen(const std::string& device_id,
if (!plugin_delegate)
return PP_ERROR_FAILED;
- // TODO(yzshen): Open the device specified by |device_id|.
// When the stream is created, we'll get called back on StreamCreated().
DCHECK(!audio_input_);
audio_input_ = plugin_delegate->CreateAudioInput(
- sample_rate, sample_frame_count, this);
+ device_id, sample_rate, sample_frame_count, this);
if (audio_input_) {
open_callback_ = new TrackedCallback(this, callback);
return PP_OK_COMPLETIONPENDING;
@@ -139,14 +142,14 @@ PP_Bool PPB_AudioInput_Impl::InternalStartCapture() {
if (!audio_input_)
return PP_FALSE;
SetStartCaptureState();
- return BoolToPPBool(audio_input_->StartCapture());
+ audio_input_->StartCapture();
+ return PP_TRUE;
}
PP_Bool PPB_AudioInput_Impl::InternalStopCapture() {
if (!audio_input_)
return PP_FALSE;
- if (!audio_input_->StopCapture())
- return PP_FALSE;
+ audio_input_->StopCapture();
SetStopCaptureState();
return PP_TRUE;
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_audio_input_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698