This file is indexed.

/usr/include/guvcview-2/libgviewaudio/gviewaudio.h is in libguvcview-dev 2.0.1+debian-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/*******************************************************************************#
#           guvcview              http://guvcview.sourceforge.net               #
#                                                                               #
#           Paulo Assis <pj.assis@gmail.com>                                    #
#           Nobuhiro Iwamatsu <iwamatsu@nigauri.org>                            #
#                             Add UYVY color support(Macbook iSight)            #
#           Flemming Frandsen <dren.dk@gmail.com>                               #
#                             Add VU meter OSD                                  #
#                                                                               #
# 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 2 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, write to the Free Software                   #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA     #
#                                                                               #
********************************************************************************/

/*******************************************************************************#
#                                                                               #
#  Audio library                                                                #
#                                                                               #
********************************************************************************/

#ifndef GVIEWAUDIO_H
#define GVIEWAUDIO_H

#include <features.h>

#include <inttypes.h>
#include <sys/types.h>

/*make sure we support c++*/
__BEGIN_DECLS

/*Audio API*/
#define AUDIO_NONE          (0)
#define AUDIO_PORTAUDIO     (1)
#define AUDIO_PULSE         (2)

/*Audio Buffer flags*/
#define AUDIO_BUFF_FREE     (0)
#define AUDIO_BUFF_USED     (1)

/*Audio stream flag*/
#define AUDIO_STRM_ON       (1)
#define AUDIO_STRM_OFF      (0)

/*Audio Effects*/
#define AUDIO_FX_NONE   (0)
#define AUDIO_FX_ECHO   (1<<0)
#define AUDIO_FX_FUZZ   (1<<1)
#define AUDIO_FX_REVERB (1<<2)
#define AUDIO_FX_WAHWAH (1<<3)
#define AUDIO_FX_DUCKY  (1<<4)

/*audio sample format (definition also in gview_encoder)*/
#ifndef GV_SAMPLE_TYPE_INT16
#define GV_SAMPLE_TYPE_INT16  (0) //interleaved
#define GV_SAMPLE_TYPE_FLOAT  (1) //interleaved
#define GV_SAMPLE_TYPE_INT16P (2) //planar
#define GV_SAMPLE_TYPE_FLOATP (3) //planar
#endif

/*internally is always float*/
typedef float sample_t;

typedef struct _audio_buff_t
{
	void *data; /*sample buffer - usually sample_t (float)*/
	int64_t timestamp;
	int flag;
	float level_meter[2]; /*average sample level*/
} audio_buff_t;

typedef struct _audio_device_t
{
	int id;                 /*audo device id*/
	int channels;           /*max channels*/
	int samprate;           /*default samplerate*/
	char name[512];         /*device name*/
	char description[256];  /*device description*/
} audio_device_t;

typedef struct _audio_context_t
{
	int api;                      /*audio api for this context*/
	int num_input_dev;            /*number of audio input devices in list*/
	audio_device_t *list_devices; /*audio input devices list*/
	int device;                   /*current device list index*/
	int channels;                 /*channels*/
	int samprate;                 /*sample rate*/

	/*all ts are monotonic based: both real and generated*/
	int64_t current_ts;           /*current buffer generated timestamp*/
	int64_t last_ts;              /*last real timestamp (in nanosec)*/
	int64_t snd_begintime;        /*sound capture start ref time*/
	int64_t ts_drift;             /*drift between real and generated ts*/

	sample_t *capture_buff;       /*pointer to capture data*/
	int capture_buff_size;
	float capture_buff_level[2];  /*capture buffer channels level*/

	void *stream;                 /*pointer to audio stream (portaudio)*/

	int stream_flag;             /*stream flag*/

} audio_context_t;

/*
 * set verbosity
 * args:
 *   value - verbosity value
 *
 * asserts:
 *    none
 *
 * returns: none
 */
void audio_set_verbosity(int value);

/*
 * audio initialization
 * args:
 *   api - audio API to use
 *           (AUDIO_NONE, AUDIO_PORTAUDIO, AUDIO_PULSE, ...)
 *
 * asserts:
 *   none
 *
 * returns: pointer to audio context (NULL if AUDIO_NONE)
 */
audio_context_t *audio_init(int api);

/*
 * start audio stream capture
 * args:
 *   audio_ctx - pointer to audio context data
 *
 * asserts:
 *   audio_ctx is not null
 *
 * returns: error code
 */
int audio_start(audio_context_t *audio_ctx);

/*
 * alloc a single audio buffer
 * args:
 *    audio_ctx - pointer to audio context data
 *
 * asserts:
 *    none
 *
 * returns: pointer to newly allocate audio buffer or NULL on error
 *   must be freed with audio_delete_buffer
 */
audio_buff_t *audio_get_buffer(audio_context_t *audio_ctx);

/*
 * deletes a single audio buffer
 * args:
 *    audio_buff - pointer to audio_buff_t data
 *
 * asserts:
 *    none
 *
 * returns: none
 */
void audio_delete_buffer(audio_buff_t *audio_buff);

/*
 * get the next used buffer from the ring buffer and apply fx
 * args:
 *   audio_ctx - pointer to audio context
 *   buff - pointer to an allocated audio buffer
 *   type - type of data (SAMPLE_TYPE_[INT16|FLOAT])
 *   mask - audio fx mask
 *
 * asserts:
 *   none
 *
 * returns: error code
 */
int audio_get_next_buffer(audio_context_t *audio_ctx,
	audio_buff_t *buff,
	int type,
	uint32_t mask);

/*
 * apply audio fx
 * args:
 *   audio_ctx - pointer to audio context
 *   data - pointer to sample buffer to process
 *   mask - or'ed fx combination
 *
 * asserts:
 *    none
 *
 * returns: none
 */
void audio_fx_apply(audio_context_t *audio_ctx,
	sample_t *data,
	uint32_t mask);

/*
 * clean audio fx data
 * args:
 *   none
 *
 * asserts:
 *   aud_fx is not null
 *
 * returns: none
 */
void audio_fx_close();

/*
 * stop audio stream capture
 * args:
 *   audio_ctx - pointer to audio context data
 *
 * asserts:
 *   audio_ctx is not null
 *
 * returns: error code
 */
int audio_stop(audio_context_t *audio_ctx);

/*
 * close and clean audio context
 * args:
 *   audio_ctx - pointer to audio context data
 *
 * asserts:
 *   none
 *
 * returns: none
 */
void audio_close(audio_context_t *audio_ctx);

__END_DECLS

#endif