Path: blob/master/dep/ffmpeg/include/libavcodec/vorbis_parser.h
4216 views
/*1* This file is part of FFmpeg.2*3* FFmpeg is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* FFmpeg is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with FFmpeg; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA16*/1718/**19* @file20* A public API for Vorbis parsing21*22* Determines the duration for each packet.23*/2425#ifndef AVCODEC_VORBIS_PARSER_H26#define AVCODEC_VORBIS_PARSER_H2728#include <stdint.h>2930typedef struct AVVorbisParseContext AVVorbisParseContext;3132/**33* Allocate and initialize the Vorbis parser using headers in the extradata.34*/35AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,36int extradata_size);3738/**39* Free the parser and everything associated with it.40*/41void av_vorbis_parse_free(AVVorbisParseContext **s);4243#define VORBIS_FLAG_HEADER 0x0000000144#define VORBIS_FLAG_COMMENT 0x0000000245#define VORBIS_FLAG_SETUP 0x000000044647/**48* Get the duration for a Vorbis packet.49*50* If @p flags is @c NULL,51* special frames are considered invalid.52*53* @param s Vorbis parser context54* @param buf buffer containing a Vorbis frame55* @param buf_size size of the buffer56* @param flags flags for special frames57*/58int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,59int buf_size, int *flags);6061/**62* Get the duration for a Vorbis packet.63*64* @param s Vorbis parser context65* @param buf buffer containing a Vorbis frame66* @param buf_size size of the buffer67*/68int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,69int buf_size);7071void av_vorbis_parse_reset(AVVorbisParseContext *s);7273#endif /* AVCODEC_VORBIS_PARSER_H */747576