diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-08-15 21:44:53 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-08-15 21:45:05 +0200 |
commit | 945a9bb7460dbe84f3ed657bdd718ea91d57b31a (patch) | |
tree | 39e3541c0117247d6a7d1b1ff8db3330ae25be22 /zmqoutput.h | |
parent | 10c98b106dbb7ee90aca745c7c100a43f80fa01e (diff) | |
download | toolame-dab-945a9bb7460dbe84f3ed657bdd718ea91d57b31a.tar.gz toolame-dab-945a9bb7460dbe84f3ed657bdd718ea91d57b31a.tar.bz2 toolame-dab-945a9bb7460dbe84f3ed657bdd718ea91d57b31a.zip |
Switch to new ZMQ frame format
Diffstat (limited to 'zmqoutput.h')
-rw-r--r-- | zmqoutput.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zmqoutput.h b/zmqoutput.h index 8d7cb13..a4eb556 100644 --- a/zmqoutput.h +++ b/zmqoutput.h @@ -1,8 +1,27 @@ #ifndef _ZMQOUTPUT_H_ #define _ZMQOUTPUT_H_ +#include <stdint.h> #include "common.h" +#define ZMQ_ENCODER_TOOLAME 2 + +struct zmq_frame_header +{ + uint16_t version; // we support version=1 now + uint16_t encoder; // see ZMQ_ENCODER_XYZ + + /* length of the 'data' field */ + uint32_t datasize; + + /* Audio level, peak, linear PCM */ + int16_t audiolevel_left; + int16_t audiolevel_right; + + /* Data follows this header */ +} __attribute__ ((packed)); + + int zmqoutput_open(Bit_stream_struc * bs, char* uri); int zmqoutput_write_byte(Bit_stream_struc *bs, unsigned char data); |