X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=opus_common.h;h=f8cf459c1008fe9731d9eaaaf253fd1be6710af9;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hb=04c16387cc13317ded03ce478b131d94558f585f;hpb=8bcf75a3921d15e03c4351b3efa609eac67c3817 diff --git a/opus_common.h b/opus_common.h index e69de29b..f8cf459c 100644 --- a/opus_common.h +++ b/opus_common.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2013 Andre Noll , see file COPYING. */ + +/** + * \file opus_common.h + * Common declarations for the opus decoder and audio format handler. + */ + +/** Various bits stored in the header of an opus stream. */ +struct opus_header { + /** lower 4 bits of the version byte, must be 0. */ + int version; + /** 1..255 */ + int channels; + /** Number of bytes to skip from the beginning. */ + uint16_t preskip; + /** Sample rate of the input stream, used by the audio format handler. */ + uint32_t input_sample_rate; + /** In dB, should be zero whenever possible. */ + uint16_t gain; + /** Number of logical streams (usually 1). */ + int nb_streams; + /** Number of streams to decode as 2 channel streams. */ + int nb_coupled; + /** Mapping from coded channels to output channels. */ + unsigned char stream_map[255]; +}; + +int opus_parse_header(const char *packet, int len, struct opus_header *h);