UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
audio.h
Go to the documentation of this file.
1/*
2 * FILE: audio/audio.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-2024 CESNET
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#ifndef _AUDIO_H_
50#define _AUDIO_H_
51
52#define DEFAULT_AUDIO_FEC "none"
53#define DEFAULT_AUDIO_SCALE "mixauto"
54
55#define AUDIO_PROTOCOLS "JACK, rtsp, sdp or ultragrid_rtp" // available audio protocols
56#define PORT_AUDIO 5006
57
58#include "audio/types.h"
59#include "host.h" // common_opt
60#include "module.h"
61#include "tv.h"
62
63struct state_audio;
64
65#ifdef __cplusplus
66#include <chrono>
67
69 const char *host = NULL;
70 int recv_port = 0;
71 int send_port = 0;
72 const char *recv_cfg = "none";
73 const char *send_cfg = "none";
74 const char *proto = "ultragrid_rtp";
75 const char *proto_cfg = "";
77 char *channel_map = nullptr;
79 bool echo_cancellation = false;
80 const char *codec_cfg = "PCM";
81 const char *filter_cfg = "";
82};
83
84int audio_init(struct state_audio **state,
85 const struct audio_options *opt,
86 const struct common_opts *common);
87#endif
88
89#ifdef __cplusplus
90extern "C" {
91#endif
92
93void audio_start(struct state_audio *s);
94void audio_done(struct state_audio *s);
95void audio_join(struct state_audio *s);
96
97void audio_sdi_send(struct state_audio *s, struct audio_frame *frame);
99void sdi_put_frame(void *state, struct audio_frame *frame);
100
101struct display;
102struct video_rxtx;
104 struct {
105 void *udata;
106 void (*putf)(struct display *, const struct audio_frame *);
107 bool (*reconfigure)(struct display *, int, int, int);
108 bool (*get_property)(struct display *, int, void *, size_t *);
111};
113 struct additional_audio_data data);
114
116
117unsigned int audio_get_display_flags(struct state_audio *s);
118
120 const enum module_class *path,
121 const char *address);
122
123#ifdef __cplusplus
124}
125#endif
126
127
128#endif
void ** state
struct video_frame * frame
This file contains definition of some common audio types.
void audio_register_aux_data(struct state_audio *s, struct additional_audio_data data)
Definition audio.cpp:1191
void sdi_put_frame(void *state, struct audio_frame *frame)
#define DEFAULT_AUDIO_FEC
Definition audio.h:52
struct audio_frame * audio_get_frame(struct state_audio *s)
unsigned int audio_get_display_flags(struct state_audio *s)
Definition audio.cpp:1210
#define DEFAULT_AUDIO_SCALE
Definition audio.h:53
void audio_join(struct state_audio *s)
Definition audio.cpp:502
int audio_init(struct state_audio **state, const struct audio_options *opt, const struct common_opts *common)
Definition audio.cpp:272
struct audio_frame * sdi_get_frame(void *state)
void audio_sdi_send(struct state_audio *s, struct audio_frame *frame)
Definition audio.cpp:1179
void audio_done(struct state_audio *s)
Definition audio.cpp:512
void sdp_send_change_address_message(struct module *root, const enum module_class *path, const char *address)
Definition audio.cpp:238
void audio_start(struct state_audio *s)
Definition audio.cpp:463
module_class
Definition module.h:81
struct additional_audio_data::@2 display_callbacks
void(* putf)(struct display *, const struct audio_frame *)
Definition audio.h:106
bool(* reconfigure)(struct display *, int, int, int)
Definition audio.h:107
bool(* get_property)(struct display *, int, void *, size_t *)
Definition audio.h:108
struct video_rxtx * vrxtx
Definition audio.h:110
struct used to comunicate with audio capture/playback device
Definition types.h:99
const char * fec_cfg
Definition audio.h:76
const char * host
Definition audio.h:69
const char * proto
Definition audio.h:74
const char * recv_cfg
Definition audio.h:72
const char * send_cfg
Definition audio.h:73
int send_port
Definition audio.h:71
const char * filter_cfg
Definition audio.h:81
int recv_port
Definition audio.h:70
const char * proto_cfg
Definition audio.h:75
const char * scale
Definition audio.h:78
const char * codec_cfg
Definition audio.h:80
This struct represents initialized video display state.