summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/mobile/gapk_io.h
blob: 1b3ffa793248a56b8ebd7042d272a4d18eba634c (plain)
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
#pragma once

#include <osmocom/gapk/procqueue.h>
#include <osmocom/gapk/codecs.h>

/* Forward declarations */
struct osmocom_ms;

struct gapk_io_state {
	/* src/alsa -> proc/codec -> sink/tch_fb */
	struct osmo_gapk_pq *pq_source;
	/* src/tch_fb -> proc/codec -> sink/alsa */
	struct osmo_gapk_pq *pq_sink;

	/* Description of currently used codec / format */
	const struct osmo_gapk_format_desc *phy_fmt_desc;
	const struct osmo_gapk_codec_desc *codec_desc;

	/* Buffer for to be played TCH frames (from DL) */
	struct llist_head tch_fb_dl;
	/* Buffer for encoded TCH frames (for UL) */
	struct llist_head tch_fb_ul;
};

void gapk_io_init(void);
int gapk_io_dequeue(struct osmocom_ms *ms);

int gapk_io_init_ms_chan(struct osmocom_ms *ms,
	uint8_t ch_type, uint8_t ch_mode);
int gapk_io_init_ms(struct osmocom_ms *ms,
	enum osmo_gapk_codec_type codec);
int gapk_io_clean_up_ms(struct osmocom_ms *ms);