FFmpeg
Data Structures | Functions | Variables
opus_parser.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "opus.h"
#include "parser.h"

Go to the source code of this file.

Data Structures

struct  OpusParseContext
 

Functions

static const uint8_t * parse_opus_ts_header (const uint8_t *start, int *payload_len, int buf_len)
 
static int opus_find_frame_end (AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t *buf, int buf_size, int *header_len)
 Find the end of the current frame in the bitstream. More...
 
static int opus_parse (AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
 

Variables

const AVCodecParser ff_opus_parser
 

Detailed Description

Opus parser

Determines the duration for each packet.

Definition in file opus_parser.c.

Function Documentation

◆ parse_opus_ts_header()

static const uint8_t* parse_opus_ts_header ( const uint8_t *  start,
int payload_len,
int  buf_len 
)
static

Definition at line 41 of file opus_parser.c.

Referenced by opus_find_frame_end().

◆ opus_find_frame_end()

static int opus_find_frame_end ( AVCodecParserContext ctx,
AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size,
int header_len 
)
static

Find the end of the current frame in the bitstream.

Returns
the position of the first byte of the next frame, or -1

Definition at line 83 of file opus_parser.c.

Referenced by opus_parse().

◆ opus_parse()

static int opus_parse ( AVCodecParserContext ctx,
AVCodecContext avctx,
const uint8_t **  poutbuf,
int poutbuf_size,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 165 of file opus_parser.c.

Variable Documentation

◆ ff_opus_parser

const AVCodecParser ff_opus_parser
Initial value:
= {
.codec_ids = { AV_CODEC_ID_OPUS },
.priv_data_size = sizeof(OpusParseContext),
.parser_parse = opus_parse,
.parser_close = ff_parse_close
}

Definition at line 193 of file opus_parser.c.

ff_parse_close
void ff_parse_close(AVCodecParserContext *s)
Definition: parser.c:282
opus_parse
static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: opus_parser.c:165
OpusParseContext
Definition: opus_parser.c:33
AV_CODEC_ID_OPUS
@ AV_CODEC_ID_OPUS
Definition: codec_id.h:481