FFmpeg
Loading...
Searching...
No Matches
libopusdec.c File Reference
#include <opus.h>
#include <opus_multistream.h>
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/ffmath.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "internal.h"
#include "mathops.h"
#include "libopus.h"
#include "vorbis_data.h"

Go to the source code of this file.

Data Structures

struct  libopus_context
 

Macros

#define OPUS_HEAD_SIZE   19
 
#define MAX_FRAME_SIZE   (960 * 6)
 
#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static av_cold int libopus_decode_init (AVCodecContext *avc)
 
static av_cold int libopus_decode_close (AVCodecContext *avc)
 
static int libopus_decode (AVCodecContext *avc, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
 
static void libopus_flush (AVCodecContext *avc)
 

Variables

static const AVOption libopusdec_options []
 
static const AVClass libopusdec_class
 
const FFCodec ff_libopus_decoder
 

Macro Definition Documentation

◆ OPUS_HEAD_SIZE

#define OPUS_HEAD_SIZE   19

Definition at line 50 of file libopusdec.c.

Referenced by libopus_decode_init(), and parse_opus_header().

◆ MAX_FRAME_SIZE

#define MAX_FRAME_SIZE   (960 * 6)

Definition at line 158 of file libopusdec.c.

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(struct libopus_context, x)

Definition at line 217 of file libopusdec.c.

◆ FLAGS

Definition at line 218 of file libopusdec.c.

Function Documentation

◆ libopus_decode_init()

static av_cold int libopus_decode_init ( AVCodecContext * avc)
static

Definition at line 52 of file libopusdec.c.

◆ libopus_decode_close()

static av_cold int libopus_decode_close ( AVCodecContext * avc)
static

Definition at line 147 of file libopusdec.c.

◆ libopus_decode()

static int libopus_decode ( AVCodecContext * avc,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * pkt )
static

Definition at line 160 of file libopusdec.c.

◆ libopus_flush()

static void libopus_flush ( AVCodecContext * avc)
static

Definition at line 206 of file libopusdec.c.

Variable Documentation

◆ libopusdec_options

const AVOption libopusdec_options[]
static
Initial value:
= {
{ NULL },
}
#define NULL
Definition coverity.c:32

Definition at line 219 of file libopusdec.c.

◆ libopusdec_class

const AVClass libopusdec_class
static
Initial value:
= {
.class_name = "libopusdec",
.item_name = av_default_item_name,
.option = libopusdec_options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption libopusdec_options[]
Definition libopusdec.c:219

Definition at line 226 of file libopusdec.c.

◆ ff_libopus_decoder

const FFCodec ff_libopus_decoder
Initial value:
= {
.p.name = "libopus",
CODEC_LONG_NAME("libopus Opus"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(struct libopus_context),
.flush = libopus_flush,
.p.priv_class = &libopusdec_class,
.p.wrapper_name = "libopus",
}
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define CODEC_SAMPLEFMTS(...)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_OPUS
Definition codec_id.h:513
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AV_SAMPLE_FMT_FLT
float
Definition samplefmt.h:60
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58
static av_cold int libopus_decode_init(AVCodecContext *avc)
Definition libopusdec.c:52
static const AVClass libopusdec_class
Definition libopusdec.c:226
static int libopus_decode(AVCodecContext *avc, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
Definition libopusdec.c:160
static av_cold int libopus_decode_close(AVCodecContext *avc)
Definition libopusdec.c:147
static void libopus_flush(AVCodecContext *avc)
Definition libopusdec.c:206

Definition at line 234 of file libopusdec.c.