chenqiyang
2022-09-02 6a99d9bf65aa5878cb409945ed2bdbdcb916d047
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * Copyright (c) 2010-2020 Belledonne Communications SARL.
 *
 * This file is part of Liblinphone.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
 
#ifndef LINPHONE_AUDIO_DEVICE_H
#define LINPHONE_AUDIO_DEVICE_H
 
#include "linphone/api/c-types.h"
 
/**
 * @addtogroup audio
 * @{
 */
 
#ifdef __cplusplus
extern "C" {
#endif
 
/**
 * Returns the id of the audio device
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @return the id of the audio device. @notnil
 */
LINPHONE_PUBLIC const char *linphone_audio_device_get_id(const LinphoneAudioDevice *audio_device);
 
/**
 * Returns the name of the audio device
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @return the name of the audio device. @notnil
 */
LINPHONE_PUBLIC const char *linphone_audio_device_get_device_name(const LinphoneAudioDevice *audio_device);
 
/**
 * Returns the driver name used by the device
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @returns the name of the driver used by this audio device. @notnil
 */
LINPHONE_PUBLIC const char *linphone_audio_device_get_driver_name(const LinphoneAudioDevice *audio_device);
 
/**
 * Returns the capabilities of the device
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @returns the #LinphoneAudioDeviceCapabilities of the audio device (RECORD, PLAY or both) as a bit mask
 */
LINPHONE_PUBLIC LinphoneAudioDeviceCapabilities linphone_audio_device_get_capabilities(const LinphoneAudioDevice *audio_device);
 
/**
 * Returns the type of the device
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @returns the #LinphoneAudioDeviceType of the audio device (microphone, speaker, earpiece, bluetooth, etc...)
 */
LINPHONE_PUBLIC LinphoneAudioDeviceType linphone_audio_device_get_type(const LinphoneAudioDevice *audio_device);
 
/**
 * Returns whether or not the audio device has the given capability
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @param capability the #LinphoneAudioDeviceCapabilities to check
 * @returns TRUE if the audio device has the capability, FALSE otherwise
 */
LINPHONE_PUBLIC bool_t linphone_audio_device_has_capability(const LinphoneAudioDevice *audio_device, const LinphoneAudioDeviceCapabilities capability);
 
/**
 * Takes a reference on a #LinphoneAudioDevice.
 * @param audio_device the #LinphoneAudioDevice. @notnil
 * @return the same #LinphoneAudioDevice object
 */
LINPHONE_PUBLIC LinphoneAudioDevice *linphone_audio_device_ref(LinphoneAudioDevice *audio_device);
 
/**
 * Releases a #LinphoneAudioDevice.
 * @param audio_device the #LinphoneAudioDevice. @notnil
 */
LINPHONE_PUBLIC void linphone_audio_device_unref(LinphoneAudioDevice *audio_device);
 
/**
 * @}
 */
 
#ifdef __cplusplus
}
#endif
 
#endif