aboutsummaryrefslogtreecommitdiffstats
path: root/vlc_input.h
blob: 976a7e71180a7aa425dacacb4db86abedc196dc0 (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
41
42
43
#ifndef __VLC_INPUT_H_
#define __VLC_INPUT_H_

#include <stdint.h>
#include <vlc/vlc.h>


// A linked list structure for the incoming buffers
struct vlc_buffer {
    uint8_t                *buf;
    size_t                  size;
    struct vlc_buffer *next;
};

struct vlc_buffer* vlc_buffer_new();
void vlc_buffer_free(struct vlc_buffer* node);


// VLC Audio prerender callback
void prepareRender(
        void* p_audio_data,
        uint8_t** pp_pcm_buffer,
        size_t size);

// Audio postrender callback
void handleStream(
        void* p_audio_data,
        uint8_t* p_pcm_buffer,
        unsigned int channels,
        unsigned int rate,
        unsigned int nb_samples,
        unsigned int bits_per_sample,
        size_t size,
        int64_t pts);

// Open the VLC input
int vlc_in_prepare(unsigned verbosity, unsigned int rate, const char* uri);

// Read len audio bytes into buf
size_t vlc_in_read(void *buf, size_t len);

#endif