1
/* $Id: audiodev_imp.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __AUDIODEV_IMP_H__
21
#define __AUDIODEV_IMP_H__
23
#include <pjmedia-audiodev/audiodev.h>
26
* @defgroup s8_audio_device_implementors_api Audio Device Implementors API
27
* @ingroup audio_device_api
28
* @brief API for audio device implementors
33
* Sound device factory operations.
35
typedef struct pjmedia_aud_dev_factory_op
38
* Initialize the audio device factory.
40
* @param f The audio device factory.
42
pj_status_t (*init)(pjmedia_aud_dev_factory *f);
45
* Close this audio device factory and release all resources back to the
48
* @param f The audio device factory.
50
pj_status_t (*destroy)(pjmedia_aud_dev_factory *f);
53
* Get the number of audio devices installed in the system.
55
* @param f The audio device factory.
57
unsigned (*get_dev_count)(pjmedia_aud_dev_factory *f);
60
* Get the audio device information and capabilities.
62
* @param f The audio device factory.
63
* @param index Device index.
64
* @param info The audio device information structure which will be
65
* initialized by this function once it returns
68
pj_status_t (*get_dev_info)(pjmedia_aud_dev_factory *f,
70
pjmedia_aud_dev_info *info);
73
* Initialize the specified audio device parameter with the default
74
* values for the specified device.
76
* @param f The audio device factory.
77
* @param index Device index.
78
* @param param The audio device parameter.
80
pj_status_t (*default_param)(pjmedia_aud_dev_factory *f,
82
pjmedia_aud_param *param);
85
* Open the audio device and create audio stream. See
86
* #pjmedia_aud_stream_create()
88
pj_status_t (*create_stream)(pjmedia_aud_dev_factory *f,
89
const pjmedia_aud_param *param,
90
pjmedia_aud_rec_cb rec_cb,
91
pjmedia_aud_play_cb play_cb,
93
pjmedia_aud_stream **p_aud_strm);
96
* Refresh the list of audio devices installed in the system.
98
* @param f The audio device factory.
100
pj_status_t (*refresh)(pjmedia_aud_dev_factory *f);
102
} pjmedia_aud_dev_factory_op;
106
* This structure describes an audio device factory.
108
struct pjmedia_aud_dev_factory
110
/** Internal data to be initialized by audio subsystem. */
117
pjmedia_aud_dev_factory_op *op;
122
* Sound stream operations.
124
typedef struct pjmedia_aud_stream_op
127
* See #pjmedia_aud_stream_get_param()
129
pj_status_t (*get_param)(pjmedia_aud_stream *strm,
130
pjmedia_aud_param *param);
133
* See #pjmedia_aud_stream_get_cap()
135
pj_status_t (*get_cap)(pjmedia_aud_stream *strm,
136
pjmedia_aud_dev_cap cap,
140
* See #pjmedia_aud_stream_set_cap()
142
pj_status_t (*set_cap)(pjmedia_aud_stream *strm,
143
pjmedia_aud_dev_cap cap,
147
* See #pjmedia_aud_stream_start()
149
pj_status_t (*start)(pjmedia_aud_stream *strm);
152
* See #pjmedia_aud_stream_stop().
154
pj_status_t (*stop)(pjmedia_aud_stream *strm);
157
* See #pjmedia_aud_stream_destroy().
159
pj_status_t (*destroy)(pjmedia_aud_stream *strm);
161
} pjmedia_aud_stream_op;
165
* This structure describes the audio device stream.
167
struct pjmedia_aud_stream
169
/** Internal data to be initialized by audio subsystem */
176
pjmedia_aud_stream_op *op;
188
#endif /* __AUDIODEV_IMP_H__ */