2012-01-15 19:38:03 +01:00
|
|
|
/*
|
|
|
|
*
|
2013-08-15 23:12:51 +02:00
|
|
|
* This file is part of FFmpeg.
|
2012-01-15 19:38:03 +01:00
|
|
|
*
|
2013-08-15 23:12:51 +02:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2012-01-15 19:38:03 +01:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2013-08-15 23:12:51 +02:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2012-01-15 19:38:03 +01:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2013-08-15 23:12:51 +02:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2012-01-15 19:38:03 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2014-10-29 15:04:23 +01:00
|
|
|
* A public API for Vorbis parsing
|
2012-01-15 19:38:03 +01:00
|
|
|
*
|
|
|
|
* Determines the duration for each packet.
|
|
|
|
*/
|
|
|
|
|
2014-10-29 15:04:23 +01:00
|
|
|
#ifndef AVCODEC_VORBIS_PARSE_H
|
|
|
|
#define AVCODEC_VORBIS_PARSE_H
|
2012-01-15 19:38:03 +01:00
|
|
|
|
2014-11-08 00:59:37 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2014-10-29 15:04:23 +01:00
|
|
|
typedef struct AVVorbisParseContext AVVorbisParseContext;
|
2012-01-15 19:38:03 +01:00
|
|
|
|
|
|
|
/**
|
2014-10-29 15:04:23 +01:00
|
|
|
* Allocate and initialize the Vorbis parser using headers in the extradata.
|
2012-01-15 19:38:03 +01:00
|
|
|
*
|
|
|
|
* @param avctx codec context
|
|
|
|
* @param s Vorbis parser context
|
|
|
|
*/
|
2014-10-29 15:04:23 +01:00
|
|
|
AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
|
|
|
|
int extradata_size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Free the parser and everything associated with it.
|
|
|
|
*/
|
|
|
|
void av_vorbis_parse_free(AVVorbisParseContext **s);
|
2012-01-15 19:38:03 +01:00
|
|
|
|
2013-10-28 03:47:31 +01:00
|
|
|
#define VORBIS_FLAG_HEADER 0x00000001
|
|
|
|
#define VORBIS_FLAG_COMMENT 0x00000002
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the duration for a Vorbis packet.
|
|
|
|
*
|
2014-11-06 11:54:40 +01:00
|
|
|
* If @p flags is @c NULL,
|
2013-10-28 03:47:31 +01:00
|
|
|
* special frames are considered invalid.
|
|
|
|
*
|
|
|
|
* @param s Vorbis parser context
|
|
|
|
* @param buf buffer containing a Vorbis frame
|
|
|
|
* @param buf_size size of the buffer
|
|
|
|
* @param flags flags for special frames
|
|
|
|
*/
|
2014-11-06 11:54:40 +01:00
|
|
|
int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
|
|
|
|
int buf_size, int *flags);
|
2013-10-28 03:47:31 +01:00
|
|
|
|
2012-01-15 19:38:03 +01:00
|
|
|
/**
|
|
|
|
* Get the duration for a Vorbis packet.
|
|
|
|
*
|
|
|
|
* @param s Vorbis parser context
|
|
|
|
* @param buf buffer containing a Vorbis frame
|
|
|
|
* @param buf_size size of the buffer
|
|
|
|
*/
|
2014-10-29 15:04:23 +01:00
|
|
|
int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
|
|
|
|
int buf_size);
|
2012-01-15 19:38:03 +01:00
|
|
|
|
2014-10-29 15:04:23 +01:00
|
|
|
void av_vorbis_parse_reset(AVVorbisParseContext *s);
|
2012-01-15 19:38:03 +01:00
|
|
|
|
2014-10-29 15:04:23 +01:00
|
|
|
#endif /* AVCODEC_VORBIS_PARSE_H */
|