summaryrefslogtreecommitdiffstats
path: root/src/source.h
blob: 078fb1c9a4d1ecb510b7dbbf439c3a6415684c34 (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
#ifndef foosourcehfoo
#define foosourcehfoo

struct source;

#include <inttypes.h>
#include "core.h"
#include "sample.h"
#include "idxset.h"
#include "memblock.h"

struct source {
    uint32_t index;
    
    char *name;
    struct core *core;
    struct sample_spec sample_spec;
    struct idxset *outputs;

    void (*notify)(struct source*source);
    void *userdata;
};

struct source* source_new(struct core *core, const char *name, const struct sample_spec *spec);
void source_free(struct source *s);

/* Pass a new memory block to all output streams */
void source_post(struct source*s, struct memchunk *b);

void source_notify(struct source *s);

char *source_list_to_string(struct core *c);

struct source* source_get_default(struct core *c);

#endif