UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
none.c
Go to the documentation of this file.
1/*
2 * FILE: audio/capture/none.h
3 * AUTHORS: Martin Benes <martinbenesh@gmail.com>
4 * Lukas Hejtmanek <xhejtman@ics.muni.cz>
5 * Petr Holub <hopet@ics.muni.cz>
6 * Milos Liska <xliska@fi.muni.cz>
7 * Jiri Matela <matela@ics.muni.cz>
8 * Dalibor Matura <255899@mail.muni.cz>
9 * Ian Wesley-Smith <iwsmith@cct.lsu.edu>
10 *
11 * Copyright (c) 2005-2023 CESNET z.s.p.o.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, is permitted provided that the following conditions
15 * are met:
16 *
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 *
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * 3. All advertising materials mentioning features or use of this software
25 * must display the following acknowledgement:
26 *
27 * This product includes software developed by CESNET z.s.p.o.
28 *
29 * 4. Neither the name of CESNET nor the names of its contributors may be used
30 * to endorse or promote products derived from this software without specific
31 * prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
34 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
35 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
36 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
37 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
38 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
43 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
44 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 *
46 *
47 */
48
49#ifdef HAVE_CONFIG_H
50#include "config.h"
51#include "config_unix.h"
52#include "config_win32.h"
53#endif
54
55#include "audio/audio_capture.h"
56#include "debug.h"
57#include "lib_common.h"
58#include <assert.h>
59#include <stdlib.h>
60#include <string.h>
61
62#define AUDIO_CAPTURE_NONE_MAGIC 0x43fb99ccu
63
65 uint32_t magic;
66};
67
68static void audio_cap_none_probe(struct device_info **available_devices, int *count, void (**deleter)(void *))
69{
70 *deleter = free;
71 *available_devices = NULL;
72 *count = 0;
73}
74
75static void * audio_cap_none_init(struct module *parent, const char *cfg)
76{
79
80 s = (struct state_audio_capture_none *) malloc(sizeof(struct state_audio_capture_none));
82 assert(s != 0);
83 UNUSED(cfg);
84 return s;
85}
86
88{
90 return NULL;
91}
92
93static void audio_cap_none_done(void *state)
94{
96
97 assert(s->magic == AUDIO_CAPTURE_NONE_MAGIC);
98 free(s);
99}
100
107
109
#define UNUSED(x)
void ** state
int void(** deleter)(void *))
#define AUDIO_CAPTURE_ABI_VERSION
static const struct audio_capture_info acap_none_info
Definition none.c:101
#define AUDIO_CAPTURE_NONE_MAGIC
Definition none.c:62
static struct audio_frame * audio_cap_none_read(void *state)
Definition none.c:87
static void audio_cap_none_done(void *state)
Definition none.c:93
static void * audio_cap_none_init(struct module *parent, const char *cfg)
Definition none.c:75
static void audio_cap_none_probe(struct device_info **available_devices, int *count, void(**deleter)(void *))
Definition none.c:68
int count
Definition hd-rum.c:44
@ LIBRARY_CLASS_AUDIO_CAPTURE
Definition lib_common.h:76
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
Definition lib_common.h:144
const char * parent
Definition settings.cpp:198
struct used to comunicate with audio capture/playback device
Definition types.h:99