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

Side by Side Diff: ppapi/cpp/dev/audio_input_dev.cc

Issue 8566044: Pepper: Add IsAvailable() static methods to C++ wrappers to AudioInput_Dev and VideoCapture_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/dev/audio_input_dev.h ('k') | ppapi/cpp/dev/video_capture_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/cpp/dev/audio_input_dev.h" 5 #include "ppapi/cpp/dev/audio_input_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_audio_input_dev.h" 7 #include "ppapi/c/dev/ppb_audio_input_dev.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/cpp/instance.h" 9 #include "ppapi/cpp/instance.h"
10 #include "ppapi/cpp/module.h" 10 #include "ppapi/cpp/module.h"
(...skipping 13 matching lines...) Expand all
24 const AudioConfig& config, 24 const AudioConfig& config,
25 PPB_AudioInput_Callback callback, 25 PPB_AudioInput_Callback callback,
26 void* user_data) 26 void* user_data)
27 : config_(config) { 27 : config_(config) {
28 if (has_interface<PPB_AudioInput_Dev>()) { 28 if (has_interface<PPB_AudioInput_Dev>()) {
29 PassRefFromConstructor(get_interface<PPB_AudioInput_Dev>()->Create( 29 PassRefFromConstructor(get_interface<PPB_AudioInput_Dev>()->Create(
30 instance->pp_instance(), config.pp_resource(), callback, user_data)); 30 instance->pp_instance(), config.pp_resource(), callback, user_data));
31 } 31 }
32 } 32 }
33 33
34 // static
35 bool AudioInput_Dev::IsAvailable() {
36 return has_interface<PPB_AudioInput_Dev>();
37 }
38
34 bool AudioInput_Dev::StartCapture() { 39 bool AudioInput_Dev::StartCapture() {
35 return has_interface<PPB_AudioInput_Dev>() && 40 return has_interface<PPB_AudioInput_Dev>() &&
36 get_interface<PPB_AudioInput_Dev>()->StartCapture(pp_resource()); 41 get_interface<PPB_AudioInput_Dev>()->StartCapture(pp_resource());
37 } 42 }
38 43
39 bool AudioInput_Dev::StopCapture() { 44 bool AudioInput_Dev::StopCapture() {
40 return has_interface<PPB_AudioInput_Dev>() && 45 return has_interface<PPB_AudioInput_Dev>() &&
41 get_interface<PPB_AudioInput_Dev>()->StopCapture(pp_resource()); 46 get_interface<PPB_AudioInput_Dev>()->StopCapture(pp_resource());
42 } 47 }
43 48
44 } // namespace pp 49 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/audio_input_dev.h ('k') | ppapi/cpp/dev/video_capture_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698