summaryrefslogtreecommitdiff
path: root/src/audio.h
blob: b31c77fbf0746ccfb3481755543670f2231e0e38 (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
33
34
35
36
37
38
39
40
#ifndef _AUDIO_H_
#define _AUDIO_H_

#include <glib.h>

#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>
#include <gst/app/gstappbuffer.h>

#include <celt/celt.h>
#include <celt/celt_header.h>

struct cmumble_audio {
	GstElement *record_pipeline;
	GstAppSink *sink;

	uint8_t celt_header_packet[sizeof(CELTHeader)];
	CELTHeader celt_header;
	CELTMode *celt_mode;
};

struct context;
struct user;

int
cmumble_audio_init(struct context *ctx);

int
cmumble_audio_fini(struct context *ctx);

int
cmumble_audio_create_playback_pipeline(struct context *ctx,
				       struct user *user);

void
cmumble_audio_push(struct context *ctx, struct user *user,
		   const uint8_t *data, gsize size);

#endif /* _AUDIO_H_ */