Merge commit '6896f95b2483e52e717e2c75a4fd24fcb0e14b67'
* commit '6896f95b2483e52e717e2c75a4fd24fcb0e14b67': vorbis_parser: add an AV prefix to VorbisParseContext Conflicts: libavcodec/vorbis_parser.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
5f7887ca8d
@ -49,7 +49,7 @@ typedef struct LibvorbisEncContext {
|
|||||||
int dsp_initialized; /**< vd has been initialized */
|
int dsp_initialized; /**< vd has been initialized */
|
||||||
vorbis_comment vc; /**< VorbisComment info */
|
vorbis_comment vc; /**< VorbisComment info */
|
||||||
double iblock; /**< impulse block bias option */
|
double iblock; /**< impulse block bias option */
|
||||||
VorbisParseContext vp; /**< parse context to get durations */
|
AVVorbisParseContext vp; /**< parse context to get durations */
|
||||||
AudioFrameQueue afq; /**< frame queue for timestamps */
|
AudioFrameQueue afq; /**< frame queue for timestamps */
|
||||||
} LibvorbisEncContext;
|
} LibvorbisEncContext;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ static const AVClass vorbis_parser_class = {
|
|||||||
.version = LIBAVUTIL_VERSION_INT,
|
.version = LIBAVUTIL_VERSION_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int parse_id_header(VorbisParseContext *s,
|
static int parse_id_header(AVVorbisParseContext *s,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
/* Id header should be 30 bytes */
|
/* Id header should be 30 bytes */
|
||||||
@ -70,7 +70,7 @@ static int parse_id_header(VorbisParseContext *s,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_setup_header(VorbisParseContext *s,
|
static int parse_setup_header(AVVorbisParseContext *s,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
GetBitContext gb, gb0;
|
GetBitContext gb, gb0;
|
||||||
@ -181,7 +181,7 @@ bad_header:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
|
int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s)
|
||||||
{
|
{
|
||||||
uint8_t *header_start[3];
|
uint8_t *header_start[3];
|
||||||
int header_len[3];
|
int header_len[3];
|
||||||
@ -209,7 +209,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,
|
int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
|
||||||
int buf_size, int *flags)
|
int buf_size, int *flags)
|
||||||
{
|
{
|
||||||
int duration = 0;
|
int duration = 0;
|
||||||
@ -258,13 +258,13 @@ bad_packet:
|
|||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
|
int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
|
||||||
int buf_size)
|
int buf_size)
|
||||||
{
|
{
|
||||||
return avpriv_vorbis_parse_frame_flags(s, buf, buf_size, NULL);
|
return avpriv_vorbis_parse_frame_flags(s, buf, buf_size, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void avpriv_vorbis_parse_reset(VorbisParseContext *s)
|
void avpriv_vorbis_parse_reset(AVVorbisParseContext *s)
|
||||||
{
|
{
|
||||||
if (s->valid_extradata)
|
if (s->valid_extradata)
|
||||||
s->previous_blocksize = s->blocksize[0];
|
s->previous_blocksize = s->blocksize[0];
|
||||||
@ -275,7 +275,7 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
|
|||||||
const uint8_t **poutbuf, int *poutbuf_size,
|
const uint8_t **poutbuf, int *poutbuf_size,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
VorbisParseContext *s = s1->priv_data;
|
AVVorbisParseContext *s = s1->priv_data;
|
||||||
int duration;
|
int duration;
|
||||||
|
|
||||||
if (!s->extradata_parsed && avctx->extradata && avctx->extradata_size)
|
if (!s->extradata_parsed && avctx->extradata && avctx->extradata_size)
|
||||||
@ -295,7 +295,7 @@ end:
|
|||||||
|
|
||||||
AVCodecParser ff_vorbis_parser = {
|
AVCodecParser ff_vorbis_parser = {
|
||||||
.codec_ids = { AV_CODEC_ID_VORBIS },
|
.codec_ids = { AV_CODEC_ID_VORBIS },
|
||||||
.priv_data_size = sizeof(VorbisParseContext),
|
.priv_data_size = sizeof(AVVorbisParseContext),
|
||||||
.parser_parse = vorbis_parse,
|
.parser_parse = vorbis_parse,
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_VORBIS_PARSER */
|
#endif /* CONFIG_VORBIS_PARSER */
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
|
||||||
typedef struct VorbisParseContext {
|
typedef struct AVVorbisParseContext {
|
||||||
const AVClass *class;
|
const AVClass *class;
|
||||||
int extradata_parsed; ///< we have attempted to parse extradata
|
int extradata_parsed; ///< we have attempted to parse extradata
|
||||||
int valid_extradata; ///< extradata is valid, so we can calculate duration
|
int valid_extradata; ///< extradata is valid, so we can calculate duration
|
||||||
@ -40,7 +40,7 @@ typedef struct VorbisParseContext {
|
|||||||
int mode_count; ///< number of modes
|
int mode_count; ///< number of modes
|
||||||
int mode_mask; ///< bitmask used to get the mode in each packet
|
int mode_mask; ///< bitmask used to get the mode in each packet
|
||||||
int prev_mask; ///< bitmask used to get the previous mode flag in each packet
|
int prev_mask; ///< bitmask used to get the previous mode flag in each packet
|
||||||
} VorbisParseContext;
|
} AVVorbisParseContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the Vorbis parser using headers in the extradata.
|
* Initialize the Vorbis parser using headers in the extradata.
|
||||||
@ -48,7 +48,7 @@ typedef struct VorbisParseContext {
|
|||||||
* @param avctx codec context
|
* @param avctx codec context
|
||||||
* @param s Vorbis parser context
|
* @param s Vorbis parser context
|
||||||
*/
|
*/
|
||||||
int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
|
int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s);
|
||||||
|
|
||||||
#define VORBIS_FLAG_HEADER 0x00000001
|
#define VORBIS_FLAG_HEADER 0x00000001
|
||||||
#define VORBIS_FLAG_COMMENT 0x00000002
|
#define VORBIS_FLAG_COMMENT 0x00000002
|
||||||
@ -65,7 +65,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
|
|||||||
* @param buf_size size of the buffer
|
* @param buf_size size of the buffer
|
||||||
* @param flags flags for special frames
|
* @param flags flags for special frames
|
||||||
*/
|
*/
|
||||||
int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,
|
int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
|
||||||
int buf_size, int *flags);
|
int buf_size, int *flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,9 +78,9 @@ int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,
|
|||||||
* @param buf buffer containing a Vorbis frame
|
* @param buf buffer containing a Vorbis frame
|
||||||
* @param buf_size size of the buffer
|
* @param buf_size size of the buffer
|
||||||
*/
|
*/
|
||||||
int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
|
int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
|
||||||
int buf_size);
|
int buf_size);
|
||||||
|
|
||||||
void avpriv_vorbis_parse_reset(VorbisParseContext *s);
|
void avpriv_vorbis_parse_reset(AVVorbisParseContext *s);
|
||||||
|
|
||||||
#endif /* AVCODEC_VORBIS_PARSER_H */
|
#endif /* AVCODEC_VORBIS_PARSER_H */
|
||||||
|
@ -213,7 +213,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
|
|||||||
struct oggvorbis_private {
|
struct oggvorbis_private {
|
||||||
unsigned int len[3];
|
unsigned int len[3];
|
||||||
unsigned char *packet[3];
|
unsigned char *packet[3];
|
||||||
VorbisParseContext vp;
|
AVVorbisParseContext vp;
|
||||||
int64_t final_pts;
|
int64_t final_pts;
|
||||||
int final_duration;
|
int final_duration;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user