/usr/include/guvcview-2/libgviewaudio/gviewaudio.h is in libguvcview-dev 2.0.4+debian-1+b1.
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 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | /*******************************************************************************#
# 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>
#include <pthread.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*/
double low_latency; /*default low latency*/
double high_latency; /*default high latency*/
char name[512]; /*device name*/
char description[256]; /*device description*/
} audio_device_t;
/*audio context - opaque structure*/
typedef struct _audio_context_t 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, ...)
* device - api device index to use (-1 - use api default)
*
* asserts:
* none
*
* returns: pointer to audio context data (or NULL on error)
*/
audio_context_t *audio_init(int api, int device);
/*
* get audio api
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: audio API
*/
int audio_get_api(audio_context_t *audio_ctx);
/*
* set the audio device index to use
* args:
* audio_ctx - pointer to audio context data
* index - device index (from device list) to set
*
* asserts:
* audio_ctx is not null
*
* returns: none
*/
void audio_set_device_index(audio_context_t *audio_ctx, int index);
/*
* get the current audio device index
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: current device index (from device list)
*/
int audio_get_device_index(audio_context_t *audio_ctx);
/*
* get the number of available input audio devices
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: number of listed audio devices
*/
int audio_get_num_inp_devices(audio_context_t *audio_ctx);
/*
* get the audio device referenced by index
* args:
* audio_ctx - pointer to audio context data
* index - index of audio device
*
* asserts:
* audio_ctx is not null
*
* returns: audio device referenced by index
*/
audio_device_t* audio_get_device(audio_context_t *audio_ctx, int index);
/*
* set the current latency
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: none
*/
void audio_set_latency(audio_context_t *audio_ctx, double latency);
/*
* get the current latency
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: defined lantency
*/
double audio_get_latency(audio_context_t *audio_ctx);
/*
* set the number of channels
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: none
*/
void audio_set_channels(audio_context_t *audio_ctx, int channels);
/*
* get the number of channels
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: number of channels
*/
int audio_get_channels(audio_context_t *audio_ctx);
/*
* set the sample rate
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: none
*/
void audio_set_samprate(audio_context_t *audio_ctx, int samprate);
/*
* get the sample rate
* args:
* audio_ctx - pointer to audio context data
*
* asserts:
* audio_ctx is not null
*
* returns: sample rate
*/
int audio_get_samprate(audio_context_t *audio_ctx);
/*
* set the capture buffer size
* args:
* audio_ctx - pointer to audio context data
* size - capture buffer size in bytes
*
* asserts:
* audio_ctx is not null
*
* returns: none
*/
void audio_set_cap_buffer_size(audio_context_t *audio_ctx, int size);
/*
* 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
|