FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Functions | Variables
parser.c File Reference
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "opus.h"
#include "parse.h"
#include "parser.h"
#include "parser_internal.h"

Go to the source code of this file.

Data Structures

struct  OpusParserContext
 

Functions

static const uint8_t * parse_opus_ts_header (const uint8_t *start, int *payload_len, int buf_len)
 
static int set_frame_duration (AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
 
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 FFCodecParser ff_opus_parser
 

Detailed Description

Opus parser

Determines the duration for each packet.

Definition in file 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 44 of file parser.c.

Referenced by opus_find_frame_end().

◆ set_frame_duration()

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

Definition at line 82 of file parser.c.

Referenced by opus_find_frame_end(), and opus_parse().

◆ 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 101 of file 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 170 of file parser.c.

Variable Documentation

◆ ff_opus_parser

const FFCodecParser ff_opus_parser
Initial value:

Definition at line 217 of file parser.c.

ff_parse_close
av_cold void ff_parse_close(AVCodecParserContext *s)
Definition: parser.c:298
OpusParserContext
Definition: parser.c:36
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:136
parse
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: apv_parser.c:46
AV_CODEC_ID_OPUS
@ AV_CODEC_ID_OPUS
Definition: codec_id.h:519
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: parser.c:170
PARSER_CODEC_LIST
#define PARSER_CODEC_LIST(...)
Definition: parser_internal.h:76