Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-audiodev/audiodev_imp.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __AUDIODEV_IMP_H__
20 #define __AUDIODEV_IMP_H__
21
22 #include <pjmedia-audiodev/audiodev.h>
23
24 /**
25 * @defgroup s8_audio_device_implementors_api Audio Device Implementors API
26 * @ingroup audio_device_api
27 * @brief API for audio device implementors
28 * @{
29 */
30
31 /**
32 * Sound device factory operations.
33 */
34 typedef struct pjmedia_aud_dev_factory_op
35 {
36 /**
37 * Initialize the audio device factory.
38 *
39 * @param f The audio device factory.
40 */
41 pj_status_t (*init)(pjmedia_aud_dev_factory *f);
42
43 /**
44 * Close this audio device factory and release all resources back to the
45 * operating system.
46 *
47 * @param f The audio device factory.
48 */
49 pj_status_t (*destroy)(pjmedia_aud_dev_factory *f);
50
51 /**
52 * Get the number of audio devices installed in the system.
53 *
54 * @param f The audio device factory.
55 */
56 unsigned (*get_dev_count)(pjmedia_aud_dev_factory *f);
57
58 /**
59 * Get the audio device information and capabilities.
60 *
61 * @param f The audio device factory.
62 * @param index Device index.
63 * @param info The audio device information structure which will be
64 * initialized by this function once it returns
65 * successfully.
66 */
67 pj_status_t (*get_dev_info)(pjmedia_aud_dev_factory *f,
68 unsigned index,
69 pjmedia_aud_dev_info *info);
70
71 /**
72 * Initialize the specified audio device parameter with the default
73 * values for the specified device.
74 *
75 * @param f The audio device factory.
76 * @param index Device index.
77 * @param param The audio device parameter.
78 */
79 pj_status_t (*default_param)(pjmedia_aud_dev_factory *f,
80 unsigned index,
81 pjmedia_aud_param *param);
82
83 /**
84 * Open the audio device and create audio stream. See
85 * #pjmedia_aud_stream_create()
86 */
87 pj_status_t (*create_stream)(pjmedia_aud_dev_factory *f,
88 const pjmedia_aud_param *param,
89 pjmedia_aud_rec_cb rec_cb,
90 pjmedia_aud_play_cb play_cb,
91 void *user_data,
92 pjmedia_aud_stream **p_aud_strm);
93
94 /**
95 * Refresh the list of audio devices installed in the system.
96 *
97 * @param f The audio device factory.
98 */
99 pj_status_t (*refresh)(pjmedia_aud_dev_factory *f);
100
101 } pjmedia_aud_dev_factory_op;
102
103
104 /**
105 * This structure describes an audio device factory.
106 */
107 struct pjmedia_aud_dev_factory
108 {
109 /** Internal data to be initialized by audio subsystem. */
110 struct {
111 /** Driver index */
112 unsigned drv_idx;
113 } sys;
114
115 /** Operations */
116 pjmedia_aud_dev_factory_op *op;
117 };
118
119
120 /**
121 * Sound stream operations.
122 */
123 typedef struct pjmedia_aud_stream_op
124 {
125 /**
126 * See #pjmedia_aud_stream_get_param()
127 */
128 pj_status_t (*get_param)(pjmedia_aud_stream *strm,
129 pjmedia_aud_param *param);
130
131 /**
132 * See #pjmedia_aud_stream_get_cap()
133 */
134 pj_status_t (*get_cap)(pjmedia_aud_stream *strm,
135 pjmedia_aud_dev_cap cap,
136 void *value);
137
138 /**
139 * See #pjmedia_aud_stream_set_cap()
140 */
141 pj_status_t (*set_cap)(pjmedia_aud_stream *strm,
142 pjmedia_aud_dev_cap cap,
143 const void *value);
144
145 /**
146 * See #pjmedia_aud_stream_start()
147 */
148 pj_status_t (*start)(pjmedia_aud_stream *strm);
149
150 /**
151 * See #pjmedia_aud_stream_stop().
152 */
153 pj_status_t (*stop)(pjmedia_aud_stream *strm);
154
155 /**
156 * See #pjmedia_aud_stream_destroy().
157 */
158 pj_status_t (*destroy)(pjmedia_aud_stream *strm);
159
160 } pjmedia_aud_stream_op;
161
162
163 /**
164 * This structure describes the audio device stream.
165 */
166 struct pjmedia_aud_stream
167 {
168 /** Internal data to be initialized by audio subsystem */
169 struct {
170 /** Driver index */
171 unsigned drv_idx;
172 } sys;
173
174 /** Operations */
175 pjmedia_aud_stream_op *op;
176 };
177
178
179
180
181 /**
182 * @}
183 */
184
185
186
187 #endif /* __AUDIODEV_IMP_H__ */