UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
audio_playback.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2012-2023 CESNET, z. s. p. o.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, is permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * 3. Neither the name of CESNET nor the names of its contributors may be
21 * used to endorse or promote products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
26 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
28 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include "../types.h"
39
40struct audio_desc;
41struct audio_frame;
42
43#ifdef __cplusplus
44extern "C" {
45#else
46#include <stdbool.h>
47#endif
48
49#define AUDIO_PLAYBACK_ABI_VERSION 11
50
65#define AUDIO_PLAYBACK_CTL_QUERY_FORMAT 1
72#define AUDIO_PLAYBACK_CTL_MULTIPLE_STREAMS 2
77#define AUDIO_PLAYBACK_PUT_NETWORK_DEVICE 3
79
82 void *(*init)(const char *cfg);
83 void (*write)(void *state, const struct audio_frame *frame);
85 bool (*ctl)(void *state, int request, void *data, size_t *len);
86 bool (*reconfigure)(void *state, struct audio_desc);
87 void (*done)(void *state);
88};
89
91
92void audio_playback_help(bool full);
97int audio_playback_init(const char *device, const char *cfg,
98 struct state_audio_playback **);
100
108bool audio_playback_ctl(struct state_audio_playback *s, int request, void *data, size_t *len);
109
121 int quant_samples, int channels,
122 int sample_rate);
126
128
134
135#ifdef __cplusplus
136}
137#endif
138
139/* vim: set expandtab sw=8: */
140
void ** state
int int int sample_rate
int int channels
struct video_frame * frame
int void size_t * len
int quant_samples
bool audio_playback_reconfigure(struct state_audio_playback *state, int quant_samples, int channels, int sample_rate)
bool audio_playback_ctl(struct state_audio_playback *s, int request, void *data, size_t *len)
void * audio_playback_get_state_pointer(struct state_audio_playback *s)
void audio_playback_done(struct state_audio_playback *state)
void audio_playback_finish(struct state_audio_playback *state)
unsigned int audio_playback_get_display_flags(struct state_audio_playback *s)
void audio_playback_init_devices(void)
struct state_audio_playback * audio_playback_init_null_device(void)
void audio_playback_help(bool full)
int audio_playback_init(const char *device, const char *cfg, struct state_audio_playback **)
void audio_playback_put_frame(struct state_audio_playback *state, const struct audio_frame *frame)
struct used to comunicate with audio capture/playback device
Definition types.h:99
device_probe_func probe
bool(* reconfigure)(void *state, struct audio_desc)
void(* done)(void *state)
void(* write)(void *state, const struct audio_frame *frame)
bool(* ctl)(void *state, int request, void *data, size_t *len)
This file contains some common data types.
void(* device_probe_func)(struct device_info **available_cards, int *count, void(**deleter)(void *))
Definition types.h:404