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

Unified Diff: ppapi/cpp/dev/audio_input_dev.cc

Issue 8574029: Microphone support for Pepper Flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 1 month 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/cpp/dev/audio_input_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/audio_input_dev.cc
diff --git a/ppapi/cpp/dev/audio_input_dev.cc b/ppapi/cpp/dev/audio_input_dev.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd8194565cf3252da6c7c0ef3cad161baf5ede59
--- /dev/null
+++ b/ppapi/cpp/dev/audio_input_dev.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/dev/audio_input_dev.h"
+
+#include "ppapi/c/dev/ppb_audio_input_dev.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_AudioInput_Dev>() {
+ return PPB_AUDIO_INPUT_DEV_INTERFACE;
+}
+
+} // namespace
+
+AudioInput_Dev::AudioInput_Dev(Instance* instance,
+ const AudioConfig& config,
+ PPB_AudioInput_Callback callback,
+ void* user_data)
+ : config_(config) {
+ if (has_interface<PPB_AudioInput_Dev>()) {
+ PassRefFromConstructor(get_interface<PPB_AudioInput_Dev>()->Create(
+ instance->pp_instance(), config.pp_resource(), callback, user_data));
+ }
+}
+
+bool AudioInput_Dev::StartCapture() {
+ return has_interface<PPB_AudioInput_Dev>() &&
+ get_interface<PPB_AudioInput_Dev>()->StartCapture(pp_resource());
+}
+
+bool AudioInput_Dev::StopCapture() {
+ return has_interface<PPB_AudioInput_Dev>() &&
+ get_interface<PPB_AudioInput_Dev>()->StopCapture(pp_resource());
+}
+
+} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/audio_input_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698