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

Side by Side Diff: ppapi/c/dev/ppb_audio_input_dev.h

Issue 8138008: Implementation of ppapi audio. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
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
3 * found in the LICENSE file.
4 */
5
6 #ifndef PPAPI_C_DEV_PPB_AUDIO_INPUT_DEV_H_
7 #define PPAPI_C_DEV_PPB_AUDIO_INPUT_DEV_H_
8
9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_instance.h"
11 #include "ppapi/c/pp_macros.h"
12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/pp_stdint.h"
14
15 /**
16 * @file
17 * This file defines the <code>PPB_Audio_Input</code> interface, which provides
18 * realtime audio input capture.
19 */
20
21 /**
22 * @addtogroup Typedefs
23 * @{
24 */
25 /**
26 * <code>PPB_Audio_Input_Callback</code> defines the type of an audio callback
27 * function used to provide the audio buffer with data. This callback will be
28 * called on a separate thread to the creation thread.
29 */
30 typedef void (*PPB_AudioInput_Callback)(void* sample_buffer,
31 uint32_t buffer_size_in_bytes,
32 void* user_data);
33
34 /**
35 * @addtogroup Interfaces
36 * @{
37 */
38 /**
39 * The <code>PPB_AudioInput_Dev</code> interface contains pointers to several
40 * functions for handling audio input resources.
41 */
42
43 #define PPB_AUDIO_INPUT_DEV_INTERFACE_0_1 "PPB_AudioInput(Dev);0.1"
44 #define PPB_AUDIO_INPUT_DEV_INTERFACE PPB_AUDIO_INPUT_DEV_INTERFACE_0_1
45
46 struct PPB_AudioInput_Dev {
47 /**
48 * Create is a pointer to a function that creates an audio input resource.
49 * No sound will be captured until StartCapture() is called.
50 */
51 PP_Resource (*Create)(PP_Instance instance,
52 PPB_AudioInput_Callback audio_input_callback,
53 void* user_data);
54
55 /**
56 * IsAudioInput is a pointer to a function that determines if the given
57 * resource is an audio input resource.
58 *
59 * @param[in] resource A PP_Resource containing a resource.
60 *
61 * @return A PP_BOOL containing containing PP_TRUE if the given resource is
62 * an audio input resource, otherwise PP_FALSE.
63 */
64 PP_Bool (*IsAudioInput)(PP_Resource audio_input);
65
66
67 /**
68 * StartCapture() starts the capture of the audio input resource and begins
69 * periodically calling the callback.
70 *
71 * @param[in] config A <code>PP_Resource</code> corresponding to an audio
72 * input resource.
73 *
74 * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if
75 * successful, otherwise <code>PP_FALSE</code>. Also returns
76 * <code>PP_TRUE</code> (and be a no-op) if called while callback is already
77 * in progress.
78 */
79 PP_Bool (*StartCapture)(PP_Resource audio_input);
80
81 /**
82 * StopCapture is a pointer to a function that stops the capture of
83 * the audio input resource.
84 *
85 * @param[in] config A PP_Resource containing the audio input resource.
86 *
87 * @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE.
88 * Also returns PP_TRUE (and is a no-op) if called while capture is already
89 * stopped. If a buffer is being captured, StopCapture will block until the
90 * call completes.
91 */
92 PP_Bool (*StopCapture)(PP_Resource audio_input);
93 };
94 /**
95 * @}
96 */
97
98 #endif /* PPAPI_C_PPB_AUDIO_INPUT_DEV_H_ */
99
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698