snapcast/server/oggEncoder.h
(no author) a519d0f0dd new messaging
git-svn-id: svn://elaine/murooma/trunk@229 d8a302eb-03bc-478d-80e4-98257eca68ef
2014-09-03 21:12:44 +00:00

46 lines
1.1 KiB
C++

#ifndef OGG_ENCODER_H
#define OGG_ENCODER_H
#include "encoder.h"
#include <vorbis/vorbisenc.h>
class OggEncoder : public Encoder
{
public:
OggEncoder(const SampleFormat& format);
virtual double encode(PcmChunk* chunk);
virtual HeaderMessage* getHeader();
private:
void init();
ogg_stream_state os; /* take physical pages, weld into a logical
stream of packets */
ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
ogg_packet op; /* one raw packet of data for decode */
vorbis_info vi; /* struct that stores all the static vorbis bitstream
settings */
vorbis_comment vc; /* struct that stores all the user comments */
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
vorbis_block vb; /* local working space for packet->PCM decode */
ogg_packet header;
ogg_packet header_comm;
ogg_packet header_code;
ogg_int64_t lastGranulepos;
HeaderMessage* headerChunk;
int eos=0,ret;
int i, founddata;
int32_t tv_sec;
int32_t tv_usec;
};
#endif