FFmpeg
Data Structures | Macros | Functions | Variables
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 "internal.h"
#include "vorbis.h"
#include "mathops.h"
#include "libopus.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)   offsetof(struct libopus_context, 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, void *data, int *got_frame_ptr, AVPacket *pkt)
 
static void libopus_flush (AVCodecContext *avc)
 

Variables

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

Macro Definition Documentation

◆ OPUS_HEAD_SIZE

#define OPUS_HEAD_SIZE   19

Definition at line 48 of file libopusdec.c.

◆ MAX_FRAME_SIZE

#define MAX_FRAME_SIZE   (960 * 6)

Definition at line 151 of file libopusdec.c.

◆ OFFSET

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

Definition at line 211 of file libopusdec.c.

◆ FLAGS

Definition at line 212 of file libopusdec.c.

Function Documentation

◆ libopus_decode_init()

static av_cold int libopus_decode_init ( AVCodecContext avc)
static

Definition at line 50 of file libopusdec.c.

◆ libopus_decode_close()

static av_cold int libopus_decode_close ( AVCodecContext avc)
static

Definition at line 140 of file libopusdec.c.

◆ libopus_decode()

static int libopus_decode ( AVCodecContext avc,
void *  data,
int got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 153 of file libopusdec.c.

◆ libopus_flush()

static void libopus_flush ( AVCodecContext avc)
static

Definition at line 200 of file libopusdec.c.

Variable Documentation

◆ libopusdec_options

const AVOption libopusdec_options[]
static
Initial value:
= {
{ NULL },
}

Definition at line 213 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,
}

Definition at line 220 of file libopusdec.c.

◆ ff_libopus_decoder

const AVCodec ff_libopus_decoder
Initial value:
= {
.name = "libopus",
.long_name = NULL_IF_CONFIG_SMALL("libopus Opus"),
.priv_data_size = sizeof(struct libopus_context),
.decode = libopus_decode,
.flush = libopus_flush,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
.priv_class = &libopusdec_class,
.wrapper_name = "libopus",
}

Definition at line 228 of file libopusdec.c.

libopus_flush
static void libopus_flush(AVCodecContext *avc)
Definition: libopusdec.c:200
libopusdec_options
static const AVOption libopusdec_options[]
Definition: libopusdec.c:213
libopusdec_class
static const AVClass libopusdec_class
Definition: libopusdec.c:220
libopus_decode_init
static av_cold int libopus_decode_init(AVCodecContext *avc)
Definition: libopusdec.c:50
libopus_context
Definition: libopusdec.c:36
init
static int init
Definition: av_tx.c:47
libopus_decode_close
static av_cold int libopus_decode_close(AVCodecContext *avc)
Definition: libopusdec.c:140
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
libopus_decode
static int libopus_decode(AVCodecContext *avc, void *data, int *got_frame_ptr, AVPacket *pkt)
Definition: libopusdec.c:153
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:109
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_CODEC_ID_OPUS
@ AV_CODEC_ID_OPUS
Definition: codec_id.h:483
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63