diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-03-13 09:50:04 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-03-13 09:50:04 +0100 |
commit | ce10052a134f8b6c84112f5785a8b48cdc9bba22 (patch) | |
tree | 9509d2b169942a7c85eac93531fd2aa430ccecae /vlc_input.h | |
parent | 845746006e79d554478090126dbdab799299f9b3 (diff) | |
download | toolame-dab-ce10052a134f8b6c84112f5785a8b48cdc9bba22.tar.gz toolame-dab-ce10052a134f8b6c84112f5785a8b48cdc9bba22.tar.bz2 toolame-dab-ce10052a134f8b6c84112f5785a8b48cdc9bba22.zip |
Add libvlc input
Diffstat (limited to 'vlc_input.h')
-rw-r--r-- | vlc_input.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/vlc_input.h b/vlc_input.h new file mode 100644 index 0000000..976a7e7 --- /dev/null +++ b/vlc_input.h @@ -0,0 +1,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 + |